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]

Patches for gcc 4.1.2 on Tru64 OSF1


Hi,
we are using gcc 4.1.2 on our (quite historic) Tru64 systems with
operating system OSF1 4.0 and processor alpha ev6.
Problems on this platform are numerous, but gcc works quite well.
In case anyone is interested, here is a set of patches (also attached)
we developed to tweak gcc for our purposes.
I admit some of them could be done differently as I am not very
proficient in gcc internals.

1) The first big problem of OSF1 is that gdb is unusable here. It
either core dumps or just does not work. So you have to stick with
ladebug.
But ladebug requires that all debugging information be present in
native ecoff format and does not like gstabs at all:

diff -Nruw orig/gcc/config/alpha/alpha.h new/gcc/config/alpha/alpha.h
--- gcc-4.1.2/gcc/config/alpha/alpha.h	2005-08-11 02:28:04.000000000 +0200
+++ gcc-4.1.2/gcc/config/alpha/alpha.h	2009-02-12 10:34:27.000000000 +0100
@@ -1448,7 +1448,7 @@
 /* Definitions for debugging.  */

 #define SDB_DEBUGGING_INFO 1		/* generate info for mips-tfile */
-#define DBX_DEBUGGING_INFO 1		/* generate embedded stabs */
+#undef DBX_DEBUGGING_INFO		/* disable stabs */
 #define MIPS_DEBUGGING_INFO 1		/* MIPS specific debugging info */

 #ifndef PREFERRED_DEBUGGING_TYPE	/* assume SDB_DEBUGGING_INFO */
diff -Nruw orig/gcc/config.gcc new/gcc/config.gcc
--- gcc-4.1.2/gcc/config.gcc	2006-10-16 01:12:23.000000000 +0200
+++ gcc-4.1.2/gcc/config.gcc	2009-02-12 12:16:57.000000000 +0100
@@ -593,10 +593,6 @@
 	tmake_file="alpha/t-alpha alpha/t-ieee"
 	;;
 alpha*-dec-osf[45]*)
-	if test x$stabs = xyes
-	then
-		tm_file="${tm_file} dbx.h"
-	fi
 	if test x$gas != xyes
 	then
 		extra_passes="mips-tfile mips-tdump"



2) Another problem is that libgcc contains dummy pthread stubs (module
gthr-posix if I remember correctly).
This poses great problem because under certain linkage conditions,
these dummy pthread stubs can be linked into resulting binary and
system pthread functions from /usr/shlib/libpthread.so.
So we had to disable these dummy pthread stubs and put  "-lpthread" to
gcc linking specs:
--- gcc-4.1.2/gcc/config.gcc.orig	2009-02-19 10:09:33.000000000 +0100
+++ gcc-4.1.2/gcc/config.gcc	2009-02-19 10:13:59.000000000 +0100
@@ -617,7 +617,6 @@
 	case ${enable_threads} in
 	  "" | yes | posix)
 	    thread_file='posix'
-	    tmake_file="${tmake_file} alpha/t-osf-pthread"
 	    ;;
 	esac
 	;;


--- gcc-4.1.2/gcc/gcc.c.orig	2009-02-24 10:13:14.000000000 +0100
+++ gcc-4.1.2/gcc/gcc.c	2009-02-24 13:36:36.000000000 +0100
@@ -667,7 +667,7 @@
    -lgcc and -lc order specially, yet not require them to override all
    of LINK_COMMAND_SPEC.  */
 #ifndef LINK_GCC_C_SEQUENCE_SPEC
-#define LINK_GCC_C_SEQUENCE_SPEC "%G %L %G"
+#define LINK_GCC_C_SEQUENCE_SPEC "%G %L %G -lpthread"
 #endif

 #ifndef LINK_SSP_SPEC


3) Another (minor) problem, maybe occurring only in our environment,
is with gcc specs for mudflap.
This spec contains linker option '-export-dynamic', which is not
recognised by native OSF1 linker.
So another tweak of gcc specs:
--- gcc-4.1.2/gcc/gcc.c.orig	2008-05-20 13:40:27.000000000 +0200
+++ gcc-4.1.2/gcc/gcc.c	2008-05-20 13:41:05.000000000 +0200
@@ -602,7 +602,7 @@
 }} %{fmudflap|fmudflapth: --wrap=main}"
 #endif
 #ifndef MFLIB_SPEC
-#define MFLIB_SPEC "%{fmudflap|fmudflapth: -export-dynamic}"
+#define MFLIB_SPEC "%{fmudflap|fmudflapth:}"
 #endif

 /* config.h can define LIBGCC_SPEC to override how and when libgcc.a is


I anyone has experienced similar and/or other problems on OSF1 4.0
platform, and would like to share them, please comment.
Ivo Raisr

Attachment: gcc-4.1.2-OSF1-disable-gstabs.patch
Description: Binary data

Attachment: gcc-4.1.2-OSF1-disable-dummy-posix-stubs.patch
Description: Binary data

Attachment: gcc-4.1.2-specs-OSF1-pthread.patch
Description: Binary data

Attachment: gcc-4.1.2-specs-SunOS_OSF1.patch
Description: Binary data


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