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

Side by Side Diff: build_tools/common.sh

Issue 1417373005: Fix shared library support in glibc python build (Closed) Base URL: https://chromium.googlesource.com/external/naclports.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | ports/python/build.sh » ('j') | ports/python/build.sh » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Native Client Authors. All rights reserved. 1 # Copyright (c) 2012 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 # Environment variable NACL_ARCH should be set to one of the following 5 # Environment variable NACL_ARCH should be set to one of the following
6 # values: i686 x86_64 pnacl arm 6 # values: i686 x86_64 pnacl arm
7 7
8 8
9 # NAMING CONVENTION 9 # NAMING CONVENTION
10 # ================= 10 # =================
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 332
333 PatchSpecsFile() { 333 PatchSpecsFile() {
334 if [ "${TOOLCHAIN}" = "pnacl" -o \ 334 if [ "${TOOLCHAIN}" = "pnacl" -o \
335 "${TOOLCHAIN}" = "clang-newlib" -o \ 335 "${TOOLCHAIN}" = "clang-newlib" -o \
336 "${TOOLCHAIN}" = "emscripten" ]; then 336 "${TOOLCHAIN}" = "emscripten" ]; then
337 # The emscripten and PNaCl toolchains already include the required 337 # The emscripten and PNaCl toolchains already include the required
338 # include and library paths by default. No need to patch them. 338 # include and library paths by default. No need to patch them.
339 return 339 return
340 fi 340 fi
341 341
342 # For the library path we always explicitly add to the link flags
343 # otherwise 'libtool' won't find the libraries correctly. This
344 # is because libtool uses 'gcc -print-search-dirs' which does
345 # not honor the external specs file.
346 NACLPORTS_LDFLAGS+=" -L${NACLPORTS_LIBDIR}"
347 NACLPORTS_LDFLAGS+=" -Wl,-rpath-link=${NACLPORTS_LIBDIR}"
348
342 # SPECS_FILE is where nacl-gcc 'specs' file will be installed 349 # SPECS_FILE is where nacl-gcc 'specs' file will be installed
343 local SPECS_DIR= 350 local SPECS_DIR=
344 if [ "${NACL_ARCH}" = "arm" ]; then 351 if [ "${NACL_ARCH}" = "arm" ]; then
345 SPECS_DIR=${NACL_TOOLCHAIN_ROOT}/lib/gcc/arm-nacl/4.8.3 352 SPECS_DIR=${NACL_TOOLCHAIN_ROOT}/lib/gcc/arm-nacl/4.8.3
346 if [ ! -d "${SPECS_DIR}" ]; then 353 if [ ! -d "${SPECS_DIR}" ]; then
347 SPECS_DIR=${NACL_TOOLCHAIN_ROOT}/lib/gcc/arm-nacl/4.9.2 354 SPECS_DIR=${NACL_TOOLCHAIN_ROOT}/lib/gcc/arm-nacl/4.9.2
348 fi 355 fi
349 else 356 else
350 SPECS_DIR=${NACL_TOOLCHAIN_ROOT}/lib/gcc/x86_64-nacl/4.4.3 357 SPECS_DIR=${NACL_TOOLCHAIN_ROOT}/lib/gcc/x86_64-nacl/4.4.3
351 fi 358 fi
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 N 406 N
400 s|$| -rpath-link=${SED_SAFE_SPACES_USR_LIB} -L${SED_SAFE_SPACES_USR_LIB}| 407 s|$| -rpath-link=${SED_SAFE_SPACES_USR_LIB} -L${SED_SAFE_SPACES_USR_LIB}|
401 }" > "${SPECS_FILE}" 408 }" > "${SPECS_FILE}"
402 409
403 # For static-only toolchains (i.e. pnacl), modify the specs file to give an 410 # For static-only toolchains (i.e. pnacl), modify the specs file to give an
404 # error when attempting to create a shared object. 411 # error when attempting to create a shared object.
405 if [ "${NACL_SHARED}" != "1" ]; then 412 if [ "${NACL_SHARED}" != "1" ]; then
406 sed -i.bak "s/%{shared:-shared/%{shared:%e${ERROR_MSG}/" "${SPECS_FILE}" 413 sed -i.bak "s/%{shared:-shared/%{shared:%e${ERROR_MSG}/" "${SPECS_FILE}"
407 fi 414 fi
408 415
409 # For the library path we always explicitly add to the link flags
410 # otherwise 'libtool' won't find the libraries correctly. This
411 # is because libtool uses 'gcc -print-search-dirs' which does
412 # not honor the external specs file.
413 NACLPORTS_LDFLAGS+=" -L${NACLPORTS_LIBDIR}"
414 NACLPORTS_LDFLAGS+=" -Wl,-rpath-link=${NACLPORTS_LIBDIR}"
415 } 416 }
416 417
417 418
418 ###################################################################### 419 ######################################################################
419 # Helper functions 420 # Helper functions
420 ###################################################################### 421 ######################################################################
421 422
422 Banner() { 423 Banner() {
423 echo "######################################################################" 424 echo "######################################################################"
424 echo "$@" 425 echo "$@"
(...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 ###################################################################### 1584 ######################################################################
1584 # Always run 1585 # Always run
1585 # These functions are called when this script is imported to do 1586 # These functions are called when this script is imported to do
1586 # any essential checking/setup operations. 1587 # any essential checking/setup operations.
1587 ###################################################################### 1588 ######################################################################
1588 PatchSpecsFile 1589 PatchSpecsFile
1589 InjectSystemHeaders 1590 InjectSystemHeaders
1590 InstallConfigSite 1591 InstallConfigSite
1591 GetRevision 1592 GetRevision
1592 MakeDirs 1593 MakeDirs
OLDNEW
« no previous file with comments | « no previous file | ports/python/build.sh » ('j') | ports/python/build.sh » ('J')

Powered by Google App Engine
This is Rietveld 408576698