config.gcc (hppa[12]*-*-hpux11*): Set extra_parts.
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Fri, 18 Feb 2011 21:19:52 +0000 (21:19 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Fri, 18 Feb 2011 21:19:52 +0000 (21:19 +0000)
* config.gcc (hppa[12]*-*-hpux11*): Set extra_parts.
* config/pa/stublib.c (pthread_default_stacksize_np, pthread_mutex_lock,
pthread_mutex_unlock, pthread_once): Reinstate pthread stubs.
* config/pa/t-pa-hpux11: Add rules to build pthread stubs.
* config/pa/t-pa64: Likewise.
* config/pa/pa-hpux11.h (LINK_GCC_C_SEQUENCE_SPEC): Define.

From-SVN: r170287

gcc/ChangeLog
gcc/config.gcc
gcc/config/pa/pa-hpux11.h
gcc/config/pa/stublib.c
gcc/config/pa/t-pa-hpux11
gcc/config/pa/t-pa64

index 48e86d2c4f9dcd43971320e33485e063f4e869f9..43d065c12a08ca2f327dc76b0a0d41171652ea59 100644 (file)
@@ -1,3 +1,12 @@
+2011-02-18  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       * config.gcc (hppa[12]*-*-hpux11*): Set extra_parts.
+       * config/pa/stublib.c (pthread_default_stacksize_np, pthread_mutex_lock,
+       pthread_mutex_unlock, pthread_once): Reinstate pthread stubs.
+       * config/pa/t-pa-hpux11: Add rules to build pthread stubs.
+       * config/pa/t-pa64: Likewise.
+       * config/pa/pa-hpux11.h (LINK_GCC_C_SEQUENCE_SPEC): Define.
+
 2011-02-18  Jakub Jelinek  <jakub@redhat.com>
 
        PR driver/47787
index 54b822eb4194d565021b27295093b12fc9c593ae..1d7c8d3bb8f19d254ca705240fcb57e31ea3ea37 100644 (file)
@@ -1165,6 +1165,7 @@ hppa[12]*-*-hpux11*)
        else
            tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
        fi
+       extra_parts="libgcc_stub.a"
        case x${enable_threads} in
        x | xyes | xposix )
                thread_file=posix
index b0fc868a104e40477dfbfd02fc659161150e1fb5..81dfdf3d1dd8fc3c7a9ffba116ccaa9c3cd08b07 100644 (file)
@@ -127,6 +127,11 @@ along with GCC; see the file COPYING3.  If not see
        %{!mt:%{!pthread:-a shared -lc -a archive}}}}\
    %{shared:%{mt|pthread:-lpthread}}"
 
+/* The libgcc_stub.a library needs to come last.  */
+#undef LINK_GCC_C_SEQUENCE_SPEC
+#define LINK_GCC_C_SEQUENCE_SPEC \
+  "%G %L %G %{!nostdlib:%{!nodefaultlibs:%{!shared:-lgcc_stub}}}"
+
 #undef STARTFILE_SPEC
 #define STARTFILE_SPEC \
   "%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}} \
index 288645a37721818f4c40a1d7368f64346b01c06c..d3cf559c8ab58d6b341d64362ba6a3f85f098238 100644 (file)
@@ -56,3 +56,42 @@ _Jv_RegisterClasses (void *p)
 {
 }
 #endif
+
+#ifdef L_pthread_default_stacksize_np
+int pthread_default_stacksize_np (unsigned long __attribute__((unused)),
+                                 unsigned long *);
+int
+pthread_default_stacksize_np (unsigned long new, unsigned long *old)
+{
+  if (old)
+    *old = 0;
+  return 0;
+}
+#endif
+
+#ifdef L_pthread_mutex_lock
+int pthread_mutex_lock (void);
+int
+pthread_mutex_lock (void)
+{
+  return 0;
+}
+#endif
+
+#ifdef L_pthread_mutex_unlock
+int pthread_mutex_unlock (void);
+int
+pthread_mutex_unlock (void)
+{
+  return 0;
+}
+#endif
+
+#ifdef L_pthread_once
+int pthread_once (void);
+int
+pthread_once (void)
+{
+  return 0;
+}
+#endif
index 2773828ac39f194b7d5c7e4577257f6258efb8ed..4436b4ca640d7fa9d17b6cb1bac35dbd22b2305d 100644 (file)
@@ -1,2 +1,31 @@
 TARGET_LIBGCC2_CFLAGS = -fPIC -frandom-seed=fixed-seed
 LIB2FUNCS_EXTRA=lib2funcs.asm quadlib.c
