This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Define _ILP32 in ILP32 mode on IA-64 HPUX
- From: Roger Sayle <roger at eyesopen dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 21 Dec 2003 12:29:10 -0700 (MST)
- Subject: [PATCH] Define _ILP32 in ILP32 mode on IA-64 HPUX
The bootstrap of both mainline and gcc 3.3 is currently broken on
ia64-hp-hpux11.22 whilst building boehm-gc. The problem is that
the file boehm-gc/include/private/gcconfig.h contains the following:
# ifdef IA64
...
# ifdef HPUX
# ifdef _ILP32
..
# else
# ifndef _LP64
---> unknown ABI
# endif
# endif
# endif
# endif
The problem is that unlike the native HPUX compiler, GCC doesn't define
the _ILP32 symbol in -milp32 (the default) mode. Hence the bootstrap
fails in the "unknown ABI" case. GCC does however define _LP64 (like
the native compiler) in -mlp64 mode, but this is done in GCC's machine
independent code. [i.e. all LP64 targets get _LP64 defined for them].
The following simple patch fixes this difference/assymmetry, and allows
bootstrap on ia64-hp-hpux11.22 to proceed further. Tested by hand that
the _ILP32 and _LP64 macros with -milp32 and -mlp64 now match their usage
with the HP compiler's +DD32 and +DD64 command line options.
Ok for mainline? And 3.3?
2003-12-21 Roger Sayle <roger@eyesopen.com>
* config/ia64/hpux.h (TARGET_OS_CPP_BUILTINS): Define _ILP32
when compiling in ILP32 mode.
Index: config/ia64/hpux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/hpux.h,v
retrieving revision 1.35
diff -c -3 -p -r1.35 hpux.h
*** config/ia64/hpux.h 4 Dec 2003 05:46:15 -0000 1.35
--- config/ia64/hpux.h 21 Dec 2003 15:11:27 -0000
*************** do { \
*** 45,50 ****
--- 45,52 ----
builtin_define("_HPUX_SOURCE"); \
builtin_define("__STDC_EXT__"); \
} \
+ if (TARGET_ILP32) \
+ builtin_define("_ILP32"); \
} while (0)
#undef CPP_SPEC
Roger
--
Roger Sayle, E-mail: roger@eyesopen.com
OpenEye Scientific Software, WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road, Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507. Fax: (+1) 505-473-0833