| OLD | NEW |
| 1 # Copyright (c) 2015 The Native Client Authors. All rights reserved. | 1 # Copyright (c) 2015 The Native Client Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # falling back to cc for generating build time artifacts | 5 # falling back to cc for generating build time artifacts |
| 6 export BUILD_CC=cc | 6 export BUILD_CC=cc |
| 7 export BUILD_LD=cc | 7 export BUILD_LD=cc |
| 8 # use -Wno-return-type to suppress return-type errors encountered | 8 # use -Wno-return-type to suppress return-type errors encountered |
| 9 # with pnacl, arm's clang-newlib (microperl) | 9 # with pnacl, arm's clang-newlib (microperl) |
| 10 NACLPORTS_CFLAGS_MICRO=$NACLPORTS_CFLAGS | 10 NACLPORTS_CFLAGS_MICRO=$NACLPORTS_CFLAGS |
| 11 NACLPORTS_CFLAGS_MICRO+=" -Dmain=nacl_main -Wno-return-type " | 11 NACLPORTS_CFLAGS_MICRO+=" -Wno-return-type " |
| 12 NACLPORTS_CFLAGS+=" -I${NACL_SDK_ROOT}/include -I${NACLPORTS_INCLUDE} \ | 12 NACLPORTS_CFLAGS+=" -I${NACL_SDK_ROOT}/include -I${NACLPORTS_INCLUDE} \ |
| 13 -Wno-return-type" | 13 -Wno-return-type" |
| 14 BUILD_DIR=${SRC_DIR} | 14 BUILD_DIR=${SRC_DIR} |
| 15 # keeping microperl for now | 15 # keeping microperl for now |
| 16 EXECUTABLES="perl microperl" | 16 EXECUTABLES="perl microperl" |
| 17 NACLPORTS_LDFLAGS+=" ${NACL_CLI_MAIN_LIB}" | |
| 18 # we need a working perl on host to build things for target | 17 # we need a working perl on host to build things for target |
| 19 HOST_BUILD=${WORK_DIR}/build_host | 18 HOST_BUILD=${WORK_DIR}/build_host |
| 20 ARCH_DIR=${PUBLISH_DIR}/${NACL_ARCH} | 19 ARCH_DIR=${PUBLISH_DIR}/${NACL_ARCH} |
| 21 NACLPORTS_LIBS=" ${NACL_CLI_MAIN_LIB}" | |
| 22 # PNaCl and newlib dont have dynamic loading, so | 20 # PNaCl and newlib dont have dynamic loading, so |
| 23 # using Perl's internal stub file dl_none.xs | 21 # using Perl's internal stub file dl_none.xs |
| 24 # specifically for systems which do not support it | 22 # specifically for systems which do not support it |
| 25 # Also, FILE pointer is structured a bit differently | 23 # Also, FILE pointer is structured a bit differently |
| 26 # Relevant stdio parameters found via sel_ldr on Linux | 24 # Relevant stdio parameters found via sel_ldr on Linux |
| 27 if [ "${NACL_LIBC}" = "newlib" -o "${NACL_ARCH}" = "pnacl" ] ; then | 25 if [ "${NACL_LIBC}" = "newlib" -o "${NACL_ARCH}" = "pnacl" ] ; then |
| 28 NACLPORTS_LIBS+=" -lm -ltar" | 26 NACLPORTS_LIBS+=" -lm -ltar" |
| 29 DYNAMIC_EXT="" | 27 DYNAMIC_EXT="" |
| 30 NACL_GLIBC_DEF="undef" | 28 NACL_GLIBC_DEF="undef" |
| 31 PERL_STDIO_BASE="(((fp)->_bf)._base)" | 29 PERL_STDIO_BASE="(((fp)->_bf)._base)" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 53 PERL_STDIO_PTR="((fp)->_IO_read_ptr)" | 51 PERL_STDIO_PTR="((fp)->_IO_read_ptr)" |
| 54 PERL_DLSRC="dl_dlopen.xs" | 52 PERL_DLSRC="dl_dlopen.xs" |
| 55 NACLPORTS_CCDLFLAGS="-Wl,-E" | 53 NACLPORTS_CCDLFLAGS="-Wl,-E" |
| 56 fi | 54 fi |
| 57 # include Errno in pnacl | 55 # include Errno in pnacl |
| 58 NONXS_EXT="" | 56 NONXS_EXT="" |
| 59 if [ "${NACL_ARCH}" = "pnacl" ] ; then | 57 if [ "${NACL_ARCH}" = "pnacl" ] ; then |
| 60 NONXS_EXT="Errno" | 58 NONXS_EXT="Errno" |
| 61 fi | 59 fi |
| 62 | 60 |
| 61 EnableCliMain |
| 63 EnableGlibcCompat | 62 EnableGlibcCompat |
| 64 | 63 |
| 65 # BuildHostMiniperl builds miniperl for host, which is needed for | 64 # BuildHostMiniperl builds miniperl for host, which is needed for |
| 66 # building Perl for the target | 65 # building Perl for the target |
| 67 BuildHostMiniperl() { | 66 BuildHostMiniperl() { |
| 68 if [ ! -x ${HOST_BUILD}/miniperl ]; then | 67 if [ ! -x ${HOST_BUILD}/miniperl ]; then |
| 69 MakeDir ${HOST_BUILD} | 68 MakeDir ${HOST_BUILD} |
| 70 ChangeDir ${SRC_DIR} | 69 ChangeDir ${SRC_DIR} |
| 71 LogExecute ${SRC_DIR}/Configure -des -Dprefix=${HOST_BUILD} | 70 LogExecute ${SRC_DIR}/Configure -des -Dprefix=${HOST_BUILD} |
| 72 LogExecute make -j${OS_JOBS} miniperl | 71 LogExecute make -j${OS_JOBS} miniperl |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 ./Policy_sh.SH | 127 ./Policy_sh.SH |
| 129 ./x2p/Makefile.SH | 128 ./x2p/Makefile.SH |
| 130 } | 129 } |
| 131 | 130 |
| 132 BuildStep() { | 131 BuildStep() { |
| 133 # clean up previous executables | 132 # clean up previous executables |
| 134 LogExecute make -j${OS_JOBS} -f Makefile.micro clean | 133 LogExecute make -j${OS_JOBS} -f Makefile.micro clean |
| 135 # microperl build from Makefile.micro | 134 # microperl build from Makefile.micro |
| 136 LogExecute make -j${OS_JOBS} -f Makefile.micro CC="${NACLCC}" \ | 135 LogExecute make -j${OS_JOBS} -f Makefile.micro CC="${NACLCC}" \ |
| 137 CCFLAGS=" -c -DHAS_DUP2 -DPERL_MICRO ${NACLPORTS_CFLAGS_MICRO}" \ | 136 CCFLAGS=" -c -DHAS_DUP2 -DPERL_MICRO ${NACLPORTS_CFLAGS_MICRO}" \ |
| 138 LDFLAGS="${NACLPORTS_LDFLAGS}" | 137 LDFLAGS="${NACLPORTS_LDFLAGS}" LIBS="${NACLPORTS_LIBS}" |
| 139 # now make perl | 138 # now make perl |
| 140 LogExecute cp -f microperl ${HOST_BUILD} | 139 LogExecute cp -f microperl ${HOST_BUILD} |
| 141 LogExecute make clean | 140 LogExecute make clean |
| 142 LogExecute ${BUILD_CC} -c -DPERL_CORE -fwrapv -fno-strict-aliasing -pipe \ | 141 LogExecute ${BUILD_CC} -c -DPERL_CORE -fwrapv -fno-strict-aliasing -pipe \ |
| 143 -O2 -Wall generate_uudmap.c | 142 -O2 -Wall generate_uudmap.c |
| 144 LogExecute ${BUILD_LD} -o generate_uudmap generate_uudmap.o -lm | 143 LogExecute ${BUILD_LD} -o generate_uudmap generate_uudmap.o -lm |
| 145 LogExecute make -j${OS_JOBS} libs="${NACLPORTS_LIBS}" all | 144 LogExecute make -j${OS_JOBS} libs="${NACLPORTS_LIBS}" all |
| 146 # test_prep prepares the perl for tests, might use this later | 145 # test_prep prepares the perl for tests, might use this later |
| 147 LogExecute make -j${OS_JOBS} libs="${NACLPORTS_LIBS}" test_prep | 146 LogExecute make -j${OS_JOBS} libs="${NACLPORTS_LIBS}" test_prep |
| 148 LogExecute mv -f ${HOST_BUILD}/microperl ${SRC_DIR} | 147 LogExecute mv -f ${HOST_BUILD}/microperl ${SRC_DIR} |
| (...skipping 27 matching lines...) Expand all Loading... |
| 176 EXPECTED=${START_DIR}/expected_${TOOLCHAIN}.txt | 175 EXPECTED=${START_DIR}/expected_${TOOLCHAIN}.txt |
| 177 if ! cmp tests_out.txt ${EXPECTED}; then | 176 if ! cmp tests_out.txt ${EXPECTED}; then |
| 178 echo "Test output did not match expected output" | 177 echo "Test output did not match expected output" |
| 179 echo "See ${PWD}/tests_err.txt" | 178 echo "See ${PWD}/tests_err.txt" |
| 180 diff -u tests_out.txt ${EXPECTED} | 179 diff -u tests_out.txt ${EXPECTED} |
| 181 exit 1 | 180 exit 1 |
| 182 fi | 181 fi |
| 183 | 182 |
| 184 echo "PASSED" | 183 echo "PASSED" |
| 185 } | 184 } |
| OLD | NEW |