Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: ports/pnacl/build.sh

Issue 1553053002: Update pnacl toolchain build (Closed) Base URL: https://chromium.googlesource.com/webports.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ports/pnacl-llvm-src/pkg_info ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Native Client Authors. All rights reserved. 1 # Copyright (c) 2013 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 EXECUTABLES="arm-nacl-readelf le32-nacl-strings clang clang++"
6
5 PatchStep() { 7 PatchStep() {
6 DefaultPatchStep 8 DefaultPatchStep
7 MakeDir ${SRC_DIR}/toolchain_build/src 9 MakeDir ${SRC_DIR}/toolchain_build/src
8 Remove ${SRC_DIR}/toolchain_build/src/llvm 10 Remove ${SRC_DIR}/toolchain_build/src/llvm
9 LogExecute ln -fs ${SRC_DIR}/../../pnacl-llvm-src/llvm \ 11 LogExecute ln -fs ${SRC_DIR}/../../pnacl-llvm-src/llvm \
10 ${SRC_DIR}/toolchain_build/src/llvm 12 ${SRC_DIR}/toolchain_build/src/llvm
11 Remove ${SRC_DIR}/toolchain_build/src/binutils 13 Remove ${SRC_DIR}/toolchain_build/src/binutils
12 LogExecute ln -fs ${SRC_DIR}/../../pnacl-binutils-src/binutils \ 14 LogExecute ln -fs ${SRC_DIR}/../../pnacl-binutils-src/binutils \
13 ${SRC_DIR}/toolchain_build/src/binutils 15 ${SRC_DIR}/toolchain_build/src/binutils
14 Remove ${SRC_DIR}/toolchain_build/src/clang 16 Remove ${SRC_DIR}/toolchain_build/src/clang
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 62
61 EXTRA_CONFIGURE="--extra-configure-arg=ac_cv_func_vfork_works=no" 63 EXTRA_CONFIGURE="--extra-configure-arg=ac_cv_func_vfork_works=no"
62 EXTRA_CONFIGURE+=" --extra-configure-arg=--disable-compiler-version-checks" 64 EXTRA_CONFIGURE+=" --extra-configure-arg=--disable-compiler-version-checks"
63 EXTRA_CONFIGURE+=" --extra-configure-arg=--enable-libcpp" 65 EXTRA_CONFIGURE+=" --extra-configure-arg=--enable-libcpp"
64 66
65 # Some code in llvm uses intrisics not supported in the pnacl stable abi. 67 # Some code in llvm uses intrisics not supported in the pnacl stable abi.
66 EXTRA_CC_ARGS="-fgnu-inline-asm" 68 EXTRA_CC_ARGS="-fgnu-inline-asm"
67 EXTRA_CC_ARGS+=" --pnacl-disable-abi-check" 69 EXTRA_CC_ARGS+=" --pnacl-disable-abi-check"
68 LINUX_PNACL=${NACL_SDK_ROOT}/toolchain/linux_pnacl 70 LINUX_PNACL=${NACL_SDK_ROOT}/toolchain/linux_pnacl
69 USR_LOCAL=${LINUX_PNACL}/le32-nacl/usr 71 USR_LOCAL=${LINUX_PNACL}/le32-nacl/usr
70 EXTRA_CC_ARGS+=" -Dmain=nacl_main"
71 EXTRA_CC_ARGS+=" -include nacl_main.h"
72 EXTRA_CC_ARGS+=" -include spawn.h" 72 EXTRA_CC_ARGS+=" -include spawn.h"
73 EXTRA_CC_ARGS+=" -I${USR_LOCAL}/include/glibc-compat" 73 EXTRA_CC_ARGS+=" -I${USR_LOCAL}/include/glibc-compat"
74 EXTRA_CC_ARGS+=" -I${NACL_SDK_ROOT}/include" 74 EXTRA_CC_ARGS+=" -I${NACL_SDK_ROOT}/include"
75 EXTRA_CC_ARGS+=" -I${USR_LOCAL}/include" 75 EXTRA_CC_ARGS+=" -I${USR_LOCAL}/include"
76 EXTRA_CC_ARGS+=" -L${NACL_SDK_ROOT}/lib/pnacl/Release" 76 EXTRA_CC_ARGS+=" -L${NACL_SDK_ROOT}/lib/pnacl/Release"
77 EXTRA_CC_ARGS+=" -L${USR_LOCAL}/lib" 77 EXTRA_CC_ARGS+=" -L${USR_LOCAL}/lib"
78 EXTRA_CC_ARGS+=" -Wl,--undefined=PSUserCreateInstance"
79 EXTRA_CC_ARGS+=" -Wl,--undefined=nacl_main"
80 EXTRA_CC_ARGS+=" -Wl,--undefined=waitpid"
81 EXTRA_CC_ARGS+=" -Wl,--undefined=spawnve"
82 EXTRA_CC_ARGS+=" -pthread" 78 EXTRA_CC_ARGS+=" -pthread"
83 EXTRA_CC_ARGS+=" ${NACL_CLI_MAIN_LIB} -lppapi_simple" 79 EXTRA_CC_ARGS+=" ${NACL_CLI_MAIN_LDFLAGS}"
84 EXTRA_CC_ARGS+=" -lnacl_io -lppapi_cpp -lppapi" 80 EXTRA_CC_ARGS+=" -lglibc-compat ${NACL_CLI_MAIN_LIB_CPP}"
85 EXTRA_CC_ARGS+=" -l${NACL_CXX_LIB} -lm -lglibc-compat"
86 81
87 export GOLD_LDADD 82 export GOLD_LDADD
88 export EXTRA_CONFIGURE 83 export EXTRA_CONFIGURE
89 export EXTRA_CC_ARGS 84 export EXTRA_CC_ARGS
90 LogExecute ${SRC_DIR}/toolchain_build/toolchain_build_pnacl.py -v \ 85 LogExecute ${SRC_DIR}/toolchain_build/toolchain_build_pnacl.py -v \
91 --no-use-cached-results \ 86 --no-use-cached-results \
92 --no-use-remote-cache \ 87 --no-use-remote-cache \
93 --no-annotator \ 88 --no-annotator \
94 --pnacl-in-pnacl \ 89 --pnacl-in-pnacl \
95 "--extra-cc-args=${EXTRA_CC_ARGS}" \ 90 "--extra-cc-args=${EXTRA_CC_ARGS}" \
96 ${EXTRA_CONFIGURE} \ 91 ${EXTRA_CONFIGURE} \
97 "--binutils-pnacl-extra-configure=${GOLD_LDADD}" 92 "--binutils-pnacl-extra-configure=${GOLD_LDADD}"
98 93
99 rm -rf ${BUILD_DIR}/* 94 Remove ${BUILD_DIR}
95 MakeDir ${BUILD_DIR}
100 LogExecute cp \ 96 LogExecute cp \
101 ${SRC_DIR}/toolchain_build/out/llvm_le32_nacl_install/bin/* \ 97 ${SRC_DIR}/toolchain_build/out/llvm_le32_nacl_install/bin/* ${BUILD_DIR}/
102 ${BUILD_DIR}/
103 LogExecute cp \ 98 LogExecute cp \
104 ${SRC_DIR}/toolchain_build/out/binutils_pnacl_le32_nacl_install/bin/* \ 99 ${SRC_DIR}/toolchain_build/out/binutils_pnacl_le32_nacl_install/bin/* \
105 ${BUILD_DIR}/ 100 ${BUILD_DIR}/
106 # TODO(bradnelson): Drop this once shell script fix is done. 101 # TODO(bradnelson): Drop this once shell script fix is done.
107 MakeDir ${BUILD_DIR}/driver 102 MakeDir ${BUILD_DIR}/driver
108 LogExecute cp ${SRC_DIR}/pnacl/driver/redirect.sh ${BUILD_DIR}/driver/ 103 LogExecute cp ${SRC_DIR}/pnacl/driver/redirect.sh ${BUILD_DIR}/driver/
109 LogExecute cp ${SRC_DIR}/pnacl/driver/*.py ${BUILD_DIR}/driver/ 104 LogExecute cp ${SRC_DIR}/pnacl/driver/*.py ${BUILD_DIR}/driver/
110 } 105 }
111 106
112 InstallArch() { 107 InstallStep() {
113 local arch=$1 108 local ASSEMBLY_DIR=${DESTDIR}/${PREFIX}/pnacl
114
115 local ASSEMBLY_DIR=${PUBLISH_DIR}/${arch}
116 Remove ${ASSEMBLY_DIR}/ 109 Remove ${ASSEMBLY_DIR}/
117 MakeDir ${ASSEMBLY_DIR}/ 110 MakeDir ${ASSEMBLY_DIR}/
118 ChangeDir ${ASSEMBLY_DIR}/
119 111
120 LogExecute cp -r ${NACL_SDK_ROOT}/examples ${ASSEMBLY_DIR}/ 112 LogExecute cp -r ${NACL_SDK_ROOT}/toolchain/linux_pnacl/* ${ASSEMBLY_DIR}
121 LogExecute cp -r ${NACL_SDK_ROOT}/getting_started ${ASSEMBLY_DIR}/
122 LogExecute cp -r ${NACL_SDK_ROOT}/include ${ASSEMBLY_DIR}/
123 LogExecute cp -r ${NACL_SDK_ROOT}/src ${ASSEMBLY_DIR}/
124
125 for f in AUTHORS COPYING LICENSE NOTICE README README.Makefiles; do
126 LogExecute cp ${NACL_SDK_ROOT}/${f} ${ASSEMBLY_DIR}/
127 done
128
129 MakeDir ${ASSEMBLY_DIR}/lib
130 LogExecute cp -r ${NACL_SDK_ROOT}/lib/pnacl ${ASSEMBLY_DIR}/lib/
131
132 LogExecute cp -r ${NACL_SDK_ROOT}/tools ${ASSEMBLY_DIR}/
133
134 MakeDir ${ASSEMBLY_DIR}/toolchain
135 LogExecute cp -r ${NACL_SDK_ROOT}/toolchain/linux_pnacl \
136 ${ASSEMBLY_DIR}/toolchain
137 113
138 # Drop pyc files. 114 # Drop pyc files.
139 LogExecute find ${ASSEMBLY_DIR} -name "*.pyc" -exec rm {} \; 115 LogExecute find ${ASSEMBLY_DIR} -name "*.pyc" -exec rm {} \;
140 116
141 # TODO(bradnelson): Drop this once shell script fix is done. 117 # TODO(bradnelson): Drop this once shell script fix is done.
142 LogExecute cp \ 118 LogExecute cp ${BUILD_DIR}/driver/*.py ${ASSEMBLY_DIR}/bin/pydir/
143 ${BUILD_DIR}/driver/*.py \
144 ${ASSEMBLY_DIR}/toolchain/linux_pnacl/bin/pydir/
145 119
146 # Swap in nacl executables. 120 # Swap in nacl executables.
121 Remove ${ASSEMBLY_DIR}/lib/*.so
147 for f in $(find ${ASSEMBLY_DIR} -executable -type f); do 122 for f in $(find ${ASSEMBLY_DIR} -executable -type f); do
148 if [ "$(file ${f} | grep ELF)" != "" ]; then 123 if [ "$(file ${f} | grep ELF)" != "" ]; then
149 LogExecute rm -f ${f}
150 local pexe="${BUILD_DIR}/$(basename ${f})" 124 local pexe="${BUILD_DIR}/$(basename ${f})"
151 if [ -f "${pexe}" ]; then 125 if [ -f "${pexe}" ]; then
152 echo hi 126 LogExecute ${PNACLFINALIZE} ${pexe} -o ${f}
153 LogExecute "${TRANSLATOR}" \
154 -O2 -arch "${arch}" --allow-llvm-bitcode-input \
155 -ffunction-sections --gc-sections \
156 "${pexe}" \
157 -o "${f}"
158 else 127 else
159 echo "Warning: dropping ${f} without a nacl replacement." 128 echo "Warning: dropping ${f} without a nacl replacement."
129 LogExecute rm -f ${f}
160 fi 130 fi
161 elif [ "$(head -n 1 ${f} | grep /bin/sh)" != "" ]; then 131 elif [ "$(head -n 1 ${f} | grep /bin/sh)" != "" ]; then
162 # TODO(bradnelson): Drop this once shell script fix is done. 132 # TODO(bradnelson): Drop this once shell script fix is done.
163 LogExecute cp -f ${BUILD_DIR}/driver/redirect.sh ${f} 133 LogExecute cp -f ${BUILD_DIR}/driver/redirect.sh ${f}
164 LogExecute chmod a+x ${f} 134 LogExecute chmod a+x ${f}
165 fi 135 fi
166 done 136 done
167
168 LogExecute zip -rq ${PUBLISH_DIR}/${arch}.zip .
169 } 137 }
170 138
171 InstallStep() { 139 PostInstallTestStep() {
172 local ARCH_LIST="arm i686 x86_64" 140 # Verify that binaries at least load under sel_ldr
173 for arch in ${ARCH_LIST}; do 141 LogExecute ./le32-nacl-strings.sh --version
174 InstallArch ${arch} 142 LogExecute ./arm-nacl-readelf.sh --version
175 done 143 # TODO(sbc): Currently this fails because the wrong main symbol is found
144 # by the linker (the libppapi one rather than the libppapi_simple one).
145 #LogExecute ./clang.sh --version
176 } 146 }
OLDNEW
« no previous file with comments | « ports/pnacl-llvm-src/pkg_info ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698