Sync FreeBSD gcc-4 build specs with gcc upstream diff -ur a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h --- a/gcc/config/freebsd-spec.h 2005-12-15 21:32:43 +0000 +++ b/gcc/config/freebsd-spec.h 2007-09-12 12:27:44 +0100 @@ -64,34 +64,44 @@ /* Define the default FreeBSD-specific per-CPU hook code. */ #define FBSD_TARGET_CPU_CPP_BUILTINS() do {} while (0) -/* Provide a CPP_SPEC appropriate for FreeBSD. We just deal with the GCC - option `-posix', and PIC issues. */ +/* Provide a CPP_SPEC appropriate for FreeBSD. We just deal with the GCC + option `-posix', and PIC issues. Try to detect support for the + `long long' type. Unfortunately the GCC spec parser will not allow us + to properly detect the "iso9899:1990" and "iso9899:199409" forms of + -std=c89. Because of the ':' in the -std argument. :-( I have left + them in the spec as a place holder in hopes someone knows a way to make + the detection of them work. */ #define FBSD_CPP_SPEC " \ %(cpp_cpu) \ %(cpp_arch) \ + %{!ansi:%{!std=c89:%{!std=iso9899.1990:%{!std=iso9899.199409:-D_LONGLONG}}}} \ %{posix:-D_POSIX_SOURCE}" -/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add - the magical crtbegin.o file (see crtstuff.c) which provides part - of the support for getting C++ file-scope static object constructed - before entering `main'. */ - -#define FBSD_STARTFILE_SPEC \ - "%{!shared: \ - %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ - %{!p:%{profile:gcrt1.o%s} \ - %{!profile:crt1.o%s}}}} \ - crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" - -/* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on - the magical crtend.o file (see crtstuff.c) which provides part of - the support for getting C++ file-scope static object constructed - before entering `main', followed by a normal "finalizer" file, - `crtn.o'. */ - -#define FBSD_ENDFILE_SPEC \ - "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" +/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add the magical + crtbegin.o file (see crtstuff.c) which provides part of the support for + getting C++ file-scope static object constructed before entering `main'. */ + +#define FBSD_STARTFILE_SPEC "\ + %{!shared: \ + %{pg:gcrt1.o%s} \ + %{!pg: \ + %{p:gcrt1.o%s} \ + %{!p: \ + %{profile:gcrt1.o%s} \ + %{!profile:crt1.o%s}}}} \ + crti.o%s \ + %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}" + +/* Provide an ENDFILE_SPEC appropriate for FreeBSD/i386. Here we tack on + our own magical crtend.o file (see crtstuff.c) which provides part of + the support for getting C++ file-scope static object constructed before + entering `main', followed by the normal "finalizer" file, `crtn.o'. */ + +#define FBSD_ENDFILE_SPEC "\ + %{!shared:crtend.o%s} \ + %{shared:crtendS.o%s} \ + crtn.o%s " /* Provide a LIB_SPEC appropriate for FreeBSD as configured and as required by the user-land thread model. Before __FreeBSD_version @@ -120,7 +130,8 @@ %{pg: -lc_p} \ }" #else -#if FBSD_MAJOR < 5 +#include +#if __FreeBSD_version < 500016 #define FBSD_LIB_SPEC " \ %{!shared: \ %{!pg: \ @@ -134,13 +145,24 @@ #define FBSD_LIB_SPEC " \ %{!shared: \ %{!pg: %{pthread:-lpthread} -lc} \ - %{pg: %{pthread:-lpthread_p} -lc_p} \ - }" + %{pg: %{pthread:-lpthread_p} -lc_p}} \ + %{shared: \ + %{pthread:-lpthread} -lc} \ + " #endif #endif -#if FBSD_MAJOR < 6 +#if FBSD_MAJOR < 5 #define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1" #else #define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1" #endif + +#if defined(HAVE_LD_EH_FRAME_HDR) +#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " +#endif + +/* Use --as-needed -lgcc_s for eh support. */ +#ifdef HAVE_LD_AS_NEEDED +#define USE_LD_AS_NEEDED 1 +#endif diff -ur a/gcc/config/freebsd.h b/gcc/config/freebsd.h --- a/gcc/config/freebsd.h 2005-07-13 17:28:25 +0100 +++ b/gcc/config/freebsd.h 2007-09-12 12:24:55 +0100 @@ -76,12 +76,17 @@ /* Code generation parameters. */ +/* Writing `int' for a bitfield forces int alignment for the structure. */ +/* XXX: ok for Alpha?? */ +#undef PCC_BITFIELD_TYPE_MATTERS +#define PCC_BITFIELD_TYPE_MATTERS 1 + /* Use periods rather than dollar signs in special g++ assembler names. This ensures the configuration knows our system correctly so we can link with libraries compiled with the native cc. */ #undef NO_DOLLAR_IN_LABEL -/* Used by libgcc2.c. We support file locking with fcntl / F_SETLKW. - This enables the test coverage code to use file locking when exiting a - program, which avoids race conditions if the program has forked. */ +/* Define this so we can compile MS code for use with WINE. */ +#define HANDLE_PRAGMA_PACK_PUSH_POP + #define TARGET_POSIX_IO