From 7af7a81a60786a061b021097f55ca1d585bee801 Mon Sep 17 00:00:00 2001 From: Simon South Date: Wed, 04 Nov 2015 04:07:34 -0500 Subject: [PATCH] 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 --- gcc/gcc/config/arm/haiku.h | 6 +++--- gcc/gcc/config/i386/haiku.h | 6 +++--- gcc/gcc/config/i386/haiku64.h | 6 +++--- gcc/gcc/config/m68k/haiku.h | 6 +++--- gcc/gcc/config/mips/haiku.h | 5 +++-- gcc/gcc/config/rs6000/haiku.h | 6 +++--- legacy/gcc/gcc/config/i386/haiku.h | 6 +++--- 7 files changed, 21 insertions(+), 20 deletions(-) diff --git a/gcc/gcc/config/arm/haiku.h b/gcc/gcc/config/arm/haiku.h index b15fdc1..dedc53b 100644 --- a/gcc/gcc/config/arm/haiku.h +++ a/gcc/gcc/config/arm/haiku.h @@ -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" diff --git a/gcc/gcc/config/i386/haiku.h b/gcc/gcc/config/i386/haiku.h index 5320329..39e55ce 100644 --- a/gcc/gcc/config/i386/haiku.h +++ a/gcc/gcc/config/i386/haiku.h @@ -55,9 +55,9 @@ #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 diff --git a/gcc/gcc/config/i386/haiku64.h b/gcc/gcc/config/i386/haiku64.h index 1a63749..82a0420 100644 --- a/gcc/gcc/config/i386/haiku64.h +++ a/gcc/gcc/config/i386/haiku64.h @@ -66,9 +66,9 @@ #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 diff --git a/gcc/gcc/config/m68k/haiku.h b/gcc/gcc/config/m68k/haiku.h index 94e8dff..a1f7750 100644 --- a/gcc/gcc/config/m68k/haiku.h +++ a/gcc/gcc/config/m68k/haiku.h @@ -110,9 +110,9 @@ /*#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... */ diff --git a/gcc/gcc/config/mips/haiku.h b/gcc/gcc/config/mips/haiku.h index 3bfa10a..2393af6 100644 --- a/gcc/gcc/config/mips/haiku.h +++ a/gcc/gcc/config/mips/haiku.h @@ -42,6 +42,7 @@ #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}" diff --git a/gcc/gcc/config/rs6000/haiku.h b/gcc/gcc/config/rs6000/haiku.h index c76214c..4a6be20 100644 --- a/gcc/gcc/config/rs6000/haiku.h +++ a/gcc/gcc/config/rs6000/haiku.h @@ -55,6 +55,6 @@ #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}" diff --git a/legacy/gcc/gcc/config/i386/haiku.h b/legacy/gcc/gcc/config/i386/haiku.h index 7c66036..3403732 100644 --- a/legacy/gcc/gcc/config/i386/haiku.h +++ a/legacy/gcc/gcc/config/i386/haiku.h @@ -187,9 +187,9 @@ #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. */ -- gitore 0.2.1