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]

4.0/4.1 PATCH: Fix Tru64 UNIX execution failures


While both mainline and the 4.0 branch bootstrap on Tru64 UNIX V5.1B,
testsuite results are abysmal since all c++ and objc execution tests fail.
This happens because a couple of pthread symbols are undefined at runtime:

% > LD_LIBRARY_PATH=../../alpha-dec-osf5.1b/libstdc++-v3/src/.libs:.. ./crossjump1.exe 
95389:./crossjump1.exe: /sbin/loader: Error: libstdc++.so.6: symbol "pthread_mutexattr_settype" unresolved
95389:./crossjump1.exe: /sbin/loader: Fatal Error: Load of "./crossjump1.exe" failed: Unresolved symbol name

This was probably introduced by this patch

	http://gcc.gnu.org/ml/gcc-patches/2004-08/msg02293.html

Since Tru64 UNIX lacks #pragma weak, the new libpthread functions need
dummy definitions in gthr-posix.c.  The following patch does this, and I
get rid of all the execution failures on mainline.  4.0 branch testing is
still in progress, but results look reasonable so far.

Since this patch only touches gthr-posix.c, which is only used in
config/alpha/t-osf-pthread and thus cannot affect non-Tru64 UNIX
configurations, it should be very safe for 4.0 as well.

Bootstrapped and regtested on alpha-dec-osf5.1b (mainline: all languages
except Ada; 4.0 branch: all languages except Ada and Java since libgcj
doesn't build here).

Ok for mainline and 4.0 branch if testing passes there?

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University


2005-04-14  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* gthr-posix.c (pthread_cancel): Define.
	(pthread_mutexattr_init): Likewise.
	(pthread_mutexattr_settype): Likewise.
	(pthread_mutexattr_destroy): Likewise.

Index: gcc/gthr-posix.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gthr-posix.c,v
retrieving revision 2.3
diff -u -p -r2.3 gthr-posix.c
--- gcc/gthr-posix.c	15 Oct 2004 14:47:08 -0000	2.3
+++ gcc/gthr-posix.c	15 Apr 2005 16:47:52 -0000
@@ -1,6 +1,6 @@
 /* POSIX threads dummy routines for systems without weak definitions.  */
 /* Compile this one with gcc.  */
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -75,6 +75,12 @@ pthread_create (pthread_t *thread ATTRIB
 }
 
 int
+pthread_cancel(pthread_t thread ATTRIBUTE_UNUSED)
+{
+  return 0;
+}
+
+int
 pthread_mutex_lock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
 {
   return 0;
@@ -93,6 +99,25 @@ pthread_mutex_unlock (pthread_mutex_t *m
 }
 
 int
+pthread_mutexattr_init (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
+{
+  return 0;
+}
+
+int
+pthread_mutexattr_settype (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED,
+			   int type ATTRIBUTE_UNUSED)
+{
+  return 0;
+}
+
+int
+pthread_mutexattr_destroy (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
+{
+  return 0;
+}
+
+int
 pthread_cond_broadcast (pthread_cond_t *cond ATTRIBUTE_UNUSED)
 {
   return 0;


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