This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Fix linking with -p and -pg for hppa64 hpux


The following fixes a problem linking with -p and -pg under hpux 11.00.
It only has shared versions of libprof and libgprof.  As a result, linking
with -static didn't work.  I've tweaked the LIB_SPEC to use the shared
version if the archive version isn't available when using the HP linker.
The GNU linker doesn't support "archive_shared", so I just used the
shared version.

Tested on hpux 11.00 and 11.11 with hppa64.  Installed to 3.4 and 3.5.
Will soon install to 3.3.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2004-02-28  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* pa64-hpux.h (LIB_SPEC): Fix linking under HP-UX 11.00 with -p and -pg.

Index: config/pa/pa64-hpux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa64-hpux.h,v
retrieving revision 1.31
diff -u -3 -p -r1.31 pa64-hpux.h
--- config/pa/pa64-hpux.h	10 Oct 2003 17:39:21 -0000	1.31
+++ config/pa/pa64-hpux.h	27 Feb 2004 21:44:25 -0000
@@ -57,14 +57,20 @@ Boston, MA 02111-1307, USA.  */
    %{static:-a archive} %{shared:%{mgnu-ld:-shared}%{!mgnu-ld:-b}}"
 #endif
 
-/* Like the default, except no -lg.  */
+/* Profiling support is only provided in libc.a.  However, libprof and
+   libgprof are only available in shared form on HP-UX 11.00.  We use
+   the shared form if we are using the GNU linker or an archive form
+   isn't available.  We also usually need to link with libdld and it's
+   only available in shared form.  */
 #undef LIB_SPEC
 #define LIB_SPEC \
   "%{!shared:\
      %{!p:%{!pg: -lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
-     %{p:%{!pg:-lprof -lc\
-       %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
-     %{pg:-lgprof -lc\
+     %{p:%{!pg:%{static:%{mgnu-ld:-a shared}%{!mgnu-ld:-a archive_shared}}\
+	   -lprof %{static:-a archive} -lc\
+	   %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
+     %{pg:%{static:%{mgnu-ld:-a shared}%{!mgnu-ld:-a archive_shared}}\
+       -lgprof %{static:-a archive} -lc\
        %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
    /usr/lib/pa20_64/milli.a"
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]