From 99a54d34793d3e3752d1bfd3b9a1fb21b996cc7e Mon Sep 17 00:00:00 2001 From: mrg Date: Sun, 12 Aug 2012 00:01:50 +0000 Subject: [PATCH] pay attention to -pie: link crt{begin,end}S.o. this fixes -fpie on sparc and sparc64, and probably others. --- external/gpl3/gcc/dist/gcc/config/netbsd-elf.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/external/gpl3/gcc/dist/gcc/config/netbsd-elf.h b/external/gpl3/gcc/dist/gcc/config/netbsd-elf.h index 1e0c69f1b4a5..f6f30c811069 100644 --- a/external/gpl3/gcc/dist/gcc/config/netbsd-elf.h +++ b/external/gpl3/gcc/dist/gcc/config/netbsd-elf.h @@ -52,8 +52,11 @@ along with GCC; see the file COPYING3. If not see %{!p:crt0%O%s}}} \ %:if-exists(crti%O%s) \ %{static:%:if-exists-else(crtbeginT%O%s crtbegin%O%s)} \ - %{!static: \ - %{!shared:crtbegin%O%s} %{shared:crtbeginS%O%s}}" + %{!static: \ + %{!shared: \ + %{!pie:crtbegin%O%s} \ + %{pie:crtbeginS%O%s}} \ + %{shared:crtbeginS%O%s}}" #undef STARTFILE_SPEC #define STARTFILE_SPEC NETBSD_STARTFILE_SPEC @@ -64,7 +67,10 @@ along with GCC; see the file COPYING3. If not see C++ file-scope static objects deconstructed after exiting "main". */ #define NETBSD_ENDFILE_SPEC \ - "%{!shared:crtend%O%s} %{shared:crtendS%O%s} \ + "%{!shared: \ + %{!pie:crtend%O%s} \ + %{pie:crtendS%O%s}} \ + %{shared:crtendS%O%s} \ %:if-exists(crtn%O%s)" #undef ENDFILE_SPEC