This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[trans-mem] [PATCH] Fix a problem to compile libitm with hardware support for the 64-bit atomic builtins
- From: Shujing Zhao <pearly dot zhao at oracle dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: rth at redhat dot com, Paolo Carlini <paolo dot carlini at oracle dot com>
- Date: Fri, 18 Sep 2009 17:50:28 +0800
- Subject: [trans-mem] [PATCH] Fix a problem to compile libitm with hardware support for the 64-bit atomic builtins
Hi,
When I test libitm on my i686-pc-linux-gnu, all the three testsuites
clone1.c simple-1.c simple-2.c are failed. The fails are caused by a
same error:
//BUILDDIR/i686-pc-linux-gnu./libitm/.libs/libitm.so: undefined
reference to `__sync_add_and_fetch_8'/
/collect2: ld returned 1 exit status/
Apparently libitm need refer to /__sync_add_and_fetch_8, /a 64-bit
atomic operand. libitm is built with -march=i486 at i[456]86-*-linux. If
libitm need atomics only for 32-bit data, i486 is enough. But maybe for
some reason, libitm need 64-bit _8 version.
But does libitm use 64-bit atomic at 32-bit environment by design? If it
is really the case, then i586 is needed.
This patches is tested on i686-pc-linux-gnu.
Thanks
Pearly
Index: ChangeLog
===================================================================
--- ChangeLog (revision 151837)
+++ ChangeLog (working copy)
@@ -1,3 +1,7 @@
+2009-09-18 Shujing Zhao <pearly.zhao@oracle.com>
+
+ * configure.tgt: Use -march=i586 for i[456]86-*-linux.
+
2009-08-03 Richard Henderson <rth@redhat.com>
* libitm.map (_ITM_commitTransactionEH, _ITM_cxa_allocate_exception,
Index: configure.tgt
===================================================================
--- configure.tgt (revision 151790)
+++ configure.tgt (working copy)
@@ -61,7 +61,8 @@ if test $enable_linux_futex = yes; then
;;
*)
if test -z "$with_arch"; then
- XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
+ # Since libitm requires synchronization builtins _8 version, i586 is needed.
+ XCFLAGS="${XCFLAGS} -march=i586 -mtune=${target_cpu}"
fi
esac
;;