<commit_before># Copyright (c) 2012 The Native Client Authors.  All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# simple example(s) for builing shared images with the pnacl TC
# which do not require glibc
#
# How to use:
# -----------
# make prereqs
# make prereqs.x8632
# make run1.x8632

ROOT=$(shell readlink -f ../../)
TC_ROOT=$(ROOT)/toolchain/pnacl_linux_x86_64/glibc
PNACL_CC=$(TC_ROOT)/bin/pnacl-clang -Wall -Werror
PNACL_LD=$(TC_ROOT)/bin/pnacl-nativeld
PNACL_AR=$(TC_ROOT)/bin/pnacl-ar
PNACL_TRANS=$(TC_ROOT)/bin/pnacl-translate

BOOTER_X8632=$(ROOT)/scons-out/opt-linux-x86-32/staging/nacl_helper_bootstrap
BOOTER_X8664=$(ROOT)/scons-out/opt-linux-x86-64/staging/nacl_helper_bootstrap

LOADER_X8632=$(ROOT)/scons-out/opt-linux-x86-32/staging/sel_ldr
LOADER_X8664=$(ROOT)/scons-out/opt-linux-x86-64/staging/sel_ldr

IRT_X8632=$(ROOT)/scons-out/nacl_irt-x86-32/staging/irt.nexe
IRT_X8664=$(ROOT)/scons-out/nacl_irt-x86-64/staging/irt.nexe

LDSO_X8632=$(ROOT)/toolchain/pnacl_linux_x86_64/lib-x86-32/runnable-ld.so
LDSO_X8664=$(ROOT)/toolchain/pnacl_linux_x86_64/lib-x86-64/runnable-ld.so

LIBPATH_SHARED_X8632=$(ROOT)/toolchain/pnacl_linux_x86_64/lib-x86-32
LIBPATH_SHARED_X8664=$(ROOT)/toolchain/pnacl_linux_x86_64/lib-x86-64

# These looks like they have arch bias but we are just pulling bitcode
LIBPATH_NEWLIB=$(ROOT)/toolchain/pnacl_linux_x86_64/newlib/usr/lib
LIBPATH_BITCODE_SDK=$(ROOT)/scons-out/nacl-x86-32-pnacl-pexe-clang/lib
LIBPATH_SHIM=$(ROOT)/scons-out/nacl-x86-64-pnacl-pexe-clang/obj/src/untrusted/pnacl_irt_shim
PATH_CRT_BITCODE=$(ROOT)/toolchain/pnacl_linux_x86_64/newlib/lib

COMMON_FLAGS= --pnacl-driver-verbose -save-temps
RUNNER_DEBUG= # -E LD_DEBUG=all

RUNNER_X8632=$(BOOTER_X8632) $(LOADER_X8632) -S $(RUNNER_DEBUG) \
       --r_debug=0xXXXXXXXXXXXXXXXX -a -B $(IRT_X8632) \
       -- $(LDSO_X8632) --library-path $(LIBPATH_SHARED_X8632):x8632

RUNNER_X8664=$(BOOTER_X8664) $(LOADER_X8664) -S $(RUNNER_DEBUG) \
       --r_debug=0xXXXXXXXXXXXXXXXX -a -B $(IRT_X8664) \
       -- $(LDSO_X8664) --library-path $(LIBPATH_SHARED_X8664):x8664


######################################################################
PNACL_CC_FLAGS = $(COMMON_FLAGS) -I ../../..

hello1.bc:  hello1.c
	$(PNACL_CC)  -c $(PNACL_CC_FLAGS) -o $@ $^

fortytwo.bc:  fortytwo.c
	$(PNACL_CC)  -c $(PNACL_CC_FLAGS) -o $@ $^

startup_newlib_dynamic.bc: startup_newlib_dynamic.c
	$(PNACL_CC)  -c  $(PNACL_CC_FLAGS) -o $@ $^

######################################################################<commit_msg>Corrected some paths inside the shared newlib experiment to reflect new locations within scons-out<commit_after># Copyright (c) 2012 The Native Client Authors.  All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# simple example(s) for builing shared images with the pnacl TC
# which do not require glibc
#
# How to use:
# -----------
# make prereqs
# make prereqs.x8632
# make run1.x8632

