OSDN Git Service

* pa64-hpux.h (LIB_SPEC): Link against librt when building static
[pf3gnuchains/gcc-fork.git] / gcc / config / pa / pa64-hpux.h
index 167feae..bad5b41 100644 (file)
@@ -57,25 +57,37 @@ along with GCC; see the file COPYING3.  If not see
 #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_GNU_LD)
 #define LIB_SPEC \
   "%{!shared:\
-     %{!p:%{!pg: %{static|mt|pthread:-lpthread} -lc\
+     %{!p:%{!pg:%{static|mt|pthread:%{fopenmp:%{static:-a shared} -lrt\
+                 %{static:-a archive}} -lpthread} -lc\
            %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
      %{p:%{!pg:%{static:%{!mhp-ld:-a shared}%{mhp-ld:-a archive_shared}}\
-          -lprof %{static:-a archive} %{static|mt|pthread:-lpthread} -lc\
+          -lprof %{static:-a archive}\
+          %{static|mt|pthread:%{fopenmp:%{static:-a shared} -lrt\
+            %{static:-a archive}} -lpthread} -lc\
           %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
      %{pg:%{static:%{!mhp-ld:-a shared}%{mhp-ld:-a archive_shared}}\
-       -lgprof %{static:-a archive} %{static|mt|pthread:-lpthread} -lc\
-       %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}"
+       -lgprof %{static:-a archive}\
+       %{static|mt|pthread:%{fopenmp:%{static:-a shared} -lrt\
+        %{static:-a archive}} -lpthread} -lc\
+       %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
+   %{shared:%{mt|pthread:-lpthread}}"
 #else
 #define LIB_SPEC \
   "%{!shared:\
-     %{!p:%{!pg: %{static|mt|pthread:-lpthread} -lc\
+     %{!p:%{!pg:%{static|mt|pthread:%{fopenmp:%{static:-a shared} -lrt\
+                 %{static:-a archive}} -lpthread} -lc\
            %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
      %{p:%{!pg:%{static:%{mgnu-ld:-a shared}%{!mgnu-ld:-a archive_shared}}\
-          -lprof %{static:-a archive} %{static|mt|pthread:-lpthread} -lc\
+          -lprof %{static:-a archive}\
+          %{static|mt|pthread:%{fopenmp:%{static:-a shared} -lrt\
+            %{static:-a archive}} -lpthread} -lc\
           %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
      %{pg:%{static:%{mgnu-ld:-a shared}%{!mgnu-ld:-a archive_shared}}\
-       -lgprof %{static:-a archive} %{static|mt|pthread:-lpthread} -lc\
-       %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}"
+       -lgprof %{static:-a archive}\
+       %{static|mt|pthread:%{fopenmp:%{static:-a shared} -lrt\
+        %{static:-a archive}} -lpthread} -lc\
+       %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
+   %{shared:%{mt|pthread:-lpthread}}"
 #endif
 
 /* The libgcc_stub.a and milli.a libraries need to come last.  */