Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gcc/dist/gcc/config basic support for -static ...



details:   https://anonhg.NetBSD.org/src/rev/002dce130140
branches:  trunk
changeset: 348507:002dce130140
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri Oct 21 07:24:30 2016 +0000

description:
basic support for -static -pie:  use -dynamic-linker.
doesn't work for all ports (reloc startup issues.)

diffstat:

 external/gpl3/gcc/dist/gcc/config/netbsd-elf.h |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r 1eb5232622f4 -r 002dce130140 external/gpl3/gcc/dist/gcc/config/netbsd-elf.h
--- a/external/gpl3/gcc/dist/gcc/config/netbsd-elf.h    Fri Oct 21 06:04:16 2016 +0000
+++ b/external/gpl3/gcc/dist/gcc/config/netbsd-elf.h    Fri Oct 21 07:24:30 2016 +0000
@@ -73,6 +73,9 @@
 
    Target-specific code must provide the %(netbsd_entry_point) spec.  */
 
+#define NETBSD_LINK_LD_ELF_SO_SPEC \
+  "%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}"
+
 #define NETBSD_LINK_SPEC_ELF \
   "%{assert*} %{R*} %{rpath*} \
    %{shared:-shared} \
@@ -84,14 +87,16 @@
         %{!e*:-e %(netbsd_entry_point)}}} \
      %{!static: \
        %{rdynamic:-export-dynamic} \
-       -dynamic-linker /usr/libexec/ld.elf_so} \
-     %{static:-static}} \
+       %(netbsd_link_ld_elf_so)} \
+     %{static:-static \
+       %{pie: %(netbsd_link_ld_elf_so)}}} \
    %{!nostdlib:%{!nodefaultlibs:\
      %{%:sanitize(address): -lasan } \
      %{%:sanitize(undefined): -lubsan}}}"
 
 /* Provide the standard list of subtarget extra specs for NetBSD targets.  */
 #define NETBSD_SUBTARGET_EXTRA_SPECS \
+  { "netbsd_link_ld_elf_so",    NETBSD_LINK_LD_ELF_SO_SPEC }, \
   { "netbsd_cpp_spec",          NETBSD_CPP_SPEC }, \
   { "netbsd_link_spec",         NETBSD_LINK_SPEC_ELF }, \
   { "netbsd_entry_point",       NETBSD_ENTRY_POINT }, \



Home | Main Index | Thread Index | Old Index