gcc2, gcc4: Correct LINK_SPEC

Correct LINK_SPEC so it

* Sets appropriate dynamic-link options for any type of dynamically
  linked executable, not only position-independent ones.
* Does not omit these options if "-pie" is specified by the user.
* Recognizes the "-static" option.
* Includes a hyphen previously missing from "--no-undefined".

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
This commit is contained in:
Simon South 2015-11-04 04:07:34 -05:00 committed by Jérôme Duval
parent f2b5a31fc1
commit 7af7a81a60
7 changed files with 21 additions and 20 deletions

View File

@ -77,8 +77,8 @@
#undef LINK_SPEC
#define LINK_SPEC \
"%{!o*:-o %b} -m armelf \
%{shared|r|pie|fno-pic|fno-PIC|fno-pie|fno-PIE:; \
:-pie --allow-shlib-undefined --export-dynamic} %{shared:-shared} \
%{nostart|shared:-e 0;:-no-undefined} %{mbig-endian:-EB} \
%{shared:-shared;!r:%{fno-pic|fno-PIC|fno-pie|fno-PIE:;:%{!pie:-pie}} \
%{!static:--export-dynamic --allow-shlib-undefined}} %{static:-static} \
%{nostart|shared:-e 0;:--no-undefined} %{mbig-endian:-EB} \
%{mlittle-endian:-EL} -X"

View File

@ -55,9 +55,9 @@ Boston, MA 02111-1307, USA. */
#undef LINK_SPEC
#define LINK_SPEC \
"-m elf_i386_haiku \
%{shared|r|pie|fno-pic|fno-PIC|fno-pie|fno-PIE:; \
:-pie --allow-shlib-undefined --export-dynamic} %{shared:-shared} \
%{nostart|shared:-e 0;:-no-undefined}"
%{shared:-shared;!r:%{fno-pic|fno-PIC|fno-pie|fno-PIE:;:%{!pie:-pie}} \
%{!static:--export-dynamic --allow-shlib-undefined}} %{static:-static} \
%{nostart|shared:-e 0;:--no-undefined}"
/* A C statement (sans semicolon) to output to the stdio stream
FILE the assembler definition of uninitialized global DECL named

View File

@ -66,9 +66,9 @@ Boston, MA 02111-1307, USA. */
#undef LINK_SPEC
#define LINK_SPEC \
"%{" SPEC_64 ":-m elf_x86_64_haiku} %{" SPEC_32 ":-m elf_i386_haiku} \
%{shared|r|pie|fno-pic|fno-PIC|fno-pie|fno-PIE:; \
:-pie --allow-shlib-undefined --export-dynamic} %{shared:-shared} \
%{nostart|shared:-e 0;:-no-undefined}"
%{shared:-shared;!r:%{fno-pic|fno-PIC|fno-pie|fno-PIE:;:%{!pie:-pie}} \
%{!static:--export-dynamic --allow-shlib-undefined}} %{static:-static} \
%{nostart|shared:-e 0;:--no-undefined}"
/* A C statement (sans semicolon) to output to the stdio stream
FILE the assembler definition of uninitialized global DECL named

View File

@ -110,9 +110,9 @@ Boston, MA 02110-1301, USA. */
/*#define LINK_SPEC "%{!o*:-o %b} -m elf_m68k_haiku -shared -no-undefined %{nostart:-e 0}"*/
#define LINK_SPEC \
"%{!o*:-o %b} -m m68kelf \
%{shared|r|pie|fno-pic|fno-PIC|fno-pie|fno-PIE:; \
:-pie --allow-shlib-undefined --export-dynamic} -no-undefined \
%{nostart:-e 0}"
%{shared:-shared;!r:%{fno-pic|fno-PIC|fno-pie|fno-PIE:;:%{!pie:-pie}} \
%{!static:--export-dynamic --allow-shlib-undefined}} %{static:-static} \
--no-undefined %{nostart:-e 0}"
/* XXX: not sure for the rest there... */

View File

@ -42,6 +42,7 @@ Boston, MA 02111-1307, USA. */
#undef LINK_SPEC
#define LINK_SPEC \
"%{!o*:-o %b} -m elf_mipsel_haiku \
%{shared|r|pie|fno-pic|fno-PIC|fno-pie|fno-PIE:; \
:-pie --allow-shlib-undefined --export-dynamic} %{nostart:-e 0}"
%{shared:-shared;!r:%{fno-pic|fno-PIC|fno-pie|fno-PIE:;:%{!pie:-pie}} \
%{!static:--export-dynamic --allow-shlib-undefined}} %{static:-static} \
%{nostart:-e 0}"

View File

@ -55,6 +55,6 @@ Boston, MA 02111-1307, USA. */
#undef LINK_SPEC
#define LINK_SPEC \
"%{!o*:-o %b} -m elf32ppchaiku \
%{shared|r|pie|fno-pic|fno-PIC|fno-pie|fno-PIE:; \
:-pie --allow-shlib-undefined --export-dynamic} %{shared:-shared} \
%{nostart|shared:-e 0;:-no-undefined}"
%{shared:-shared;!r:%{fno-pic|fno-PIC|fno-pie|fno-PIE:;:%{!pie:-pie}} \
%{!static:--export-dynamic --allow-shlib-undefined}} %{static:-static} \
%{nostart|shared:-e 0;:--no-undefined}"

View File

@ -187,9 +187,9 @@ Boston, MA 02111-1307, USA. */
#undef LINK_SPEC
#define LINK_SPEC \
"%{!o*:-o %b} -m elf_i386_haiku \
%{!shared:%{!r:%{!fno-pic:%{!fno-PIC:-pie --export-dynamic}} \
%{!static:--no-add-needed --allow-shlib-undefined}}} \
%{shared:-shared -Bsymbolic} %{nostart|shared:-e 0} \
%{!shared:%{!r:%{!fno-pic:%{!fno-PIC:-pie}} \
%{!static:--no-add-needed --export-dynamic --allow-shlib-undefined}}} \
%{shared:-shared -Bsymbolic} %{static:-static} %{nostart|shared:-e 0} \
%{!nostart:%{!shared:--no-undefined}}"
/* Provide start and end file specs appropriate to glibc. */