From be299aef6f182fa2fbac114be14f5c2823c3f877 Mon Sep 17 00:00:00 2001 From: a_tobler Date: Wed, 14 Feb 2007 20:13:00 +0000 Subject: [PATCH] 2007-02-14 Andreas Tobler * configure.ac: Introduce extra_ldflags_libgc. Use it for Darwin. * configure: Regenerate. * Makefile.am (libgc_la_LDFLAGS): Use extra_ldflags_libgc. * Makefile.in: Regenerate. * include/private/gcconfig.h: Enable MPROTECT_VDB for all Darwin targets. Remove comments. Prepare ppc64 support for Darwin. --- ChangeLog | 10 ++++++++ Makefile.am | 4 +++- Makefile.in | 34 ++++++++++++++++---------- configure | 60 +++++++++++++++++++++++++++------------------- configure.ac | 12 ++++++++-- include/private/gcconfig.h | 21 ++++++++-------- 6 files changed, 90 insertions(+), 51 deletions(-) diff --git a/ChangeLog b/ChangeLog index fced1e2..e1fc871 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-02-14 Andreas Tobler + + * configure.ac: Introduce extra_ldflags_libgc. Use it for Darwin. + * configure: Regenerate. + * Makefile.am (libgc_la_LDFLAGS): Use extra_ldflags_libgc. + * Makefile.in: Regenerate. + * include/private/gcconfig.h: Enable MPROTECT_VDB for all Darwin + targets. Remove comments. + Prepare ppc64 support for Darwin. + 2007-01-29 Andreas Tobler * darwin_stop_world.c: Clean up and reformat code. diff --git a/Makefile.am b/Makefile.am index 05af211..f4ab1aa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -87,11 +87,13 @@ if NEED_ATOMIC_OPS_ASM libgc_la_SOURCES += atomic_ops_sysdeps.S endif +extra_ldflags_libgc = @extra_ldflags_libgc@ + # Include THREADDLLIBS here to ensure that the correct versions of # linuxthread semaphore functions get linked: libgc_la_LIBADD = @addobjs@ $(THREADDLLIBS) $(UNWINDLIBS) libgc_la_DEPENDENCIES = @addobjs@ -libgc_la_LDFLAGS = -version-info 1:2:0 +libgc_la_LDFLAGS = $(extra_ldflags_libgc) -version-info 1:2:0 EXTRA_libgc_la_SOURCES = alpha_mach_dep.S \ mips_sgi_mach_dep.s mips_ultrix_mach_dep.s \ diff --git a/Makefile.in b/Makefile.in index 01a6c33..b39ab6b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -103,9 +103,9 @@ DIST_COMMON = $(am__configure_deps) $(am__pkginclude_HEADERS_DIST) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/bdw-gc.pc.in $(srcdir)/cord/cord.am \ $(srcdir)/doc/doc.am $(srcdir)/include/include.am \ - $(srcdir)/tests/tests.am $(top_srcdir)/configure compile \ - config.guess config.sub depcomp install-sh ltmain.sh missing \ - mkinstalldirs + $(srcdir)/tests/tests.am $(top_srcdir)/configure ChangeLog \ + compile config.guess config.sub depcomp install-sh ltmain.sh \ + missing mkinstalldirs #TESTS += tracetest$(EXEEXT) #check_PROGRAMS += tracetest @@ -215,20 +215,20 @@ LTCCASCOMPILE = $(LIBTOOL) --mode=compile $(CCAS) $(AM_CCASFLAGS) \ $(CCASFLAGS) COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libcord_la_SOURCES) $(libgc_la_SOURCES) \ $(EXTRA_libgc_la_SOURCES) $(libgccpp_la_SOURCES) \ $(gctest_SOURCES) $(leaktest_SOURCES) $(middletest_SOURCES) \ @@ -293,6 +293,7 @@ CPLUSPLUS_TRUE = @CPLUSPLUS_TRUE@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ +CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXINCLUDES = @CXXINCLUDES@ @@ -310,8 +311,11 @@ ENABLE_GCJ_SUPPORT_FALSE = @ENABLE_GCJ_SUPPORT_FALSE@ ENABLE_GCJ_SUPPORT_TRUE = @ENABLE_GCJ_SUPPORT_TRUE@ EXEEXT = @EXEEXT@ EXTRA_TEST_LIBS = @EXTRA_TEST_LIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ GC_CFLAGS = @GC_CFLAGS@ GC_VERSION = @GC_VERSION@ +GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -354,11 +358,9 @@ USE_LIBDIR_TRUE = @USE_LIBDIR_TRUE@ VERSION = @VERSION@ WIN32_THREADS_FALSE = @WIN32_THREADS_FALSE@ WIN32_THREADS_TRUE = @WIN32_THREADS_TRUE@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ +ac_ct_F77 = @ac_ct_F77@ addlibs = @addlibs@ addobjs = @addobjs@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ @@ -378,23 +380,31 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ +extra_ldflags_libgc = @extra_ldflags_libgc@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ subdirs = @subdirs@ @@ -558,7 +568,7 @@ libgc_la_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \ # linuxthread semaphore functions get linked: libgc_la_LIBADD = @addobjs@ $(THREADDLLIBS) $(UNWINDLIBS) libgc_la_DEPENDENCIES = @addobjs@ -libgc_la_LDFLAGS = -version-info 1:2:0 +libgc_la_LDFLAGS = $(extra_ldflags_libgc) -version-info 1:2:0 EXTRA_libgc_la_SOURCES = alpha_mach_dep.S \ mips_sgi_mach_dep.s mips_ultrix_mach_dep.s \ rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \ diff --git a/configure b/configure index bc2fc00..38c8472 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 1.19 . +# From configure.ac Revision: 1.20 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for gc 7.0alpha8. # @@ -882,6 +882,7 @@ WIN32_THREADS_TRUE WIN32_THREADS_FALSE COMPILER_XLC_TRUE COMPILER_XLC_FALSE +extra_ldflags_libgc EXTRA_TEST_LIBS target_all CPLUSPLUS_TRUE @@ -5997,6 +5998,14 @@ fi ;; esac +# extra LD Flags which are required for targets +case "${host}" in +*-*-darwin*) + extra_ldflags_libgc=-Wl,-single_module + ;; +esac + + target_all=libgc.la @@ -6845,7 +6854,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 6848 "configure"' > conftest.$ac_ext + echo '#line 6857 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -9108,11 +9117,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9111: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9120: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9115: \$? = $ac_status" >&5 + echo "$as_me:9124: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -9376,11 +9385,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9379: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9388: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9383: \$? = $ac_status" >&5 + echo "$as_me:9392: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -9480,11 +9489,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9483: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9492: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9487: \$? = $ac_status" >&5 + echo "$as_me:9496: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -11788,7 +11797,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:14240: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14235: \$? = $ac_status" >&5 + echo "$as_me:14244: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14332,11 +14341,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14335: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14344: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14339: \$? = $ac_status" >&5 + echo "$as_me:14348: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15902,11 +15911,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15905: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15914: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15909: \$? = $ac_status" >&5 + echo "$as_me:15918: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16006,11 +16015,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16009: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16018: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16013: \$? = $ac_status" >&5 + echo "$as_me:16022: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -18208,11 +18217,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18211: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18220: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18215: \$? = $ac_status" >&5 + echo "$as_me:18224: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -18476,11 +18485,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18479: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18488: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18483: \$? = $ac_status" >&5 + echo "$as_me:18492: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -18580,11 +18589,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18583: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18592: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:18587: \$? = $ac_status" >&5 + echo "$as_me:18596: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -22817,6 +22826,7 @@ WIN32_THREADS_TRUE!$WIN32_THREADS_TRUE$ac_delim WIN32_THREADS_FALSE!$WIN32_THREADS_FALSE$ac_delim COMPILER_XLC_TRUE!$COMPILER_XLC_TRUE$ac_delim COMPILER_XLC_FALSE!$COMPILER_XLC_FALSE$ac_delim +extra_ldflags_libgc!$extra_ldflags_libgc$ac_delim EXTRA_TEST_LIBS!$EXTRA_TEST_LIBS$ac_delim target_all!$target_all$ac_delim CPLUSPLUS_TRUE!$CPLUSPLUS_TRUE$ac_delim @@ -22850,7 +22860,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 46; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 47; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.ac b/configure.ac index c4aae48..f7d9828 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_INIT(gc,7.0alpha8,Hans.Boehm@hp.com) AC_CONFIG_SRCDIR(gcj_mlc.c) AC_CANONICAL_TARGET AC_PREREQ(2.53) -AC_REVISION($Revision: 1.20 $) +AC_REVISION($Revision: 1.21 $) GC_SET_VERSION AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects nostdinc]) AM_MAINTAINER_MODE @@ -293,11 +293,19 @@ fi # dyld calls anyway case "$host" in *-*-darwin*) ;; - *) + *) AC_CHECK_LIB(dl, dlopen, THREADDLLIBS="$THREADDLLIBS -ldl") ;; esac +# extra LD Flags which are required for targets +case "${host}" in + *-*-darwin*) + extra_ldflags_libgc=-Wl,-single_module + ;; +esac +AC_SUBST(extra_ldflags_libgc) + AC_SUBST(EXTRA_TEST_LIBS) target_all=libgc.la diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index d72dde3..191c991 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -748,25 +748,28 @@ # define DATAEND (_end) # endif # ifdef DARWIN +# define OS_TYPE "DARWIN" +# define DYNAMIC_LOADING # if defined(__ppc64__) # define ALIGNMENT 8 # define CPP_WORDSZ 64 +# define STACKBOTTOM ((ptr_t) 0x7fff5fc00000) +# define CACHE_LINE_SIZE 64 +# ifndef HBLKSIZE +# define HBLKSIZE 4096 +# endif # else # define ALIGNMENT 4 +# define STACKBOTTOM ((ptr_t) 0xc0000000) # endif -# define OS_TYPE "DARWIN" -# define DYNAMIC_LOADING /* XXX: see get_end(3), get_etext() and get_end() should not be used. These aren't used when dyld support is enabled (it is by default) */ # define DATASTART ((ptr_t) get_etext()) # define DATAEND ((ptr_t) get_end()) -# define STACKBOTTOM ((ptr_t) 0xc0000000) # define USE_MMAP # define USE_MMAP_ANON # ifdef GC_DARWIN_THREADS - /* This is potentially buggy. It needs more testing. See the comments in - os_dep.c. It relies on threads to track writes. */ -/* # define MPROTECT_VDB */ +# define MPROTECT_VDB # endif # include # define GETPAGESIZE() getpagesize() @@ -1282,10 +1285,8 @@ # define STACKBOTTOM ((ptr_t) 0xc0000000) # define USE_MMAP # define USE_MMAP_ANON - /* This is potentially buggy. It needs more testing. See the comments in - os_dep.c. It relies on threads to track writes. */ # ifdef GC_DARWIN_THREADS -/* # define MPROTECT_VDB -- disabled for now. May work for some apps. */ +# define MPROTECT_VDB # endif # include # define GETPAGESIZE() getpagesize() @@ -1880,8 +1881,6 @@ # define USE_MMAP # define USE_MMAP_ANON # ifdef GC_DARWIN_THREADS - /* This is potentially buggy. It needs more testing. See the comments in - os_dep.c. It relies on threads to track writes. */ # define MPROTECT_VDB # endif # include -- 2.7.4