OSDN Git Service

* pa64-hpux.h (LIB_SPEC): Link against librt when building static
[pf3gnuchains/gcc-fork.git] / gcc / config / pa / pa-hpux11.h
index 994e432..8d4a807 100644 (file)
@@ -1,12 +1,12 @@
 /* Definitions of target machine for GNU compiler, for HP PA-RISC
-   Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004
+   Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2007
    Free Software Foundation, Inc.
 
 This file is part of GCC.
 
 GCC is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
 any later version.
 
 GCC is distributed in the hope that it will be useful,
@@ -15,9 +15,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING.  If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
 
 /* GCC always defines __STDC__.  HP C++ compilers don't define it.  This
    causes trouble when sys/stdsyms.h is included.  As a work around,
@@ -66,7 +65,7 @@ Boston, MA 02111-1307, USA.  */
          }                                                             \
        if (!TARGET_64BIT)                                              \
          builtin_define ("_ILP32");                                    \
-       if (flag_pa_unix >= 1995)                                       \
+       if (flag_pa_unix >= 1995 && !flag_iso)                          \
          {                                                             \
            builtin_define ("_XOPEN_UNIX");                             \
            builtin_define ("_XOPEN_SOURCE_EXTENDED");                  \
@@ -75,11 +74,14 @@ Boston, MA 02111-1307, USA.  */
          {                                                             \
            if (flag_pa_unix >= 1998)                                   \
              {                                                         \
-               builtin_define ("_INCLUDE__STDC_A1_SOURCE");            \
-               builtin_define ("_INCLUDE_XOPEN_SOURCE_500");           \
+               if (flag_isoc94 || flag_isoc99 || c_dialect_cxx()       \
+                   || !flag_iso)                                       \
+                 builtin_define ("_INCLUDE__STDC_A1_SOURCE");          \
+               if (!flag_iso)                                          \
+                 builtin_define ("_INCLUDE_XOPEN_SOURCE_500");         \
              }                                                         \
            else if (flag_isoc94 || flag_isoc99 || c_dialect_cxx ())    \
-             warning ("-munix=98 option required for C89 "             \
+             warning (0, "-munix=98 option required for C89 "          \
                       "Amendment 1 features.\n");                      \
          }                                                             \
        if (TARGET_SIO)                                                 \
@@ -103,18 +105,6 @@ Boston, MA 02111-1307, USA.  */
 /* We can debug dynamically linked executables on hpux11; we also
    want dereferencing of a NULL pointer to cause a SEGV.  */
 #undef LINK_SPEC
-#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11)
-#define LINK_SPEC \
-  "%{!mpa-risc-1-0:%{!march=1.0:%{!shared:-L/lib/pa1.1 -L/usr/lib/pa1.1 }}}\
-   %{!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:\
-     %nWarning: consider linking with `-static' as system libraries with\n\
-     %n  profiling support are only provided in archive format}}}\
-   -z %{mlinker-opt:-O} %{!shared:-u main -u __gcc_plt_call}\
-   %{static:-a archive} %{shared:-b}"
-#else
 #define LINK_SPEC \
   "%{!shared:%{p:-L/lib/libp -L/usr/lib/libp %{!static:\
      %nWarning: consider linking with `-static' as system libraries with\n\
@@ -124,14 +114,18 @@ Boston, MA 02111-1307, USA.  */
      %n  profiling support are only provided in archive format}}}\
    -z %{mlinker-opt:-O} %{!shared:-u main -u __gcc_plt_call}\
    %{static:-a archive} %{shared:-b}"
-#endif
 
-/* hpux 11 has posix threads.  */
+/* HP-UX 11 has posix threads.  HP libc contains pthread stubs so that
+   non-threaded applications can be linked with a thread-safe libc
+   without a subsequent loss of performance.  For more details, see
+   <http://docs.hp.com/en/1896/pthreads.html>.  */
 #undef LIB_SPEC
 #define LIB_SPEC \
   "%{!shared:\
-     %{mt|pthread:-lpthread} -lc \
-     %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}"
+     %{static|mt|pthread:%{fopenmp:%{static:-a archive_shared} -lrt\
+       %{static:-a archive}} -lpthread} -lc\
+     %{static:%{!nolibdld:-a archive_shared -ldld -a archive -lc}}}\
+   %{shared:%{mt|pthread:-lpthread}}"
 
 #undef STARTFILE_SPEC
 #define STARTFILE_SPEC \
@@ -141,7 +135,7 @@ Boston, MA 02111-1307, USA.  */
 /* Under hpux11, the normal location of the `ld' and `as' programs is the
    /usr/ccs/bin directory.  */
 
-#ifndef CROSS_COMPILE
+#ifndef CROSS_DIRECTORY_STRUCTURE
 #undef MD_EXEC_PREFIX
 #define MD_EXEC_PREFIX "/usr/ccs/bin/"
 #endif
@@ -150,7 +144,7 @@ Boston, MA 02111-1307, USA.  */
    the /usr/ccs/lib directory.  However, the profiling files are in
    /opt/langtools/lib.  */
 
-#ifndef CROSS_COMPILE
+#ifndef CROSS_DIRECTORY_STRUCTURE
 #undef MD_STARTFILE_PREFIX
 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
 #define MD_STARTFILE_PREFIX_1 "/opt/langtools/lib/"
@@ -185,3 +179,6 @@ Boston, MA 02111-1307, USA.  */
    with secondary definition (weak) symbols.  */
 #undef TARGET_SOM_SDEF
 #define TARGET_SOM_SDEF 1
+
+#undef TARGET_HPUX_11
+#define TARGET_HPUX_11 1