gcc/
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Jun 2009 19:15:26 +0000 (19:15 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Jun 2009 19:15:26 +0000 (19:15 +0000)
* config/pa/pa-hpux.h (LINK_SPEC): Remove "%<fwhole-program".
* config/pa/pa-hpux10.h (LINK_SPEC): Likewise.
* config/pa/pa-hpux11.h (LINK_SPEC): Likewise.
* gcc.c (set_collect_gcc_options): Don't add -fwhole-program
to COLLECT_GCC_OPTIONS.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148099 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/pa/pa-hpux.h
gcc/config/pa/pa-hpux10.h
gcc/config/pa/pa-hpux11.h
gcc/gcc.c

index 9c05763..825c7b6 100644 (file)
@@ -1,5 +1,13 @@
 2009-06-02  Richard Sandiford  <r.sandiford@uk.ibm.com>
 
+       * config/pa/pa-hpux.h (LINK_SPEC): Remove "%<fwhole-program".
+       * config/pa/pa-hpux10.h (LINK_SPEC): Likewise.
+       * config/pa/pa-hpux11.h (LINK_SPEC): Likewise.
+       * gcc.c (set_collect_gcc_options): Don't add -fwhole-program
+       to COLLECT_GCC_OPTIONS.
+
+2009-06-02  Richard Sandiford  <r.sandiford@uk.ibm.com>
+
        * collect2.c (target_system_root): New variable.
        (main): Handle --sysroot=.
        (ignore_library): Strip the sysroot from the library path.
index bd12d4f..b600b0e 100644 (file)
@@ -95,12 +95,10 @@ along with GCC; see the file COPYING3.  If not see
 #undef LINK_SPEC
 #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11)
 #define LINK_SPEC \
-  "%<fwhole-program\
-   %{!mpa-risc-1-0:%{!march=1.0:%{static:-L/lib/pa1.1 -L/usr/lib/pa1.1 }}}%{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{g*:-a archive} %{shared:-b}"
+  "%{!mpa-risc-1-0:%{!march=1.0:%{static:-L/lib/pa1.1 -L/usr/lib/pa1.1 }}}%{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{g*:-a archive} %{shared:-b}"
 #else
 #define LINK_SPEC \
-  "%<fwhole-program\
-   %{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{g*:-a archive} %{shared:-b}"
+  "%{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{g*:-a archive} %{shared:-b}"
 #endif
 
 /* hpux8 and later have C++ compatible include files, so do not
index c1294df..df36ea2 100644 (file)
@@ -82,8 +82,7 @@ along with GCC; see the file COPYING3.  If not see
 #undef LINK_SPEC
 #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11)
 #define LINK_SPEC \
-  "%<fwhole-program\
-   %{!mpa-risc-1-0:%{!march=1.0:%{static:-L/lib/pa1.1 -L/usr/lib/pa1.1 }}}\
+  "%{!mpa-risc-1-0:%{!march=1.0:%{static:-L/lib/pa1.1 -L/usr/lib/pa1.1 }}}\
    %{!shared:%{p:-L/lib/libp %{!static:\
      %nWarning: consider linking with `-static' as system libraries with\n\
      %n  profiling support are only provided in archive format}}}\
@@ -94,8 +93,7 @@ along with GCC; see the file COPYING3.  If not see
    %{static:-a archive} %{shared:-b}"
 #else
 #define LINK_SPEC \
-  "%<fwhole-program\
-   %{!shared:%{p:-L/lib/libp %{!static:\
+  "%{!shared:%{p:-L/lib/libp %{!static:\
      %nWarning: consider linking with `-static' as system libraries with\n\
      %n  profiling support are only provided in archive format}}}\
    %{!shared:%{pg:-L/lib/libp %{!static:\
index 06b709c..09b414c 100644 (file)
@@ -104,8 +104,7 @@ along with GCC; see the file COPYING3.  If not see
    want dereferencing of a NULL pointer to cause a SEGV.  */
 #undef LINK_SPEC
 #define LINK_SPEC \
-  "%<fwhole-program\
-   %{!shared:%{p:-L/lib/libp -L/usr/lib/libp %{!static:\
+  "%{!shared:%{p:-L/lib/libp -L/usr/lib/libp %{!static:\
      %nWarning: consider linking with `-static' as system libraries with\n\
      %n  profiling support are only provided in archive format}}}\
    %{!shared:%{pg:-L/lib/libp -L/usr/lib/libp %{!static:\
index 538be05..f0d986c 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -4434,6 +4434,11 @@ set_collect_gcc_options (void)
       if ((switches[i].live_cond & SWITCH_IGNORE) != 0)
        continue;
 
+      /* Don't use -fwhole-program when compiling the init and fini routines,
+        since we'd wrongly assume that the routines aren't needed.  */
+      if (strcmp (switches[i].part1, "fwhole-program") == 0)
+       continue;
+
       obstack_grow (&collect_obstack, "'-", 2);
       q = switches[i].part1;
       while ((p = strchr (q, '\'')))