+LIBGCCSTUB_OBJS = pthread_default_stacksize_np-stub.o \
+       pthread_mutex_lock-stub.o \
+       pthread_mutex_unlock-stub.o \
+       pthread_once-stub.o
+
+stublib.c: $(srcdir)/config/pa/stublib.c
+       rm -f stublib.c
+       cp $(srcdir)/config/pa/stublib.c .
+
+pthread_default_stacksize_np-stub.o: stublib.c $(GCC_PASSES)
+       $(GCC_FOR_TARGET) -c -O2 -DL_pthread_default_stacksize_np stublib.c \
+         -o pthread_default_stacksize_np-stub.o
+
+pthread_mutex_lock-stub.o: stublib.c $(GCC_PASSES)
+       $(GCC_FOR_TARGET) -c -O2 -DL_pthread_mutex_lock stublib.c \
+         -o pthread_mutex_lock-stub.o
+
+pthread_mutex_unlock-stub.o: stublib.c $(GCC_PASSES)
+       $(GCC_FOR_TARGET) -c -O2 -DL_pthread_mutex_unlock stublib.c \
+         -o pthread_mutex_unlock-stub.o
+
+pthread_once-stub.o: stublib.c $(GCC_PASSES)
+       $(GCC_FOR_TARGET) -c -O2 -DL_pthread_once stublib.c \
+         -o pthread_once-stub.o
+
+$(T)libgcc_stub.a: $(LIBGCCSTUB_OBJS)
+       -rm -rf $(T)libgcc_stub.a
+       $(AR) rc $(T)libgcc_stub.a $(LIBGCCSTUB_OBJS)
+       $(RANLIB) $(T)libgcc_stub.a
index 488c4d55308f48f67d8b15c6c89eda1abbcf5fd7..e6ac7a5bb7def1cdd7624543c9fbe709e9a9dab6 100644 (file)
 
 TARGET_LIBGCC2_CFLAGS = -fPIC -Dpa64=1 -DELF=1 -mlong-calls
 LIB2FUNCS_EXTRA = quadlib.c
-LIBGCCSTUB_OBJS = rfi-stub.o dfi-stub.o jvrc-stub.o cxaf-stub.o
+LIBGCCSTUB_OBJS = rfi-stub.o dfi-stub.o jvrc-stub.o cxaf-stub.o \
+       pthread_default_stacksize_np-stub.o \
+       pthread_mutex_lock-stub.o \
+       pthread_mutex_unlock-stub.o \
+       pthread_once-stub.o
 
 stublib.c: $(srcdir)/config/pa/stublib.c
        rm -f stublib.c
@@ -41,6 +45,22 @@ jvrc-stub.o: stublib.c $(GCC_PASSES)
        $(GCC_FOR_TARGET) -c -O2 -DL_Jv_RegisterClasses stublib.c \
          -o jvrc-stub.o
 
+pthread_default_stacksize_np-stub.o: stublib.c $(GCC_PASSES)
+       $(GCC_FOR_TARGET) -c -O2 -DL_pthread_default_stacksize_np stublib.c \
+         -o pthread_default_stacksize_np-stub.o
+
+pthread_mutex_lock-stub.o: stublib.c $(GCC_PASSES)
+       $(GCC_FOR_TARGET) -c -O2 -DL_pthread_mutex_lock stublib.c \
+         -o pthread_mutex_lock-stub.o
+
+pthread_mutex_unlock-stub.o: stublib.c $(GCC_PASSES)
+       $(GCC_FOR_TARGET) -c -O2 -DL_pthread_mutex_unlock stublib.c \
+         -o pthread_mutex_unlock-stub.o
+
+pthread_once-stub.o: stublib.c $(GCC_PASSES)
+       $(GCC_FOR_TARGET) -c -O2 -DL_pthread_once stublib.c \
+         -o pthread_once-stub.o
+
 $(T)libgcc_stub.a: $(LIBGCCSTUB_OBJS)
        -rm -rf $(T)libgcc_stub.a
        $(AR) rc $(T)libgcc_stub.a $(LIBGCCSTUB_OBJS)