ROOT=$(shell readlink -f ../../)
TC_ROOT=$(ROOT)/toolchain/pnacl_linux_x86_64/glibc
PNACL_CC=$(TC_ROOT)/bin/pnacl-clang -Wall -Werror
PNACL_LD=$(TC_ROOT)/bin/pnacl-nativeld
PNACL_AR=$(TC_ROOT)/bin/pnacl-ar
PNACL_TRANS=$(TC_ROOT)/bin/pnacl-translate

BOOTER_X8632=$(ROOT)/scons-out/opt-linux-x86-32/staging/nacl_helper_bootstrap
BOOTER_X8664=$(ROOT)/scons-out/opt-linux-x86-64/staging/nacl_helper_bootstrap

LOADER_X8632=$(ROOT)/scons-out/opt-linux-x86-32/staging/sel_ldr
LOADER_X8664=$(ROOT)/scons-out/opt-linux-x86-64/staging/sel_ldr

IRT_X8632=$(ROOT)/scons-out/nacl_irt-x86-32/staging/irt.nexe
IRT_X8664=$(ROOT)/scons-out/nacl_irt-x86-64/staging/irt.nexe

LDSO_X8632=$(ROOT)/toolchain/pnacl_linux_x86_64/lib-x86-32/runnable-ld.so
LDSO_X8664=$(ROOT)/toolchain/pnacl_linux_x86_64/lib-x86-64/runnable-ld.so

LIBPATH_SHARED_X8632=$(ROOT)/toolchain/pnacl_linux_x86_64/lib-x86-32
LIBPATH_SHARED_X8664=$(ROOT)/toolchain/pnacl_linux_x86_64/lib-x86-64

# These looks like they have arch bias but we are just pulling bitcode
LIBPATH_NEWLIB=$(ROOT)/toolchain/pnacl_linux_x86_64/newlib/usr/lib
LIBPATH_BITCODE_SDK=$(ROOT)/scons-out/nacl-x86-32-pnacl-pexe-shared-clang/lib
LIBPATH_SHIM=$(ROOT)/scons-out/nacl-x86-64-pnacl-pexe-shared-clang/obj/src/untrusted/pnacl_irt_shim
PATH_CRT_BITCODE=$(ROOT)/toolchain/pnacl_linux_x86_64/newlib/lib

COMMON_FLAGS= --pnacl-driver-verbose -save-temps
RUNNER_DEBUG= # -E LD_DEBUG=all

RUNNER_X8632=$(BOOTER_X8632) $(LOADER_X8632) -S $(RUNNER_DEBUG) \
       --r_debug=0xXXXXXXXXXXXXXXXX -a -B $(IRT_X8632) \
       -- $(LDSO_X8632) --library-path $(LIBPATH_SHARED_X8632):x8632

RUNNER_X8664=$(BOOTER_X8664) $(LOADER_X8664) -S $(RUNNER_DEBUG) \
       --r_debug=0xXXXXXXXXXXXXXXXX -a -B $(IRT_X8664) \
       -- $(LDSO_X8664) --library-path $(LIBPATH_SHARED_X8664):x8664


######################################################################
PNACL_CC_FLAGS = $(COMMON_FLAGS) -I ../../..

hello1.bc:  hello1.c
	$(PNACL_CC)  -c $(PNACL_CC_FLAGS) -o $@ $^

fortytwo.bc:  fortytwo.c
	$(PNACL_CC)  -c $(PNACL_CC_FLAGS) -o $@ $^

startup_newlib_dynamic.bc: startup_newlib_dynamic.c
	$(PNACL_CC)  -c  $(PNACL_CC_FLAGS) -o $@ $^

######################################################################
{'fraction_non_alphanumeric': 0.19810066476733143, 'fraction_numerical': 0.07179487179487179, 'mean_word_length': 5.130384167636787, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2346932', 'n_tokens_mistral': 2422, 'n_tokens_neox': 2178, 'n_words': 293}