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]

Patches for HP-UX support on IA64


I have a set of changes I would like to have reviewed and checked in to
support HP-UX on the IA64 platform.  These are a subset of some earlier
changes I submitted that were rejected as being too much for a single
submition (as well as other problems).

None of the changes involve common code so I was hoping I could get them
checked in on the 3.0 branch as well as the main line.  I don't know if
that is possible at this time or not.

One possible issue is the definition of ASM_OUTPUT_DWARF_OFFSET in
hpux.h, I put it there to avoid affecting any other platforms but on the
last submittion Richard Henderson suggested this could be done
generically for ia64.  I have no objection to moving it if someone more
familiar with linux ia64 wants to do that.

Here are the changes:

2001-03-05  Steve Ellcey  <sje@cup.hp.com>

	* config.gcc (ia64*-*-hpux*): New case.
	* config/ia64/hpux.h: New file for HP-UX support.
	* config/ia64/t-hpux: New file for HP-UX support.


*** config.gcc.orig	Mon Mar  5 12:57:46 2001
--- config.gcc	Thu Mar  1 15:54:50 2001
*************** ia64*-*-linux*)
*** 1614,1619 ****
--- 1614,1634 ----
  	fi
  	float_format=i386
  	;;
+ ia64*-*-hpux*)
+ 	tm_file=ia64/hpux.h
+ 	tmake_file="ia64/t-ia64 ia64/t-hpux"
+ 	if test x$gas = xyes; then
+ 		target_cpu_default="${target_cpu_default}|MASK_GNU_AS"
+ 	fi
+ 	if test x$gnu_ld = xyes; then
+ 		target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
+ 	fi
+ 	target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
+ 	if test x$enable_threads = xyes; then
+ 		thread_file='posix'
+ 	fi
+ 	float_format=i386
+ 	;;
  m32r-*-elf*)
  	extra_parts="crtinit.o crtfini.o"
  	;;
*** config/ia64/hpux.h.orig	Mon Mar  5 12:57:17 2001
--- config/ia64/hpux.h	Mon Mar  5 10:48:23 2001
***************
*** 0 ****
--- 1,76 ----
+ /* Definitions for ia64-hpux target.  */
+ #include "ia64/ia64.h"
+ #include "svr4.h"
+ #include "sysv4.h"
+ 
+ #undef CPP_PREDEFINES
+ #define CPP_PREDEFINES "\
+   -D__IA64__ -D__ia64 -D__ia64__ -D__hpux -D__hpux__ -Dhpux -Dunix \
+   -D__BIG_ENDIAN__ -D_LONGLONG -D__ELF__ \
+   -Asystem(hpux) -Acpu(ia64) -Amachine(ia64) -D_UINT128_T"
+ 
+ /* -D__fpreg=long double is needed to compensate for the lack of __fpreg
+    which is a primitive type in HP C but does not exist in GNU C.  Same
+    for __float80 and __float128.  These types appear in HP-UX header
+    files and so must have some definition.  */
+ 
+ #undef CPP_SPEC
+ #define CPP_SPEC "\
+   %{mcpu=itanium:-D__itanium__} %{mbig-endian:-D__BIG_ENDIAN__} \
+   %{!milp32:-D__LP64__ -D__LONG_MAX__=9223372036854775807L} \
+   %{!ansi: -D_HPUX_SOURCE -D__STDC_EXT__} \
+   -D__fpreg=long\\ double \
+   -D__float80=long\\ double \
+   -D__float128=long\\ double"
+ 
+ #undef ASM_SPEC
+ #define ASM_SPEC "-x %{mconstant-gp} %{mauto-pic}"
+ 
+ #undef ENDFILE_SPEC
+ 
+ #undef STARTFILE_SPEC
+ #ifdef CROSS_COMPILE
+ #define STARTFILE_SPEC "%{!shared:crt0%O%s}"
+ #else
+ #define STARTFILE_SPEC "/usr/ccs/lib/hpux64/crt0%O"
+ #endif
+ 
+ #undef LINK_SPEC
+ #define LINK_SPEC "\
+   +Accept TypeMismatch \
+   %{shared:-b} \
+   %{!shared: \
+     -u main \
+     %{!static: \
+       %{rdynamic:-export-dynamic}} \
+       %{static:-static}}"
+ 
+ #undef  LIB_SPEC
+ #define LIB_SPEC "%{!shared:%{!symbolic:-lc}}"
+ 
+ #define DONT_USE_BUILTIN_SETJMP
+ #define JMP_BUF_SIZE  (8 * 76)
+ 
+ #undef CONST_SECTION_ASM_OP
+ #define CONST_SECTION_ASM_OP    "\t.section\t.data,\t\"a\",\t\"progbits\""
+ 
+ #undef BITS_BIG_ENDIAN
+ #define BITS_BIG_ENDIAN 1
+ 
+ #undef TARGET_DEFAULT
+ #define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_BIG_ENDIAN)
+ 
+ /* We need this macro to output DWARF2 information correctly.  The macro
+    is defined in dwarf2out.c, but it will not do section relative offsets
+    which messes up our ability to debug using gdb.  */
+ 
+ #undef ASM_OUTPUT_DWARF_OFFSET
+ #define ASM_OUTPUT_DWARF_OFFSET(FILE,LABEL)				\
+  do {									\
+ 	fprintf ((FILE), "\t%s\t", UNALIGNED_OFFSET_ASM_OP);		\
+ 	fprintf ((FILE), "@secrel(");                                   \
+ 	assemble_name (FILE, LABEL);					\
+ 	fprintf ((FILE), ")");                                          \
+   } while (0)
+ 
+ /* End of hpux.h */
*** config/ia64/t-hpux.orig	Mon Mar  5 12:57:23 2001
--- config/ia64/t-hpux	Mon Mar  5 10:45:18 2001
***************
*** 0 ****
--- 1,6 ----
+ # HP-UX gets an undefined main when building LIBGCC1_TEST because the
+ # linkspec has "-u main" and we want that for linking but it makes
+ # LIBGCC1_TEST fail because it uses -nostdlib -nostartup and main is
+ # not defined in the test program.
+ 
+ LIBGCC1_TEST =


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