Ticket #12445: 0001-gcc2-gcc4-Correct-LINK_SPEC.patch

File 0001-gcc2-gcc4-Correct-LINK_SPEC.patch, 5.9 KB (added by simonsouth, 8 years ago)

gcc2, gcc4: Correct LINK_SPEC

  • gcc/gcc/config/arm/haiku.h

    From 1e9ee2cf3858c2e99e863fc0d130034227f0a6ca Mon Sep 17 00:00:00 2001
    From: Simon South <ssouth@simonsouth.com>
    Date: Wed, 4 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".
    ---
     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 b  
    7777#undef  LINK_SPEC
    7878#define LINK_SPEC \
    7979  "%{!o*:-o %b} -m armelf \
    80    %{shared|r|pie|fno-pic|fno-PIC|fno-pie|fno-PIE:; \
    81    :-pie --allow-shlib-undefined --export-dynamic} %{shared:-shared} \
    82    %{nostart|shared:-e 0;:-no-undefined} %{mbig-endian:-EB} \
     80   %{shared:-shared;!r:%{fno-pic|fno-PIC|fno-pie|fno-PIE:;:%{!pie:-pie}} \
     81   %{!static:--export-dynamic --allow-shlib-undefined}} %{static:-static} \
     82   %{nostart|shared:-e 0;:--no-undefined} %{mbig-endian:-EB} \
    8383   %{mlittle-endian:-EL} -X"
    8484
  • gcc/gcc/config/i386/haiku.h

    diff --git a/gcc/gcc/config/i386/haiku.h b/gcc/gcc/config/i386/haiku.h
    index 5320329..39e55ce 100644
    a b Boston, MA 02111-1307, USA. */  
    5555#undef  LINK_SPEC
    5656#define LINK_SPEC \
    5757  "-m elf_i386_haiku \
    58    %{shared|r|pie|fno-pic|fno-PIC|fno-pie|fno-PIE:; \
    59    :-pie --allow-shlib-undefined --export-dynamic} %{shared:-shared} \
    60    %{nostart|shared:-e 0;:-no-undefined}"
     58   %{shared:-shared;!r:%{fno-pic|fno-PIC|fno-pie|fno-PIE:;:%{!pie:-pie}} \
     59   %{!static:--export-dynamic --allow-shlib-undefined}} %{static:-static} \
     60   %{nostart|shared:-e 0;:--no-undefined}"
    6161
    6262/* A C statement (sans semicolon) to output to the stdio stream
    6363   FILE the assembler definition of uninitialized global DECL named
  • gcc/gcc/config/i386/haiku64.h

    diff --git a/gcc/gcc/config/i386/haiku64.h b/gcc/gcc/config/i386/haiku64.h
    index 1a63749..82a0420 100644
    a b Boston, MA 02111-1307, USA. */  
    6666#undef  LINK_SPEC
    6767#define LINK_SPEC \
    6868  "%{" SPEC_64 ":-m elf_x86_64_haiku} %{" SPEC_32 ":-m elf_i386_haiku} \
    69    %{shared|r|pie|fno-pic|fno-PIC|fno-pie|fno-PIE:; \
    70    :-pie --allow-shlib-undefined --export-dynamic} %{shared:-shared} \
    71    %{nostart|shared:-e 0;:-no-undefined}"
     69   %{shared:-shared;!r:%{fno-pic|fno-PIC|fno-pie|fno-PIE:;:%{!pie:-pie}} \
     70   %{!static:--export-dynamic --allow-shlib-undefined}} %{static:-static} \
     71   %{nostart|shared:-e 0;:--no-undefined}"
    7272
    7373/* A C statement (sans semicolon) to output to the stdio stream
    7474   FILE the assembler definition of uninitialized global DECL named
  • gcc/gcc/config/m68k/haiku.h

    diff --git a/gcc/gcc/config/m68k/haiku.h b/gcc/gcc/config/m68k/haiku.h
    index 94e8dff..a1f7750 100644
    a b Boston, MA 02110-1301, USA. */  
    110110/*#define LINK_SPEC "%{!o*:-o %b} -m elf_m68k_haiku -shared -no-undefined %{nostart:-e 0}"*/
    111111#define LINK_SPEC \
    112112  "%{!o*:-o %b} -m m68kelf \
    113    %{shared|r|pie|fno-pic|fno-PIC|fno-pie|fno-PIE:; \
    114    :-pie --allow-shlib-undefined --export-dynamic} -no-undefined \
    115    %{nostart:-e 0}"
     113   %{shared:-shared;!r:%{fno-pic|fno-PIC|fno-pie|fno-PIE:;:%{!pie:-pie}} \
     114   %{!static:--export-dynamic --allow-shlib-undefined}} %{static:-static} \
     115   --no-undefined %{nostart:-e 0}"
    116116
    117117/* XXX: not sure for the rest there... */
    118118
  • gcc/gcc/config/mips/haiku.h

    diff --git a/gcc/gcc/config/mips/haiku.h b/gcc/gcc/config/mips/haiku.h
    index 3bfa10a..2393af6 100644
    a b Boston, MA 02111-1307, USA. */  
    4242#undef  LINK_SPEC
    4343#define LINK_SPEC \
    4444  "%{!o*:-o %b} -m elf_mipsel_haiku \
    45    %{shared|r|pie|fno-pic|fno-PIC|fno-pie|fno-PIE:; \
    46    :-pie --allow-shlib-undefined --export-dynamic} %{nostart:-e 0}"
     45   %{shared:-shared;!r:%{fno-pic|fno-PIC|fno-pie|fno-PIE:;:%{!pie:-pie}} \
     46   %{!static:--export-dynamic --allow-shlib-undefined}} %{static:-static} \
     47   %{nostart:-e 0}"
    4748
  • gcc/gcc/config/rs6000/haiku.h

    diff --git a/gcc/gcc/config/rs6000/haiku.h b/gcc/gcc/config/rs6000/haiku.h
    index c76214c..4a6be20 100644
    a b Boston, MA 02111-1307, USA. */  
    5555#undef  LINK_SPEC
    5656#define LINK_SPEC \
    5757  "%{!o*:-o %b} -m elf32ppchaiku \
    58    %{shared|r|pie|fno-pic|fno-PIC|fno-pie|fno-PIE:; \
    59    :-pie --allow-shlib-undefined --export-dynamic} %{shared:-shared} \
    60    %{nostart|shared:-e 0;:-no-undefined}"
     58   %{shared:-shared;!r:%{fno-pic|fno-PIC|fno-pie|fno-PIE:;:%{!pie:-pie}} \
     59   %{!static:--export-dynamic --allow-shlib-undefined}} %{static:-static} \
     60   %{nostart|shared:-e 0;:--no-undefined}"
  • legacy/gcc/gcc/config/i386/haiku.h

    diff --git a/legacy/gcc/gcc/config/i386/haiku.h b/legacy/gcc/gcc/config/i386/haiku.h
    index 7c66036..3403732 100644
    a b Boston, MA 02111-1307, USA. */  
    187187#undef  LINK_SPEC
    188188#define LINK_SPEC \
    189189  "%{!o*:-o %b} -m elf_i386_haiku \
    190    %{!shared:%{!r:%{!fno-pic:%{!fno-PIC:-pie --export-dynamic}} \
    191    %{!static:--no-add-needed --allow-shlib-undefined}}} \
    192    %{shared:-shared -Bsymbolic} %{nostart|shared:-e 0} \
     190   %{!shared:%{!r:%{!fno-pic:%{!fno-PIC:-pie}} \
     191   %{!static:--no-add-needed --export-dynamic --allow-shlib-undefined}}} \
     192   %{shared:-shared -Bsymbolic} %{static:-static} %{nostart|shared:-e 0} \
    193193   %{!nostart:%{!shared:--no-undefined}}"
    194194
    195195/* Provide start and end file specs appropriate to glibc.  */