diff options
author | Han Shen <shenhan@google.com> | 2015-12-17 11:08:50 -0800 |
---|---|---|
committer | Han Shen <shenhan@google.com> | 2015-12-17 11:38:22 -0800 |
commit | 3febaa7a3e7b8e89ef420c7984d60816798f1678 (patch) | |
tree | ea5d57637272a7e98c7adef79bcba8ea185842fa /binutils-2.25 | |
parent | ec97727e655f49b010f4cf8c410631910d22199f (diff) | |
download | toolchain_binutils-3febaa7a3e7b8e89ef420c7984d60816798f1678.tar.gz toolchain_binutils-3febaa7a3e7b8e89ef420c7984d60816798f1678.tar.bz2 toolchain_binutils-3febaa7a3e7b8e89ef420c7984d60816798f1678.zip |
Make genscripts.sh neutral to ChromeOS and Android.
ChromeOS reported a bug complaining about no default library search path
after unification. Bug here -
https://code.google.com/p/chromium/issues/detail?id=569605
Fix it for ChromeOS. This fix does not change anything for Android.
Test:
ChromeOS: manually test bug is fixed
Android: ./build.py --host=linux --toolchain=x86_64
Change-Id: Ia900d081980d408c62a737917708e19842357e8e
Diffstat (limited to 'binutils-2.25')
-rwxr-xr-x | binutils-2.25/ld/genscripts.sh | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/binutils-2.25/ld/genscripts.sh b/binutils-2.25/ld/genscripts.sh index 1d8c4de6..fa08a36c 100755 --- a/binutils-2.25/ld/genscripts.sh +++ b/binutils-2.25/ld/genscripts.sh @@ -145,6 +145,24 @@ if [ "${LIB_PATH}" != ":" ] ; then lib_path2=${LIB_PATH} fi +# Return 0 if this is building for ChromeOS target. +# Currently ChromeOS targets and Android targets do not intersect. +is_chromeos_target() +{ + for t in \ + arm-none-eabi \ + armv7a-cros-linux-gnueabi \ + i686-pc-linux-gnu \ + x86_64-cros-linux-gnu \ + x86_64-pc-linux-gnu ; + do + if [[ "$1" == "${t}" ]]; then + return 0 + fi + done + return 1 +} + # Add args to lib_path1 and lib_path2, discarding any duplicates append_to_lib_path() { @@ -228,6 +246,10 @@ case :${lib_path1}:${lib_path2}: in *) LIB_PATH=${lib_path1}:${lib_path2} ;; esac +if is_chromeos_target ${target}; then + LIB_SEARCH_DIRS=`echo ${LIB_PATH} | sed -e 's/:/ /g' -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\\"\1\\");/g'` +fi + # For Android, comment out LIB_SEARCH_DIRS. #LIB_SEARCH_DIRS=`echo ${LIB_PATH} | sed -e 's/:/ /g' -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\\"\1\\");/g'` @@ -295,7 +317,9 @@ LD_FLAG= DATA_ALIGNMENT=${DATA_ALIGNMENT_} RELOCATING=" " ( echo "/* Default linker script, for normal executables */" - echo "/* Modified for Android. */" + if ! is_chromeos_target ${target}; then + echo "/* Modified for Android. */" + fi . ${CUSTOMIZER_SCRIPT} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.x @@ -349,7 +373,9 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; then DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}} COMBRELOC=ldscripts/${EMULATION_NAME}.xsc.tmp ( echo "/* Script for --shared -z combreloc: shared library, combine & sort relocs */" - echo "/* Modified for Android. */" + if ! is_chromeos_target ${target}; then + echo "/* Modified for Android. */" + fi . ${CUSTOMIZER_SCRIPT} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsc |