From ebfb71e6346eb26a236c53b41e30b4fc1a8d33f5 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Fri, 18 Feb 2011 21:39:51 +0000 Subject: [PATCH] config.gcc (hppa[12]*-*-hpux11*): Set extra_parts. * 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: r170290 --- gcc/ChangeLog | 9 +++++++++ gcc/config.gcc | 1 + gcc/config/pa/pa-hpux11.h | 5 +++++ gcc/config/pa/stublib.c | 39 +++++++++++++++++++++++++++++++++++++++ gcc/config/pa/t-pa-hpux11 | 29 +++++++++++++++++++++++++++++ gcc/config/pa/t-pa64 | 24 ++++++++++++++++++++++-- 6 files changed, 105 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fb2b2104ca3e..7743ae0d4935 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2011-02-18 John David Anglin + + * 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-17 Uros Bizjak PR target/43653 diff --git a/gcc/config.gcc b/gcc/config.gcc index 6f72224c72cd..cc34a591d85e 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1012,6 +1012,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 diff --git a/gcc/config/pa/pa-hpux11.h b/gcc/config/pa/pa-hpux11.h index 77a899eabd50..db95f001940a 100644 --- a/gcc/config/pa/pa-hpux11.h +++ b/gcc/config/pa/pa-hpux11.h @@ -129,6 +129,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}} \ diff --git a/gcc/config/pa/stublib.c b/gcc/config/pa/stublib.c index c3f0f4506a5b..a4fc55c7c188 100644 --- a/gcc/config/pa/stublib.c +++ b/gcc/config/pa/stublib.c @@ -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 diff --git a/gcc/config/pa/t-pa-hpux11 b/gcc/config/pa/t-pa-hpux11 index f36a75cb9c5e..3b830fdefaa2 100644 --- a/gcc/config/pa/t-pa-hpux11 +++ b/gcc/config/pa/t-pa-hpux11 @@ -1,2 +1,31 @@ TARGET_LIBGCC2_CFLAGS = -fPIC 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 diff --git a/gcc/config/pa/t-pa64 b/gcc/config/pa/t-pa64 index 9fd9607eb998..aa60297b7367 100644 --- a/gcc/config/pa/t-pa64 +++ b/gcc/config/pa/t-pa64 @@ -1,7 +1,11 @@ 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 cp $(srcdir)/config/pa/stublib.c . @@ -22,6 +26,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) -- 2.47.2