This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH (3.3, *-freebsd*): Tweaks to match FreeBSD system compiler
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 16 Dec 2003 05:01:58 -0600 (CST)
- Subject: PATCH (3.3, *-freebsd*): Tweaks to match FreeBSD system compiler
- Reply-to: rittle at labs dot mot dot com
The FreeBSD system compiler installed a bug fix and/or change to agree
with cpp.texi -r1.50.4.4 (I believe that someone actually transfered a
documentation patch from 3.4 to 3.3 in error since they didn't also
pull all the code to affect the change...). In any case, the FreeBSD
system headers will now use __LP64__ and expect gcc to set it
correctly. Provided off-list by David O'Brien. Thanks!
Regards,
Loren
("As obvious", yet 'strapped in context on each of the affected targets.)
* config/alpha/freebsd.h (FBSD_TARGET_CPU_CPP_BUILTINS): Add __LP64__.
* config/sparc/freebsd.h (FBSD_TARGET_CPU_CPP_BUILTINS): Likewise.
* config/i386/freebsd64.h (FBSD_TARGET_CPU_CPP_BUILTINS): Conditionally
add __LP64__.
Index: gcc/config/alpha/freebsd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/freebsd.h,v
retrieving revision 1.13.14.1
diff -c -r1.13.14.1 freebsd.h
*** gcc/config/alpha/freebsd.h 12 Mar 2003 02:38:01 -0000 1.13.14.1
--- gcc/config/alpha/freebsd.h 16 Dec 2003 10:31:59 -0000
***************
*** 29,34 ****
--- 29,35 ----
#define FBSD_TARGET_CPU_CPP_BUILTINS() \
do \
{ \
+ builtin_define ("__LP64__"); \
if (flag_pic) \
{ \
builtin_define ("__PIC__"); \
Index: gcc/config/i386/freebsd64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/freebsd64.h,v
retrieving revision 1.3.22.1
diff -c -r1.3.22.1 freebsd64.h
*** gcc/config/i386/freebsd64.h 29 Apr 2003 11:44:20 -0000 1.3.22.1
--- gcc/config/i386/freebsd64.h 16 Dec 2003 10:31:59 -0000
***************
*** 23,28 ****
--- 23,39 ----
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (FreeBSD/x86-64 ELF)");
+ #undef FBSD_TARGET_CPU_CPP_BUILTINS
+ #define FBSD_TARGET_CPU_CPP_BUILTINS() \
+ do \
+ { \
+ if (TARGET_64BIT) \
+ { \
+ builtin_define ("__LP64__"); \
+ } \
+ } \
+ while (0)
+
/* Provide a LINK_SPEC appropriate for the FreeBSD/x86-64 ELF target.
This is a copy of LINK_SPEC from <i386/freebsd.h> tweaked for
the x86-64 target. */
Index: gcc/config/sparc/freebsd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/freebsd.h,v
retrieving revision 1.15.2.2
diff -c -r1.15.2.2 freebsd.h
*** gcc/config/sparc/freebsd.h 22 May 2003 04:03:08 -0000 1.15.2.2
--- gcc/config/sparc/freebsd.h 16 Dec 2003 10:31:59 -0000
***************
*** 25,30 ****
--- 25,38 ----
#define CPP_CPU64_DEFAULT_SPEC \
"-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__sparc__ -D__arch64__"
+ #undef FBSD_TARGET_CPU_CPP_BUILTINS
+ #define FBSD_TARGET_CPU_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define ("__LP64__"); \
+ } \
+ while (0)
+
/* Because we include sparc/sysv4.h. */
#undef CPP_PREDEFINES
/* Do not define it here, we now use TARGET_OS_CPP_BUILTINS. */