From 7225345dbbe39f61b1c7e52732b621cfb1d830c5 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 17 Jan 2014 10:39:50 +1030 Subject: [PATCH] Allow ld target customiser script to force on disk scripts. Mucking with EMULATION_LIBPATH has unwanted side effects. Allow nds32 emulparams scripts to disable compiled-in scripts naturally, by setting COMPILE_IN=no. * genscripts.sh (COMPILE_IN): Don't set if already set. * emulparams/nds32elf.sh: Don't clear EMULATION_LIBPATH, set COMPILE_IN=no. * emulparams/nds32elf16m.sh: Likewise. * emulparams/nds32elf_linux.sh: Likewise. * emultempl/aix.em: Test COMPILE_IN value is "yes". * emultempl/armcoff.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/generic.em: Likewise. * emultempl/gld960.em: Likewise. * emultempl/gld960c.em: Likewise. * emultempl/linux.em: Likewise. * emultempl/lnk960.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/sunos.em: Likewise. * emultempl/ticoff.em: Likewise. --- ld/ChangeLog | 19 +++++++++++++++++++ ld/emulparams/nds32elf.sh | 5 ++--- ld/emulparams/nds32elf16m.sh | 5 ++--- ld/emulparams/nds32elf_linux.sh | 5 ++--- ld/emultempl/aix.em | 2 +- ld/emultempl/armcoff.em | 2 +- ld/emultempl/elf32.em | 2 +- ld/emultempl/generic.em | 2 +- ld/emultempl/gld960.em | 2 +- ld/emultempl/gld960c.em | 2 +- ld/emultempl/linux.em | 2 +- ld/emultempl/lnk960.em | 2 +- ld/emultempl/m68kcoff.em | 2 +- ld/emultempl/sunos.em | 2 +- ld/emultempl/ticoff.em | 2 +- ld/genscripts.sh | 4 ++-- 16 files changed, 38 insertions(+), 22 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 08c9b384b5b..ee26f648890 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,22 @@ +2014-01-17 Alan Modra + + * genscripts.sh (COMPILE_IN): Don't set if already set. + * emulparams/nds32elf.sh: Don't clear EMULATION_LIBPATH, set + COMPILE_IN=no. + * emulparams/nds32elf16m.sh: Likewise. + * emulparams/nds32elf_linux.sh: Likewise. + * emultempl/aix.em: Test COMPILE_IN value is "yes". + * emultempl/armcoff.em: Likewise. + * emultempl/elf32.em: Likewise. + * emultempl/generic.em: Likewise. + * emultempl/gld960.em: Likewise. + * emultempl/gld960c.em: Likewise. + * emultempl/linux.em: Likewise. + * emultempl/lnk960.em: Likewise. + * emultempl/m68kcoff.em: Likewise. + * emultempl/sunos.em: Likewise. + * emultempl/ticoff.em: Likewise. + 2014-01-16 H.J. Lu PR ld/16456 diff --git a/ld/emulparams/nds32elf.sh b/ld/emulparams/nds32elf.sh index c12048d7a54..f0a7c313294 100644 --- a/ld/emulparams/nds32elf.sh +++ b/ld/emulparams/nds32elf.sh @@ -14,6 +14,5 @@ MAXPAGESIZE=0x20 EMBEDDED=yes COMMONPAGESIZE=0x20 -# Instruct genscripts.sh not to compile scripts in by COMPILE_IN -# in order to use external linker scripts files. -EMULATION_LIBPATH= +# Use external linker script files. +COMPILE_IN=no diff --git a/ld/emulparams/nds32elf16m.sh b/ld/emulparams/nds32elf16m.sh index 7d3b063abdb..deb8699004a 100644 --- a/ld/emulparams/nds32elf16m.sh +++ b/ld/emulparams/nds32elf16m.sh @@ -14,6 +14,5 @@ MAXPAGESIZE=0x20 EMBEDDED=yes COMMONPAGESIZE=0x20 -# Instruct genscripts.sh not to compile scripts in by COMPILE_IN -# in order to use external linker scripts files. -EMULATION_LIBPATH= +# Use external linker script files. +COMPILE_IN=no diff --git a/ld/emulparams/nds32elf_linux.sh b/ld/emulparams/nds32elf_linux.sh index 6d89f7924f9..1145c0eeea8 100644 --- a/ld/emulparams/nds32elf_linux.sh +++ b/ld/emulparams/nds32elf_linux.sh @@ -31,6 +31,5 @@ fi GENERATE_SHLIB_SCRIPT=yes GENERATE_PIE_SCRIPT=yes -# Instruct genscripts.sh not to compile scripts in by COMPILE_IN -# in order to use external linker scripts files. -EMULATION_LIBPATH= +# Use external linker script files. +COMPILE_IN=no diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em index aa72ce64c4f..084bb664450 100644 --- a/ld/emultempl/aix.em +++ b/ld/emultempl/aix.em @@ -1399,7 +1399,7 @@ static char * gld${EMULATION_NAME}_get_script (int *isfile) EOF -if test -n "$COMPILE_IN" +if test x"$COMPILE_IN" = xyes then # Scripts compiled in. diff --git a/ld/emultempl/armcoff.em b/ld/emultempl/armcoff.em index 20bff145c5e..7c903781262 100644 --- a/ld/emultempl/armcoff.em +++ b/ld/emultempl/armcoff.em @@ -205,7 +205,7 @@ static char * gld${EMULATION_NAME}_get_script (int *isfile) EOF -if test -n "$COMPILE_IN" +if test x"$COMPILE_IN" = xyes then # Scripts compiled in. diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 569c7f7a816..a4f04f15c1b 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -2017,7 +2017,7 @@ static char * gld${EMULATION_NAME}_get_script (int *isfile) EOF -if test -n "$COMPILE_IN" +if test x"$COMPILE_IN" = xyes then # Scripts compiled in. diff --git a/ld/emultempl/generic.em b/ld/emultempl/generic.em index dce2bffd1e8..53754f0f3f8 100644 --- a/ld/emultempl/generic.em +++ b/ld/emultempl/generic.em @@ -81,7 +81,7 @@ static char * gld${EMULATION_NAME}_get_script (int *isfile) EOF -if test -n "$COMPILE_IN" +if test x"$COMPILE_IN" = xyes then # Scripts compiled in. diff --git a/ld/emultempl/gld960.em b/ld/emultempl/gld960.em index 4ba3eeca3f6..7e8552f7953 100644 --- a/ld/emultempl/gld960.em +++ b/ld/emultempl/gld960.em @@ -74,7 +74,7 @@ static char * gld960_get_script (int *isfile) EOF -if test -n "$COMPILE_IN" +if test x"$COMPILE_IN" = xyes then # Scripts compiled in. diff --git a/ld/emultempl/gld960c.em b/ld/emultempl/gld960c.em index 1999ea89a85..39fe1f24c10 100644 --- a/ld/emultempl/gld960c.em +++ b/ld/emultempl/gld960c.em @@ -87,7 +87,7 @@ static char * gld960_get_script (int *isfile) EOF -if test -n "$COMPILE_IN" +if test x"$COMPILE_IN" = xyes then # Scripts compiled in. diff --git a/ld/emultempl/linux.em b/ld/emultempl/linux.em index 61c7df4e8be..5cf5bfa7953 100644 --- a/ld/emultempl/linux.em +++ b/ld/emultempl/linux.em @@ -131,7 +131,7 @@ static char * gld${EMULATION_NAME}_get_script (int *isfile) EOF -if test -n "$COMPILE_IN" +if test x"$COMPILE_IN" = xyes then # Scripts compiled in. diff --git a/ld/emultempl/lnk960.em b/ld/emultempl/lnk960.em index e556d432352..1951c36c4f9 100644 --- a/ld/emultempl/lnk960.em +++ b/ld/emultempl/lnk960.em @@ -268,7 +268,7 @@ static char * lnk960_get_script (int *isfile) EOF -if test -n "$COMPILE_IN" +if test x"$COMPILE_IN" = xyes then # Scripts compiled in. diff --git a/ld/emultempl/m68kcoff.em b/ld/emultempl/m68kcoff.em index f68866cf134..f34490d3a05 100644 --- a/ld/emultempl/m68kcoff.em +++ b/ld/emultempl/m68kcoff.em @@ -165,7 +165,7 @@ static char * gld${EMULATION_NAME}_get_script (int *isfile) EOF -if test -n "$COMPILE_IN" +if test x"$COMPILE_IN" = xyes then # Scripts compiled in. diff --git a/ld/emultempl/sunos.em b/ld/emultempl/sunos.em index af11027a73a..14bf5afc72a 100644 --- a/ld/emultempl/sunos.em +++ b/ld/emultempl/sunos.em @@ -960,7 +960,7 @@ static char * gld${EMULATION_NAME}_get_script (int *isfile) EOF -if test -n "$COMPILE_IN" +if test x"$COMPILE_IN" = xyes then # Scripts compiled in. diff --git a/ld/emultempl/ticoff.em b/ld/emultempl/ticoff.em index dff1d7014f5..3b952a4a12b 100644 --- a/ld/emultempl/ticoff.em +++ b/ld/emultempl/ticoff.em @@ -106,7 +106,7 @@ gld_${EMULATION_NAME}_before_parse(void) static char * gld_${EMULATION_NAME}_get_script (int *isfile) EOF -if test -n "$COMPILE_IN" +if test x"$COMPILE_IN" = xyes then # Scripts compiled in. diff --git a/ld/genscripts.sh b/ld/genscripts.sh index eeb6d73b31e..d240f99de31 100755 --- a/ld/genscripts.sh +++ b/ld/genscripts.sh @@ -413,8 +413,8 @@ if test -n "$GENERATE_AUTO_IMPORT_SCRIPT"; then ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xa fi -case " $EMULATION_LIBPATH " in - *" ${EMULATION_NAME} "*) COMPILE_IN=true;; +case "$COMPILE_IN: $EMULATION_LIBPATH " in + :*" ${EMULATION_NAME} "*) COMPILE_IN=yes;; esac # PR ld/5652: -- 2.30.2