]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc.c (LINK_COMMAND_SPEC): Deal with -fgnu-tm.
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 13 Feb 2012 21:46:38 +0000 (21:46 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 13 Feb 2012 21:46:38 +0000 (21:46 +0000)
gcc/
* gcc.c (LINK_COMMAND_SPEC): Deal with -fgnu-tm.
(GTM_SELF_SPECS): Define if not already defined.
(driver_self_specs): Add GTM_SELF_SPECS.
* config/darwin.h (LINK_COMMAND_SPEC_A): Deal with -fgnu-tm.
(GTM_SELF_SPECS): Define.
* config/i386/cygwin.h (GTM_SELF_SPECS): Likewise.
* config/i386/mingw32.h (GTM_SELF_SPECS): Likewise.
libitm/
* configure.ac (link_itm): Fix comment.
* configure: Regenerate.
* testsuite/lib/libitm.exp: Do not pass -litm for the link.

From-SVN: r184174

gcc/ChangeLog
gcc/config/darwin.h
gcc/config/i386/cygwin.h
gcc/config/i386/mingw32.h
gcc/gcc.c
libitm/ChangeLog
libitm/configure
libitm/configure.ac
libitm/testsuite/lib/libitm.exp

index 7a469e46648f140a3b05b8be9a64cbb5204ea130..22777f1610eeb9c4778fea0763c3752fde86c107 100644 (file)
@@ -1,3 +1,13 @@
+2012-02-13  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc.c (LINK_COMMAND_SPEC): Deal with -fgnu-tm.
+       (GTM_SELF_SPECS): Define if not already defined.
+       (driver_self_specs): Add GTM_SELF_SPECS.
+        * config/darwin.h (LINK_COMMAND_SPEC_A): Deal with -fgnu-tm.
+        (GTM_SELF_SPECS): Define.
+       * config/i386/cygwin.h (GTM_SELF_SPECS): Likewise.
+       * config/i386/mingw32.h (GTM_SELF_SPECS): Likewise.
+
 2012-02-13  Jakub Jelinek  <jakub@redhat.com>
 
        * cselib.c (expand_loc): Return sp, fp, hfp or cfa base reg right
index 70ac80c19aca96c825b7073c12a9352ae6c65a1e..24253320208113b9933bc1a400c098d03c8865a5 100644 (file)
@@ -183,6 +183,8 @@ extern GTY(()) int darwin_ms_struct;
     %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \
     %{fopenmp|ftree-parallelize-loops=*: \
       %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \
+    %{fgnu-tm: \
+      %{static|static-libgcc|static-libstdc++|static-libgfortran: libitm.a%s; : -litm } } \
     %{!nostdlib:%{!nodefaultlibs:\
       %(link_ssp) %(link_gcc_c_sequence)\
     }}\
@@ -915,6 +917,8 @@ void add_framework_path (char *);
 
 #undef GOMP_SELF_SPECS
 #define GOMP_SELF_SPECS ""
+#undef GTM_SELF_SPECS
+#define GTM_SELF_SPECS ""
 
 /* Darwin disables section anchors by default.  
    They should be enabled per arch where support exists in that arch.  */
index d84c5c3aed8c12e857966f0a443d115a9412814b..5cf7f9cf51d6e61f4a5093147b2d977c75197c25 100644 (file)
@@ -126,6 +126,8 @@ along with GCC; see the file COPYING3.  If not see
    and the -pthread flag is not recognized.  */
 #undef GOMP_SELF_SPECS
 #define GOMP_SELF_SPECS ""
+#undef GTM_SELF_SPECS
+#define GTM_SELF_SPECS ""
 
 /* This matches SHLIB_SONAME and SHLIB_SOVERSION in t-cygwin. */
 #if DWARF2_UNWIND_INFO
index 00dcca60bb044612855371a60eda63ae0da8b617..4fdef2664bd92d9daa0ba14183413698435aa6c1 100644 (file)
@@ -187,6 +187,8 @@ do {                                                         \
 #undef GOMP_SELF_SPECS
 #define GOMP_SELF_SPECS "%{fopenmp|ftree-parallelize-loops=*: " \
                        "-mthreads -pthread}"
+#undef GTM_SELF_SPECS
+#define GTM_SELF_SPECS "%{fgnu-tm:-mthreads -pthread}"
 
 /* mingw32 atexit function is safe to use in shared libraries.  Use it
    to register C++ static destructors.  */
index 6f98fc9b9d66d991603fe29540c2fdb73f015f29..c7c8c053ba341f98b198b40d587bab81c6c582c2 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -675,6 +675,7 @@ proper position among the other output files.  */
     %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}}\
     %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\
     %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\
+    %{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
     %(mflib) " STACK_SPLIT_SPEC "\
     %{fprofile-arcs|fprofile-generate*|coverage:-lgcov}\
     %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
@@ -839,9 +840,14 @@ static const char *const multilib_defaults_raw[] = MULTILIB_DEFAULTS;
 #define GOMP_SELF_SPECS "%{fopenmp|ftree-parallelize-loops=*: -pthread}"
 #endif
 
+/* Likewise for -fgnu-tm.  */
+#ifndef GTM_SELF_SPECS
+#define GTM_SELF_SPECS "%{fgnu-tm: -pthread}"
+#endif
+
 static const char *const driver_self_specs[] = {
   "%{fdump-final-insns:-fdump-final-insns=.} %<fdump-final-insns",
-  DRIVER_SELF_SPECS, CONFIGURE_SPECS, GOMP_SELF_SPECS
+  DRIVER_SELF_SPECS, CONFIGURE_SPECS, GOMP_SELF_SPECS, GTM_SELF_SPECS
 };
 
 #ifndef OPTION_DEFAULT_SPECS
index 2bcb5ebaeb661a67e119710c335743924070ad59..9ce9ba71a9a2b117716b4f25d72d1590e7280743 100644 (file)
@@ -1,3 +1,9 @@
+2012-02-11  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * configure.ac (link_itm): Fix comment.
+       * configure: Regenerate.
+       * testsuite/lib/libitm.exp: Do not pass -litm for the link.
+
 2012-01-31  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        PR libitm/51822
index 5fc8703cd9c24d23b2fb5d7e7baa604cb2466fad..47c7b0cd484819a47d6ead8aeddd386f8fb66d06 100644 (file)
@@ -17463,7 +17463,7 @@ else
 fi
 
 # Set up the set of libraries that we need to link against for libitm.
-# Note that the GOMP_SELF_SPEC in gcc.c will force -pthread for -fopenmp,
+# Note that the GTM_SELF_SPECS in gcc.c will force -pthread for -fgnu-tm,
 # which will force linkage against -lpthread (or equivalent for the system).
 # That's not 100% ideal, but about the best we can do easily.
 if test $enable_shared = yes; then
index 7b54371fa8897ee8bbf78f4d9f1ce737f27337ac..2cce2b102f55bb5454acef70669086842717d861 100644 (file)
@@ -268,7 +268,7 @@ else
 fi
 
 # Set up the set of libraries that we need to link against for libitm.
-# Note that the GOMP_SELF_SPEC in gcc.c will force -pthread for -fopenmp,
+# Note that the GTM_SELF_SPECS in gcc.c will force -pthread for -fgnu-tm,
 # which will force linkage against -lpthread (or equivalent for the system).
 # That's not 100% ideal, but about the best we can do easily.
 if test $enable_shared = yes; then
index 74f7f80859a77606411458b50044f783ddfa0fd0..b2556d1409121e88c0b5af401e300b1d00075c79 100644 (file)
@@ -140,7 +140,6 @@ proc libitm_init { args } {
        lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs"
     }
     lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/.."
-    lappend ALWAYS_CFLAGS "ldflags=-litm"
 
     # We use atomic operations in the testcases to validate results.
     if { ([istarget i?86-*-*] || [istarget x86_64-*-*])