diff -r -c3 --unidirectional-new-file gcc-3.2.bak/boehm-gc/configure gcc-3.2/boehm-gc/configure *** gcc-3.2.bak/boehm-gc/configure Wed Aug 14 11:31:10 2002 --- gcc-3.2/boehm-gc/configure Sun Sep 29 23:31:55 2002 *************** *** 2709,2714 **** --- 2709,2724 ---- THREADLIBS="-lpthread -lrt" ;; + *-*-freebsd*-gnu*) + cat >> confdefs.h <<\EOF + #define GC_LINUX_THREADS 1 + EOF + + cat >> confdefs.h <<\EOF + #define _REENTRANT 1 + EOF + + ;; *-*-freebsd*) echo "configure: warning: "FreeBSD does not yet fully support threads with Boehm GC."" 1>&2 cat >> confdefs.h <<\EOF diff -r -c3 --unidirectional-new-file gcc-3.2.bak/boehm-gc/configure.in gcc-3.2/boehm-gc/configure.in *** gcc-3.2.bak/boehm-gc/configure.in Wed May 8 06:25:22 2002 --- gcc-3.2/boehm-gc/configure.in Sun Sep 29 23:30:58 2002 *************** *** 95,100 **** --- 95,104 ---- AC_DEFINE(THREAD_LOCAL_ALLOC) THREADLIBS="-lpthread -lrt" ;; + *-*-freebsd*-gnu*) + AC_DEFINE(GC_LINUX_THREADS) + AC_DEFINE(_REENTRANT) + ;; *-*-freebsd*) AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.") AC_DEFINE(GC_FREEBSD_THREADS) diff -r -c3 --unidirectional-new-file gcc-3.2.bak/boehm-gc/dbg_mlc.c gcc-3.2/boehm-gc/dbg_mlc.c *** gcc-3.2.bak/boehm-gc/dbg_mlc.c Wed Feb 13 06:38:39 2002 --- gcc-3.2/boehm-gc/dbg_mlc.c Mon Sep 30 00:35:13 2002 *************** *** 60,66 **** # include # if defined(LINUX) || defined(SUNOS4) || defined(SUNOS5) \ ! || defined(HPUX) || defined(IRIX) || defined(OSF1) # define RANDOM() random() # else # define RANDOM() (long)rand() --- 60,67 ---- # include # if defined(LINUX) || defined(SUNOS4) || defined(SUNOS5) \ ! || defined(HPUX) || defined(IRIX) || defined(OSF1) \ ! || defined(GLIBC_FREEBSD) # define RANDOM() random() # else # define RANDOM() (long)rand() *************** *** 819,825 **** void GC_check_heap_proc() { # ifndef SMALL_CONFIG ! if (sizeof(oh) & (2 * sizeof(word) - 1) != 0) { ABORT("Alignment problem: object header has inappropriate size\n"); } # endif --- 820,826 ---- void GC_check_heap_proc() { # ifndef SMALL_CONFIG ! if ((sizeof(oh) & (2 * sizeof(word) - 1)) != 0) { ABORT("Alignment problem: object header has inappropriate size\n"); } # endif diff -r -c3 --unidirectional-new-file gcc-3.2.bak/boehm-gc/dyn_load.c gcc-3.2/boehm-gc/dyn_load.c *** gcc-3.2.bak/boehm-gc/dyn_load.c Tue Apr 9 02:03:24 2002 --- gcc-3.2/boehm-gc/dyn_load.c Mon Sep 30 00:18:36 2002 *************** *** 26,32 **** * None of this is safe with dlclose and incremental collection. * But then not much of anything is safe in the presence of dlclose. */ ! #if defined(__linux__) && !defined(_GNU_SOURCE) /* Can't test LINUX, since this must be define before other includes */ # define _GNU_SOURCE #endif --- 26,32 ---- * None of this is safe with dlclose and incremental collection. * But then not much of anything is safe in the presence of dlclose. */ ! #if (defined(__linux__) || defined(__gnu_freebsd__)) && !defined(_GNU_SOURCE) /* Can't test LINUX, since this must be define before other includes */ # define _GNU_SOURCE #endif *************** *** 446,452 **** /* For glibc 2.2.4+. Unfortunately, it doesn't work for older */ /* versions. Thanks to Jakub Jelinek for most of the code. */ ! # if defined(LINUX) /* Are others OK here, too? */ \ && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \ || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) --- 446,452 ---- /* For glibc 2.2.4+. Unfortunately, it doesn't work for older */ /* versions. Thanks to Jakub Jelinek for most of the code. */ ! # if (defined(LINUX) || defined(GLIBC_FREEBSD)) /* Are others OK here, too? */ \ && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \ || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) *************** *** 510,516 **** } } ! # else /* !LINUX || version(glibc) < 2.2.4 */ /* Dynamic loading code for Linux running ELF. Somewhat tested on * Linux/x86, untested but hopefully should work on Linux/Alpha. --- 510,516 ---- } } ! # else /* !(LINUX || GLIBC_FREEBSD) || version(glibc) < 2.2.4 */ /* Dynamic loading code for Linux running ELF. Somewhat tested on * Linux/x86, untested but hopefully should work on Linux/Alpha. diff -r -c3 --unidirectional-new-file gcc-3.2.bak/boehm-gc/include/private/gcconfig.h gcc-3.2/boehm-gc/include/private/gcconfig.h *** gcc-3.2.bak/boehm-gc/include/private/gcconfig.h Mon Apr 22 08:05:04 2002 --- gcc-3.2/boehm-gc/include/private/gcconfig.h Mon Sep 30 01:41:25 2002 *************** *** 1051,1075 **** # endif # ifdef FREEBSD # define OS_TYPE "FREEBSD" - # ifndef GC_FREEBSD_THREADS - # define MPROTECT_VDB - # endif - # define SIG_SUSPEND SIGUSR1 - # define SIG_THR_RESTART SIGUSR2 # define FREEBSD_STACKBOTTOM # ifdef __ELF__ # define DYNAMIC_LOADING # endif /* Handle unmapped hole i386*-*-freebsd[45]* may put between etext and edata. */ ! extern char etext[]; ! extern char edata[]; ! extern char end[]; ! # define NEED_FIND_LIMIT ! # define DATASTART ((ptr_t)(etext)) ! # define MIN(x,y) ((x) < (y) ? (x) : (y)) ! # define DATAEND (MIN (GC_find_limit (DATASTART, TRUE), DATASTART2)) ! # define DATASTART2 ((ptr_t)(edata)) ! # define DATAEND2 ((ptr_t)(end)) # endif # ifdef NETBSD # define OS_TYPE "NETBSD" --- 1051,1090 ---- # endif # ifdef FREEBSD # define OS_TYPE "FREEBSD" # define FREEBSD_STACKBOTTOM # ifdef __ELF__ # define DYNAMIC_LOADING # endif + # ifdef __gnu_freebsd__ + /* FreeBSD with glibc. Implies __ELF__. */ + # define GLIBC_FREEBSD + # if !defined(GC_LINUX_THREADS) || !defined(REDIRECT_MALLOC) + # define MPROTECT_VDB + # endif + # define SIG_SUSPEND 57 /* arbitrary signal number <= 128 */ + # define SIG_THR_RESTART 58 /* arbitrary signal number <= 128 */ + # define LINUX_DATA_START + extern int _end[]; + # define DATAEND (_end) + # define USE_MMAP /* brk(0) doesn't return a meaningful value */ + # else + /* FreeBSD with BSD libc. */ + # ifndef GC_FREEBSD_THREADS + # define MPROTECT_VDB + # endif + # define SIG_SUSPEND SIGUSR1 + # define SIG_THR_RESTART SIGUSR2 /* Handle unmapped hole i386*-*-freebsd[45]* may put between etext and edata. */ ! extern char etext[]; ! extern char edata[]; ! extern char end[]; ! # define NEED_FIND_LIMIT ! # define DATASTART ((ptr_t)(etext)) ! # define MIN(x,y) ((x) < (y) ? (x) : (y)) ! # define DATAEND (MIN (GC_find_limit (DATASTART, TRUE), DATASTART2)) ! # define DATASTART2 ((ptr_t)(edata)) ! # define DATAEND2 ((ptr_t)(end)) ! # endif # endif # ifdef NETBSD # define OS_TYPE "NETBSD" *************** *** 1764,1770 **** # if defined(GC_IRIX_THREADS) && !defined(IRIX5) --> inconsistent configuration # endif ! # if defined(GC_LINUX_THREADS) && !defined(LINUX) --> inconsistent configuration # endif # if defined(GC_SOLARIS_THREADS) && !defined(SUNOS5) --- 1779,1785 ---- # if defined(GC_IRIX_THREADS) && !defined(IRIX5) --> inconsistent configuration # endif ! # if defined(GC_LINUX_THREADS) && !(defined(LINUX) || defined(FREEBSD)) --> inconsistent configuration # endif # if defined(GC_SOLARIS_THREADS) && !defined(SUNOS5) *************** *** 1807,1813 **** /* build time, though we feel free to adjust it slightly. */ /* Define NEED_CALLINFO if we either save the call stack or */ /* GC_ADD_CALLER is defined. */ ! #ifdef LINUX # include # if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2 # define HAVE_BUILTIN_BACKTRACE --- 1822,1828 ---- /* build time, though we feel free to adjust it slightly. */ /* Define NEED_CALLINFO if we either save the call stack or */ /* GC_ADD_CALLER is defined. */ ! #if defined(LINUX) || defined(GLIBC_FREEBSD) # include # if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2 # define HAVE_BUILTIN_BACKTRACE *************** *** 1818,1824 **** # define CAN_SAVE_CALL_STACKS # define CAN_SAVE_CALL_ARGS #endif ! #if defined(I386) && defined(LINUX) /* SAVE_CALL_CHAIN is supported if the code is compiled to save */ /* frame pointers by default, i.e. no -fomit-frame-pointer flag. */ # define CAN_SAVE_CALL_STACKS --- 1833,1839 ---- # define CAN_SAVE_CALL_STACKS # define CAN_SAVE_CALL_ARGS #endif ! #if defined(I386) && (defined(LINUX) || defined(GLIBC_FREEBSD)) /* SAVE_CALL_CHAIN is supported if the code is compiled to save */ /* frame pointers by default, i.e. no -fomit-frame-pointer flag. */ # define CAN_SAVE_CALL_STACKS diff -r -c3 --unidirectional-new-file gcc-3.2.bak/boehm-gc/linux_threads.c gcc-3.2/boehm-gc/linux_threads.c *** gcc-3.2.bak/boehm-gc/linux_threads.c Fri Mar 29 23:33:34 2002 --- gcc-3.2/boehm-gc/linux_threads.c Mon Sep 30 00:38:56 2002 *************** *** 992,997 **** --- 992,998 ---- #ifdef GC_LINUX_THREADS /* Return the number of processors, or i<= 0 if it can't be determined. */ + # ifdef LINUX int GC_get_nprocs() { /* Should be "return sysconf(_SC_NPROCESSORS_ONLN);" but that */ *************** *** 1027,1032 **** --- 1028,1048 ---- } return result; } + # endif /* LINUX */ + # ifdef FREEBSD + #include + int GC_get_nprocs() + { + int request[] = { CTL_HW, HW_NCPU }; + int result; + size_t result_len = sizeof (result); + + if (sysctl(request, 2, &result, &result_len, NULL, 0) < 0) + /* Dummy result. */ + result = 1; + return result; + } + # endif /* FREEBSD */ #endif /* GC_LINUX_THREADS */ /* We hold the allocation lock. */ *************** *** 1193,1199 **** UNLOCK(); } ! GC_end_blocking(void) { GC_thread me; LOCK(); /* This will block if the world is stopped. */ me = GC_lookup_thread(pthread_self()); --- 1209,1215 ---- UNLOCK(); } ! void GC_end_blocking(void) { GC_thread me; LOCK(); /* This will block if the world is stopped. */ me = GC_lookup_thread(pthread_self()); diff -r -c3 --unidirectional-new-file gcc-3.2.bak/boehm-gc/ltconfig gcc-3.2/boehm-gc/ltconfig *** gcc-3.2.bak/boehm-gc/ltconfig Fri Aug 17 20:39:16 2001 --- gcc-3.2/boehm-gc/ltconfig Mon Sep 30 02:43:37 2002 *************** *** 1867,1873 **** freebsd1*) dynamic_linker=no ;; ! freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat --- 1867,1887 ---- freebsd1*) dynamic_linker=no ;; ! ! freebsd*-gnu*) ! version_type=linux ! need_lib_prefix=no ! need_version=no ! library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' ! soname_spec='${libname}${release}.so$major' ! shlibpath_var=LD_LIBRARY_PATH ! shlibpath_overrides_runpath=no ! hardcode_into_libs=yes ! dynamic_linker='GNU ld.so' ! # Don't assume a particular installation location. ! sys_lib_search_path_spec="" ! ;; ! freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat diff -r -c3 --unidirectional-new-file gcc-3.2.bak/boehm-gc/os_dep.c gcc-3.2/boehm-gc/os_dep.c *** gcc-3.2.bak/boehm-gc/os_dep.c Wed Apr 10 03:18:07 2002 --- gcc-3.2/boehm-gc/os_dep.c Mon Sep 30 00:59:41 2002 *************** *** 118,124 **** # include #endif ! #if defined(SUNOS5SIGS) || defined (HURD) || defined(LINUX) # ifdef SUNOS5SIGS # include # endif --- 118,125 ---- # include #endif ! #if defined(SUNOS5SIGS) || defined (HURD) || defined(LINUX) \ ! || defined(GLIBC_FREEBSD) # ifdef SUNOS5SIGS # include # endif *************** *** 153,164 **** /* for recent Linux versions. This seems to be the easiest way to */ /* cover all versions. */ ! # ifdef LINUX # pragma weak __data_start extern int __data_start[]; # pragma weak data_start extern int data_start[]; ! # endif /* LINUX */ extern int _end[]; ptr_t GC_data_start; --- 154,165 ---- /* for recent Linux versions. This seems to be the easiest way to */ /* cover all versions. */ ! # if defined(LINUX) || defined(GLIBC_FREEBSD) # pragma weak __data_start extern int __data_start[]; # pragma weak data_start extern int data_start[]; ! # endif /* LINUX || GLIBC_FREEBSD */ extern int _end[]; ptr_t GC_data_start; *************** *** 167,173 **** { extern ptr_t GC_find_limit(); ! # ifdef LINUX /* Try the easy approaches first: */ if (__data_start != 0) { GC_data_start = (ptr_t)__data_start; --- 168,174 ---- { extern ptr_t GC_find_limit(); ! # if defined(LINUX) || defined(GLIBC_FREEBSD) /* Try the easy approaches first: */ if (__data_start != 0) { GC_data_start = (ptr_t)__data_start; *************** *** 177,183 **** GC_data_start = (ptr_t)data_start; return; } ! # endif /* LINUX */ GC_data_start = GC_find_limit((ptr_t)_end, FALSE); } #endif --- 178,184 ---- GC_data_start = (ptr_t)data_start; return; } ! # endif /* LINUX || GLIBC_FREEBSD */ GC_data_start = GC_find_limit((ptr_t)_end, FALSE); } #endif *************** *** 3060,3066 **** /* I suspect the following works for most X86 *nix variants, so */ /* long as the frame pointer is explicitly stored. In the case of gcc, */ /* compiler flags (e.g. -fomit-frame-pointer) determine whether it is. */ ! #if defined(I386) && defined(LINUX) && defined(SAVE_CALL_CHAIN) # include struct frame { --- 3061,3068 ---- /* I suspect the following works for most X86 *nix variants, so */ /* long as the frame pointer is explicitly stored. In the case of gcc, */ /* compiler flags (e.g. -fomit-frame-pointer) determine whether it is. */ ! #if defined(I386) && (defined(LINUX) || defined(GLIBC_FREEBSD)) \ ! && defined(SAVE_CALL_CHAIN) # include struct frame { *************** *** 3109,3115 **** /* Fill in the pc and argument information for up to NFRAMES of my */ /* callers. Ignore my frame and my callers frame. */ ! #ifdef LINUX # include # if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2 # define HAVE_BUILTIN_BACKTRACE --- 3111,3117 ---- /* Fill in the pc and argument information for up to NFRAMES of my */ /* callers. Ignore my frame and my callers frame. */ ! #if defined(LINUX) || defined(GLIBC_FREEBSD) # include # if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2 # define HAVE_BUILTIN_BACKTRACE diff -r -c3 --unidirectional-new-file gcc-3.2.bak/config.guess gcc-3.2/config.guess *** gcc-3.2.bak/config.guess Tue Apr 16 02:15:59 2002 --- gcc-3.2/config.guess Sun Sep 29 17:05:29 2002 *************** *** 726,732 **** echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) ! echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin --- 726,744 ---- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) ! # Determine whether the default compiler uses glibc. ! eval $set_cc_for_build ! sed 's/^ //' << EOF >$dummy.c ! #include ! #if __GLIBC__ >= 2 ! LIBC=gnu ! #else ! LIBC= ! #endif ! EOF ! eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` ! rm -f $dummy.c ! echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin diff -r -c3 --unidirectional-new-file gcc-3.2.bak/config.sub gcc-3.2/config.sub *** gcc-3.2.bak/config.sub Sat Feb 9 04:00:13 2002 --- gcc-3.2/config.sub Sun Sep 29 17:05:29 2002 *************** *** 118,124 **** # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in ! nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; --- 118,124 ---- # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in ! nto-qnx* | linux-gnu* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; diff -r -c3 --unidirectional-new-file gcc-3.2.bak/configure.in gcc-3.2/configure.in *** gcc-3.2.bak/configure.in Mon Jul 8 12:00:57 2002 --- gcc-3.2/configure.in Sun Sep 29 17:05:29 2002 *************** *** 363,369 **** alpha*-*-*) target_makefile_frag="${target_makefile_frag} config/mt-alphaieee" ;; ! *-*-linux*) target_makefile_frag="${target_makefile_frag} config/mt-linux" ;; *-*-aix4.[3456789]* | *-*-aix[56789].*) --- 363,369 ---- alpha*-*-*) target_makefile_frag="${target_makefile_frag} config/mt-alphaieee" ;; ! *-*-linux* | *-*-freebsd*-gnu*) target_makefile_frag="${target_makefile_frag} config/mt-linux" ;; *-*-aix4.[3456789]* | *-*-aix[56789].*) diff -r -c3 --unidirectional-new-file gcc-3.2.bak/gcc/config/alpha/freebsdgnu.h gcc-3.2/gcc/config/alpha/freebsdgnu.h *** gcc-3.2.bak/gcc/config/alpha/freebsdgnu.h Thu Jan 1 01:00:00 1970 --- gcc-3.2/gcc/config/alpha/freebsdgnu.h Sun Sep 29 17:05:29 2002 *************** *** 0 **** --- 1,39 ---- + /* Definitions for Alpha running FreeBSD-based GNU systems with ELF format. + Copyright (C) 2002 Free Software Foundation, Inc. + Contributed by Bruno Haible. + + This file is part of GNU CC. + + GNU CC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU CC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU CC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + #undef TARGET_VERSION + #define TARGET_VERSION fprintf (stderr, " (Alpha FreeBSD/ELF)"); + + /* FIXME: Is a FreeBSD-specific fallback mechanism necessary? */ + #undef MD_FALLBACK_FRAME_STATE_FOR + + #undef ELF_DYNAMIC_LINKER + #define ELF_DYNAMIC_LINKER "/usr/lib/ld.so.1" + + #undef LINK_SPEC + #define LINK_SPEC "-m elf64alpha_fbsd %{G*} %{relax:-relax} \ + %{O*:-O3} %{!O*:-O1} \ + %{shared:-shared} \ + %{!shared: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker %(elf_dynamic_linker)}} \ + %{static:-static}}" diff -r -c3 --unidirectional-new-file gcc-3.2.bak/gcc/config/freebsdgnu.h gcc-3.2/gcc/config/freebsdgnu.h *** gcc-3.2.bak/gcc/config/freebsdgnu.h Thu Jan 1 01:00:00 1970 --- gcc-3.2/gcc/config/freebsdgnu.h Sun Sep 29 17:05:29 2002 *************** *** 0 **** --- 1,26 ---- + /* Definitions for FreeBSD-based GNU systems with ELF format. + Copyright (C) 2002 Free Software Foundation, Inc. + Contributed by Bruno Haible. + + This file is part of GNU CC. + + GNU CC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU CC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU CC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + #undef WCHAR_TYPE + #define WCHAR_TYPE "int" + + #undef CPP_PREDEFINES + #define CPP_PREDEFINES "-D__FreeBSD__=4 -D__ELF__ -Dunix -D__gnu_freebsd__ -Asystem=posix" diff -r -c3 --unidirectional-new-file gcc-3.2.bak/gcc/config/i386/freebsdgnu.h gcc-3.2/gcc/config/i386/freebsdgnu.h *** gcc-3.2.bak/gcc/config/i386/freebsdgnu.h Thu Jan 1 01:00:00 1970 --- gcc-3.2/gcc/config/i386/freebsdgnu.h Sun Sep 29 17:05:29 2002 *************** *** 0 **** --- 1,35 ---- + /* Definitions for Intel 386 running FreeBSD-based GNU systems with ELF format. + Copyright (C) 2002 Free Software Foundation, Inc. + Contributed by Bruno Haible. + + This file is part of GNU CC. + + GNU CC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU CC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU CC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + #undef TARGET_VERSION + #define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD/ELF)"); + + /* FIXME: Is a FreeBSD-specific fallback mechanism necessary? */ + #undef MD_FALLBACK_FRAME_STATE_FOR + + #undef LINK_SPEC + #define LINK_SPEC "-m elf_i386_fbsd %{shared:-shared} \ + %{!shared: \ + %{!ibcs: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker /usr/lib/ld.so.1}} \ + %{static:-static}}}" diff -r -c3 --unidirectional-new-file gcc-3.2.bak/gcc/config/t-freebsd-gnu gcc-3.2/gcc/config/t-freebsd-gnu *** gcc-3.2.bak/gcc/config/t-freebsd-gnu Thu Jan 1 01:00:00 1970 --- gcc-3.2/gcc/config/t-freebsd-gnu Sun Sep 29 22:08:55 2002 *************** *** 0 **** --- 1,19 ---- + # Don't run fixproto + STMP_FIXPROTO = + + # glibc provides a limits.h, which must be combined with gcc's limits.h. + LIMITS_H_TEST = true + + # Compile crtbeginS.o and crtendS.o with pic. + CRTSTUFF_T_CFLAGS_S = -fPIC + # Compile libgcc2.a with pic. + TARGET_LIBGCC2_CFLAGS = -fPIC + + # Override t-slibgcc-elf-ver to export some libgcc symbols with + # the symbol versions that glibc used. + SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver + + # Use unwind-dw2-fde-glibc + LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \ + $(srcdir)/unwind-sjlj.c + LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c diff -r -c3 --unidirectional-new-file gcc-3.2.bak/gcc/config.gcc gcc-3.2/gcc/config.gcc *** gcc-3.2.bak/gcc/config.gcc Tue Aug 6 17:20:55 2002 --- gcc-3.2/gcc/config.gcc Sun Sep 29 17:05:29 2002 *************** *** 361,367 **** ;; esac ! # Common parts for GNU/Linux, GNU/Hurd, OpenBSD, NetBSD, and FreeBSD systems. case $machine in *-*-linux*) xm_defines=POSIX --- 361,368 ---- ;; esac ! # Common parts for GNU/Linux, GNU/Hurd, GNU/FreeBSD, OpenBSD, NetBSD, and ! # FreeBSD systems. case $machine in *-*-linux*) xm_defines=POSIX *************** *** 376,381 **** --- 377,390 ---- ;; esac ;; + *-*-freebsd*-gnu*) + xm_defines=POSIX + # GNU/FreeBSD uses ELF. + elf=yes + # GNU tools are the only tools. + gnu_ld=yes + gas=yes + ;; *-*-gnu*) # On the Hurd, the setup is just about the same on # each different CPU. The specific machines that we *************** *** 569,574 **** --- 578,593 ---- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o" gas=yes gnu_ld=yes ;; + alpha*-*-freebsd*-gnu*) + tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h freebsdgnu.h alpha/freebsdgnu.h" + target_cpu_default="MASK_GAS" + tmake_file="t-slibgcc-elf-ver t-freebsd-gnu alpha/t-crtfm alpha/t-alpha alpha/t-ieee" + extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o" + gas=yes gnu_ld=yes + if test x$enable_threads = xyes; then + thread_file='posix' + fi + ;; alpha*-*-freebsd*) tm_file="${tm_file} ${fbsd_tm_file} alpha/elf.h alpha/freebsd.h" target_cpu_default="MASK_GAS" *************** *** 1236,1241 **** --- 1255,1269 ---- # Next line turned off because both 386BSD and BSD/386 use GNU ld. # use_collect2=yes ;; + i[34567]86-*-freebsd*-gnu*) # i386 running FreeBSD with ELF format using glibc2 + tm_file="${tm_file} i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h freebsdgnu.h i386/freebsdgnu.h" + tmake_file="t-slibgcc-elf-ver t-freebsd-gnu i386/t-crtstuff" + extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" + float_format=i386 + if test x$enable_threads = xyes; then + thread_file='posix' + fi + ;; i[34567]86-*-freebsd[12] | i[34567]86-*-freebsd[12].* | i[34567]86-*-freebsd*aout*) tm_file=i386/freebsd-aout.h tmake_file=t-freebsd diff -r -c3 --unidirectional-new-file gcc-3.2.bak/gcc/cppfiles.c gcc-3.2/gcc/cppfiles.c *** gcc-3.2.bak/gcc/cppfiles.c Fri Jan 18 14:40:28 2002 --- gcc-3.2/gcc/cppfiles.c Sun Sep 29 17:05:29 2002 *************** *** 193,203 **** --- 193,205 ---- cpp_reader *pfile; const char *fname; { + int saved_errno; splay_tree_node node; struct include_file *file; char *name = xstrdup (fname); _cpp_simplify_pathname (name); + saved_errno = errno; node = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) name); if (node) free (name); *************** *** 205,211 **** { file = xcnew (struct include_file); file->name = name; ! file->err_no = errno; node = splay_tree_insert (pfile->all_include_files, (splay_tree_key) file->name, (splay_tree_value) file); --- 207,213 ---- { file = xcnew (struct include_file); file->name = name; ! file->err_no = saved_errno; node = splay_tree_insert (pfile->all_include_files, (splay_tree_key) file->name, (splay_tree_value) file); diff -r -c3 --unidirectional-new-file gcc-3.2.bak/gcc/ginclude/stddef.h gcc-3.2/gcc/ginclude/stddef.h *** gcc-3.2.bak/gcc/ginclude/stddef.h Wed Jan 9 05:56:25 2002 --- gcc-3.2/gcc/ginclude/stddef.h Sun Sep 29 17:05:29 2002 *************** *** 1,4 **** ! /* Copyright (C) 1989, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- ! /* Copyright (C) 1989, 1997-1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 53,59 **** /* On 4.3bsd-net2, make sure ansi.h is included, so we have one less case to deal with in the following. */ ! #if defined (__BSD_NET2__) || defined (____386BSD____) || defined (__FreeBSD__) || defined(__NetBSD__) #include #endif --- 53,59 ---- /* On 4.3bsd-net2, make sure ansi.h is included, so we have one less case to deal with in the following. */ ! #if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && !defined (__gnu_freebsd__)) || defined(__NetBSD__) #include #endif diff -r -c3 --unidirectional-new-file gcc-3.2.bak/libjava/configure gcc-3.2/libjava/configure *** gcc-3.2.bak/libjava/configure Wed Aug 14 11:31:10 2002 --- gcc-3.2/libjava/configure Sun Sep 29 17:05:29 2002 *************** *** 3218,3223 **** --- 3218,3228 ---- *-*-cygwin*) # Don't set THREADLIBS here. Cygwin doesn't have -lpthread. ;; + *-*-freebsd*-gnu*) + # FreeBSD with glibc has -lpthread. + THREADLIBS=-lpthread + THREADSPEC=-lpthread + ;; *-*-freebsd[1234]*) diff -r -c3 --unidirectional-new-file gcc-3.2.bak/libjava/configure.in gcc-3.2/libjava/configure.in *** gcc-3.2.bak/libjava/configure.in Wed May 8 06:26:24 2002 --- gcc-3.2/libjava/configure.in Sun Sep 29 17:05:29 2002 *************** *** 375,380 **** --- 375,385 ---- *-*-cygwin*) # Don't set THREADLIBS here. Cygwin doesn't have -lpthread. ;; + *-*-freebsd*-gnu*) + # FreeBSD with glibc has -lpthread. + THREADLIBS=-lpthread + THREADSPEC=-lpthread + ;; changequote(<<,>>) *-*-freebsd[1234]*) changequote([,]) diff -r -c3 --unidirectional-new-file gcc-3.2.bak/libstdc++-v3/acinclude.m4 gcc-3.2/libstdc++-v3/acinclude.m4 *** gcc-3.2.bak/libstdc++-v3/acinclude.m4 Thu Jul 4 00:47:34 2002 --- gcc-3.2/libstdc++-v3/acinclude.m4 Sun Sep 29 17:05:29 2002 *************** *** 1118,1124 **** dnl Default to "generic" if test x$enable_clocale_flag = xno; then case x${target_os} in ! xlinux* | xgnu*) AC_EGREP_CPP([_GLIBCPP_ok], [ #include #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) --- 1118,1124 ---- dnl Default to "generic" if test x$enable_clocale_flag = xno; then case x${target_os} in ! xlinux* | xgnu* | xfreebsd*-gnu*) AC_EGREP_CPP([_GLIBCPP_ok], [ #include #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) *************** *** 1288,1294 **** # compile most of libio for linux systems. if test x$has_libio = x"yes"; then case "$target" in ! *-*-linux*) AC_MSG_CHECKING([for glibc version >= 2.2]) AC_EGREP_CPP([ok], [ #include --- 1288,1294 ---- # compile most of libio for linux systems. if test x$has_libio = x"yes"; then case "$target" in ! *-*-linux* | *-*-freebsd*-gnu*) AC_MSG_CHECKING([for glibc version >= 2.2]) AC_EGREP_CPP([ok], [ #include diff -r -c3 --unidirectional-new-file gcc-3.2.bak/libstdc++-v3/aclocal.m4 gcc-3.2/libstdc++-v3/aclocal.m4 *** gcc-3.2.bak/libstdc++-v3/aclocal.m4 Thu Jul 4 00:47:35 2002 --- gcc-3.2/libstdc++-v3/aclocal.m4 Sun Sep 29 17:05:29 2002 *************** *** 1130,1136 **** dnl Default to "generic" if test x$enable_clocale_flag = xno; then case x${target_os} in ! xlinux* | xgnu*) AC_EGREP_CPP([_GLIBCPP_ok], [ #include #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) --- 1130,1136 ---- dnl Default to "generic" if test x$enable_clocale_flag = xno; then case x${target_os} in ! xlinux* | xgnu* | xfreebsd*-gnu*) AC_EGREP_CPP([_GLIBCPP_ok], [ #include #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) *************** *** 1300,1306 **** # compile most of libio for linux systems. if test x$has_libio = x"yes"; then case "$target" in ! *-*-linux*) AC_MSG_CHECKING([for glibc version >= 2.2]) AC_EGREP_CPP([ok], [ #include --- 1300,1306 ---- # compile most of libio for linux systems. if test x$has_libio = x"yes"; then case "$target" in ! *-*-linux* | *-*-freebsd*-gnu*) AC_MSG_CHECKING([for glibc version >= 2.2]) AC_EGREP_CPP([ok], [ #include diff -r -c3 --unidirectional-new-file gcc-3.2.bak/libstdc++-v3/config/locale/gnu/c_locale.cc gcc-3.2/libstdc++-v3/config/locale/gnu/c_locale.cc *** gcc-3.2.bak/libstdc++-v3/config/locale/gnu/c_locale.cc Fri Apr 19 09:59:03 2002 --- gcc-3.2/libstdc++-v3/config/locale/gnu/c_locale.cc Sun Sep 29 17:05:20 2002 *************** *** 39,44 **** --- 39,55 ---- namespace std { + extern "C" __typeof (strtol_l) __strtol_l; + extern "C" __typeof (strtoul_l) __strtoul_l; + extern "C" __typeof (strtoll_l) __strtoll_l; + extern "C" __typeof (strtoull_l) __strtoull_l; + extern "C" __typeof (strtof_l) __strtof_l; + extern "C" __typeof (strtod_l) __strtod_l; + extern "C" __typeof (strtold_l) __strtold_l; + extern "C" __typeof (newlocale) __newlocale; + extern "C" __typeof (freelocale) __freelocale; + extern "C" __typeof (duplocale) __duplocale; + template<> void __convert_to_v(const char* __s, long& __v, ios_base::iostate& __err, diff -r -c3 --unidirectional-new-file gcc-3.2.bak/libstdc++-v3/config/locale/gnu/collate_members.cc gcc-3.2/libstdc++-v3/config/locale/gnu/collate_members.cc *** gcc-3.2.bak/libstdc++-v3/config/locale/gnu/collate_members.cc Fri Apr 19 09:59:03 2002 --- gcc-3.2/libstdc++-v3/config/locale/gnu/collate_members.cc Sun Sep 29 17:05:20 2002 *************** *** 37,42 **** --- 37,47 ---- namespace std { + extern "C" __typeof (strcoll_l) __strcoll_l; + extern "C" __typeof (strxfrm_l) __strxfrm_l; + extern "C" __typeof (wcscoll_l) __wcscoll_l; + extern "C" __typeof (wcsxfrm_l) __wcsxfrm_l; + // These are basically extensions to char_traits, and perhaps should // be put there instead of here. template<> diff -r -c3 --unidirectional-new-file gcc-3.2.bak/libstdc++-v3/config/locale/gnu/ctype_members.cc gcc-3.2/libstdc++-v3/config/locale/gnu/ctype_members.cc *** gcc-3.2.bak/libstdc++-v3/config/locale/gnu/ctype_members.cc Fri May 24 18:15:25 2002 --- gcc-3.2/libstdc++-v3/config/locale/gnu/ctype_members.cc Sun Sep 29 17:05:20 2002 *************** *** 37,42 **** --- 37,47 ---- namespace std { + extern "C" __typeof (wctype_l) __wctype_l; + extern "C" __typeof (towupper_l) __towupper_l; + extern "C" __typeof (towlower_l) __towlower_l; + extern "C" __typeof (iswctype_l) __iswctype_l; + // NB: The other ctype specializations are in src/locale.cc and // various /config/os/* files. template<> diff -r -c3 --unidirectional-new-file gcc-3.2.bak/libstdc++-v3/config/locale/gnu/messages_members.cc gcc-3.2/libstdc++-v3/config/locale/gnu/messages_members.cc *** gcc-3.2.bak/libstdc++-v3/config/locale/gnu/messages_members.cc Sun May 19 00:00:14 2002 --- gcc-3.2/libstdc++-v3/config/locale/gnu/messages_members.cc Sun Sep 29 17:05:20 2002 *************** *** 37,42 **** --- 37,43 ---- namespace std { + extern "C" __typeof (uselocale) __uselocale; // Specializations. template<> string diff -r -c3 --unidirectional-new-file gcc-3.2.bak/libstdc++-v3/config/locale/gnu/messages_members.h gcc-3.2/libstdc++-v3/config/locale/gnu/messages_members.h *** gcc-3.2.bak/libstdc++-v3/config/locale/gnu/messages_members.h Sun May 19 00:00:14 2002 --- gcc-3.2/libstdc++-v3/config/locale/gnu/messages_members.h Sun Sep 29 17:05:20 2002 *************** *** 33,38 **** --- 33,40 ---- // Written by Benjamin Kosnik + extern "C" __typeof (uselocale) __uselocale; + // Non-virtual member functions. template typename messages<_CharT>::catalog diff -r -c3 --unidirectional-new-file gcc-3.2.bak/libstdc++-v3/config/locale/gnu/monetary_members.cc gcc-3.2/libstdc++-v3/config/locale/gnu/monetary_members.cc *** gcc-3.2.bak/libstdc++-v3/config/locale/gnu/monetary_members.cc Sat Jul 27 01:23:42 2002 --- gcc-3.2/libstdc++-v3/config/locale/gnu/monetary_members.cc Sun Sep 29 17:05:20 2002 *************** *** 37,42 **** --- 37,44 ---- namespace std { + extern "C" __typeof (nl_langinfo_l) __nl_langinfo_l; + // Construct and return valid pattern consisting of some combination of: // space none symbol sign value money_base::pattern diff -r -c3 --unidirectional-new-file gcc-3.2.bak/libstdc++-v3/config/locale/gnu/numeric_members.cc gcc-3.2/libstdc++-v3/config/locale/gnu/numeric_members.cc *** gcc-3.2.bak/libstdc++-v3/config/locale/gnu/numeric_members.cc Fri Apr 19 09:59:03 2002 --- gcc-3.2/libstdc++-v3/config/locale/gnu/numeric_members.cc Sun Sep 29 17:05:20 2002 *************** *** 37,42 **** --- 37,44 ---- namespace std { + extern "C" __typeof (nl_langinfo_l) __nl_langinfo_l; + template<> void numpunct::_M_initialize_numpunct(__c_locale __cloc) diff -r -c3 --unidirectional-new-file gcc-3.2.bak/libstdc++-v3/config/locale/gnu/time_members.cc gcc-3.2/libstdc++-v3/config/locale/gnu/time_members.cc *** gcc-3.2.bak/libstdc++-v3/config/locale/gnu/time_members.cc Sun May 19 00:00:14 2002 --- gcc-3.2/libstdc++-v3/config/locale/gnu/time_members.cc Sun Sep 29 17:05:20 2002 *************** *** 38,43 **** --- 38,47 ---- namespace std { + extern "C" __typeof (strftime_l) __strftime_l; + extern "C" __typeof (wcsftime_l) __wcsftime_l; + extern "C" __typeof (nl_langinfo_l) __nl_langinfo_l; + template<> __timepunct::~__timepunct() { *************** *** 52,58 **** const tm* __tm) const { #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) ! __strftime_l(__s, __maxlen, _M_c_locale_timepunct, __format, __tm); #else char* __old = strdup(setlocale(LC_ALL, NULL)); setlocale(LC_ALL, _M_name_timepunct); --- 56,62 ---- const tm* __tm) const { #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) ! __strftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct); #else char* __old = strdup(setlocale(LC_ALL, NULL)); setlocale(LC_ALL, _M_name_timepunct); *************** *** 202,208 **** const tm* __tm) const { #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) ! __wcsftime_l(__s, __maxlen, _M_c_locale_timepunct, __format, __tm); #else char* __old = strdup(setlocale(LC_ALL, NULL)); setlocale(LC_ALL, _M_name_timepunct); --- 206,212 ---- const tm* __tm) const { #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) ! __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct); #else char* __old = strdup(setlocale(LC_ALL, NULL)); setlocale(LC_ALL, _M_name_timepunct); diff -r -c3 --unidirectional-new-file gcc-3.2.bak/libstdc++-v3/config/os/gnu-linux/bits/ctype_noninline.h gcc-3.2/libstdc++-v3/config/os/gnu-linux/bits/ctype_noninline.h *** gcc-3.2.bak/libstdc++-v3/config/os/gnu-linux/bits/ctype_noninline.h Fri Apr 19 09:59:07 2002 --- gcc-3.2/libstdc++-v3/config/os/gnu-linux/bits/ctype_noninline.h Mon Sep 30 04:03:04 2002 *************** *** 34,48 **** // Information as gleaned from /usr/include/ctype.h - #if _GLIBCPP_USE_SHADOW_HEADERS - using _C_legacy::__ctype_toupper; - using _C_legacy::__ctype_tolower; - using _C_legacy::__ctype_b; - #endif - const ctype_base::mask* ctype::classic_table() throw() ! { return __ctype_b; } #if _GLIBCPP_C_LOCALE_GNU ctype::ctype(__c_locale __cloc, const mask* __table, bool __del, --- 34,42 ---- // Information as gleaned from /usr/include/ctype.h const ctype_base::mask* ctype::classic_table() throw() ! { return *(__ctype_b_loc ()); } #if _GLIBCPP_C_LOCALE_GNU ctype::ctype(__c_locale __cloc, const mask* __table, bool __del, *************** *** 58,71 **** ctype::ctype(__c_locale, const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base(__refs), _M_del(__table != 0 && __del), ! _M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower), _M_table(__table ? __table : classic_table()) { _M_c_locale_ctype = _S_c_locale; } #endif ctype::ctype(const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base(__refs), _M_del(__table != 0 && __del), ! _M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower), _M_table(__table ? __table : classic_table()) { _M_c_locale_ctype = _S_c_locale; } --- 52,65 ---- ctype::ctype(__c_locale, const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base(__refs), _M_del(__table != 0 && __del), ! _M_toupper(*(__ctype_toupper_loc ())), _M_tolower(*(__ctype_tolower_loc ())), _M_table(__table ? __table : classic_table()) { _M_c_locale_ctype = _S_c_locale; } #endif ctype::ctype(const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base(__refs), _M_del(__table != 0 && __del), ! _M_toupper(*(__ctype_toupper_loc ())), _M_tolower(*(__ctype_tolower_loc ())), _M_table(__table ? __table : classic_table()) { _M_c_locale_ctype = _S_c_locale; } diff -r -c3 --unidirectional-new-file gcc-3.2.bak/libstdc++-v3/configure gcc-3.2/libstdc++-v3/configure *** gcc-3.2.bak/libstdc++-v3/configure Sat Jul 27 01:23:04 2002 --- gcc-3.2/libstdc++-v3/configure Sun Sep 29 17:05:29 2002 *************** *** 2782,2788 **** # compile most of libio for linux systems. if test x$has_libio = x"yes"; then case "$target" in ! *-*-linux*) echo $ac_n "checking for glibc version >= 2.2""... $ac_c" 1>&6 echo "configure:2788: checking for glibc version >= 2.2" >&5 cat > conftest.$ac_ext <= 2.2""... $ac_c" 1>&6 echo "configure:2788: checking for glibc version >= 2.2" >&5 cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <