From 0b8ca8fefec7479e91654819be9b77362406b1b5 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 18 Dec 2012 14:28:24 +0000 Subject: [PATCH] libgo: Link against libatomic. ./: PR go/55201 * Makefile.def (all-target-libgo): Depend on all-target-libatomic. * Makefile.in: Regenerate. gcc/go: PR go/55201 * gospec.c (LIBATOMIC): Define. (LIBATOMIC_PROFILE): Define. (lang_specific_driver): Add LIBATOMIC[_PROFILE] option. gcc/testsuite: * lib/go.exp (go_link_flags): Add libatomic location to flags and ld_library_path. From-SVN: r194581 --- ChangeLog | 6 ++++++ Makefile.def | 1 + Makefile.in | 1 + gcc/go/ChangeLog | 7 +++++++ gcc/go/gospec.c | 8 ++++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/lib/go.exp | 5 +++++ libgo/Makefile.am | 5 +++-- libgo/Makefile.in | 9 +++++---- 9 files changed, 41 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index afaf41345246..c2b876652c00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-12-18 Andreas Schwab + + PR go/55201 + * Makefile.def (all-target-libgo): Depend on all-target-libatomic. + * Makefile.in: Regenerate. + 2012-12-16 Thomas Schwinge * configure.ac (ENABLE_GOLD): Consider *-*-gnu* targets ELF. diff --git a/Makefile.def b/Makefile.def index 8d8af2332cd5..e25799a6e461 100644 --- a/Makefile.def +++ b/Makefile.def @@ -497,6 +497,7 @@ dependencies = { module=configure-target-libgo; on=configure-target-libffi; }; dependencies = { module=configure-target-libgo; on=all-target-libstdc++-v3; }; dependencies = { module=all-target-libgo; on=all-target-libbacktrace; }; dependencies = { module=all-target-libgo; on=all-target-libffi; }; +dependencies = { module=all-target-libgo; on=all-target-libatomic; }; dependencies = { module=configure-target-libjava; on=configure-target-zlib; }; dependencies = { module=configure-target-libjava; on=configure-target-boehm-gc; }; dependencies = { module=configure-target-libjava; on=configure-target-libffi; }; diff --git a/Makefile.in b/Makefile.in index a9d2890f7f7f..a0281e9d3ad1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -46154,6 +46154,7 @@ configure-target-libgo: maybe-configure-target-libffi configure-target-libgo: maybe-all-target-libstdc++-v3 all-target-libgo: maybe-all-target-libbacktrace all-target-libgo: maybe-all-target-libffi +all-target-libgo: maybe-all-target-libatomic configure-target-libjava: maybe-configure-target-zlib configure-target-libjava: maybe-configure-target-boehm-gc configure-target-libjava: maybe-configure-target-libffi diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index 1797763be96f..a29a8e010b37 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -1,3 +1,10 @@ +2012-12-18 Andreas Schwab + + PR go/55201 + * gospec.c (LIBATOMIC): Define. + (LIBATOMIC_PROFILE): Define. + (lang_specific_driver): Add LIBATOMIC[_PROFILE] option. + 2012-11-29 Ian Lance Taylor * go-gcc.cc: Include "output.h". diff --git a/gcc/go/gospec.c b/gcc/go/gospec.c index 20372f0f4706..c22ad6c7c973 100644 --- a/gcc/go/gospec.c +++ b/gcc/go/gospec.c @@ -45,6 +45,9 @@ along with GCC; see the file COPYING3. If not see #define THREAD_LIBRARY "pthread" #define THREAD_LIBRARY_PROFILE THREAD_LIBRARY +#define LIBATOMIC "atomic" +#define LIBATOMIC_PROFILE LIBATOMIC + #define LIBGO "go" #define LIBGO_PROFILE LIBGO #define LIBGOBEGIN "gobegin" @@ -336,6 +339,11 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, added_libraries++; j++; + generate_option (OPT_l, saw_profile_flag ? LIBATOMIC_PROFILE : LIBATOMIC, + 1, CL_DRIVER, &new_decoded_options[j]); + added_libraries++; + j++; + #ifdef HAVE_LD_STATIC_DYNAMIC if (library > 1 && !static_link) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5a49c619c8b4..7bc7788c115e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-12-18 Andreas Schwab + + * lib/go.exp (go_link_flags): Add libatomic location to flags and + ld_library_path. + 2012-12-18 Richard Biener * gcc.dg/tree-ssa/reassoc-19.c: Adjust. diff --git a/gcc/testsuite/lib/go.exp b/gcc/testsuite/lib/go.exp index 8c908a5ced1f..8eea9fa83634 100644 --- a/gcc/testsuite/lib/go.exp +++ b/gcc/testsuite/lib/go.exp @@ -111,6 +111,11 @@ proc go_link_flags { paths } { append flags "-L${gccpath}/libgo/.libs " append ld_library_path ":${gccpath}/libgo/.libs" } + if { [file exists "${gccpath}/libatomic/.libs/libatomic.a"] \ + || [file exists "${gccpath}/libatomic/.libs/libatomic.${shlib_ext}"] } { + append flags "-L${gccpath}/libatomic/.libs " + append ld_library_path ":${gccpath}/libatomic/.libs" + } if [file exists "${gccpath}/libiberty/libiberty.a"] { append flags "-L${gccpath}/libiberty " } diff --git a/libgo/Makefile.am b/libgo/Makefile.am index fe0f20585fc5..a7ac3791b149 100644 --- a/libgo/Makefile.am +++ b/libgo/Makefile.am @@ -1909,6 +1909,7 @@ libgo_la_LDFLAGS = \ libgo_la_LIBADD = \ $(libgo_go_objs) ../libbacktrace/libbacktrace.la \ + ../libatomic/libatomic.la \ $(LIBFFI) $(PTHREAD_LIBS) $(MATH_LIBS) $(NET_LIBS) libgobegin_a_SOURCES = \ @@ -1948,7 +1949,7 @@ GOTESTFLAGS = # Check a package. CHECK = \ - GC="$(GOC) $(GOCFLAGS) $($(subst /,_,$@)_GOCFLAGS) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs"; \ + GC="$(GOC) $(GOCFLAGS) $($(subst /,_,$@)_GOCFLAGS) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs -L `${PWD_COMMAND}`/../libatomic -L `${PWD_COMMAND}`/../libatomic/.libs"; \ export GC; \ GOLIBS="$(MATH_LIBS) $(NET_LIBS)"; \ export GOLIBS; \ @@ -1957,7 +1958,7 @@ CHECK = \ MAKE="$(MAKE)"; \ export MAKE; \ libgccdir=`${GOC} -print-libgcc-file-name | sed -e 's|/[^/]*$$||'`; \ - LD_LIBRARY_PATH="`${PWD_COMMAND}`/.libs:$${libgccdir}:${LD_LIBRARY_PATH}"; \ + LD_LIBRARY_PATH="`${PWD_COMMAND}`/.libs:`${PWD_COMMAND}`/../libatomic/.libs:$${libgccdir}:${LD_LIBRARY_PATH}"; \ LD_LIBRARY_PATH=`echo $${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \ export LD_LIBRARY_PATH; \ $(MKDIR_P) $(@D); \ diff --git a/libgo/Makefile.in b/libgo/Makefile.in index 9b8ea1a57e29..31e38ba25c7d 100644 --- a/libgo/Makefile.in +++ b/libgo/Makefile.in @@ -175,9 +175,9 @@ am__DEPENDENCIES_2 = bufio.lo bytes.lo bytes/index.lo crypto.lo \ testing/iotest.lo testing/quick.lo unicode/utf16.lo \ unicode/utf8.lo libgo_la_DEPENDENCIES = $(am__DEPENDENCIES_2) \ - ../libbacktrace/libbacktrace.la $(am__DEPENDENCIES_1) \ + ../libbacktrace/libbacktrace.la ../libatomic/libatomic.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) @LIBGO_IS_LINUX_FALSE@am__objects_1 = lock_sema.lo thread-sema.lo @LIBGO_IS_LINUX_TRUE@am__objects_1 = lock_futex.lo thread-linux.lo @HAVE_SYS_MMAN_H_FALSE@am__objects_2 = mem_posix_memalign.lo @@ -2037,6 +2037,7 @@ libgo_la_LDFLAGS = \ libgo_la_LIBADD = \ $(libgo_go_objs) ../libbacktrace/libbacktrace.la \ + ../libatomic/libatomic.la \ $(LIBFFI) $(PTHREAD_LIBS) $(MATH_LIBS) $(NET_LIBS) libgobegin_a_SOURCES = \ @@ -2071,7 +2072,7 @@ GOTESTFLAGS = # Check a package. CHECK = \ - GC="$(GOC) $(GOCFLAGS) $($(subst /,_,$@)_GOCFLAGS) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs"; \ + GC="$(GOC) $(GOCFLAGS) $($(subst /,_,$@)_GOCFLAGS) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs -L `${PWD_COMMAND}`/../libatomic -L `${PWD_COMMAND}`/../libatomic/.libs"; \ export GC; \ GOLIBS="$(MATH_LIBS) $(NET_LIBS)"; \ export GOLIBS; \ @@ -2080,7 +2081,7 @@ CHECK = \ MAKE="$(MAKE)"; \ export MAKE; \ libgccdir=`${GOC} -print-libgcc-file-name | sed -e 's|/[^/]*$$||'`; \ - LD_LIBRARY_PATH="`${PWD_COMMAND}`/.libs:$${libgccdir}:${LD_LIBRARY_PATH}"; \ + LD_LIBRARY_PATH="`${PWD_COMMAND}`/.libs:`${PWD_COMMAND}`/../libatomic/.libs:$${libgccdir}:${LD_LIBRARY_PATH}"; \ LD_LIBRARY_PATH=`echo $${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \ export LD_LIBRARY_PATH; \ $(MKDIR_P) $(@D); \