- Replace mfence instruction with xchg to make it run on ia32-class

machines without SSE2.
- Resolves: #600654
This commit is contained in:
Petr Machata 2010-06-10 16:03:20 +00:00
parent a33e0baa33
commit 43fea0cf58
2 changed files with 28 additions and 1 deletions

20
tbb-2.2-mfence.patch Normal file
View File

@ -0,0 +1,20 @@
diff -up /home/petr/fedora/tbb/devel/tbb22_20090809oss-pm/include/tbb/machine/linux_ia32.h\~ /home/petr/fedora/tbb/devel/tbb22_20090809oss-pm/include/tbb/machine/linux_ia32.h
--- tbb22_20090809oss-pm/include/tbb/machine/linux_ia32.h~ 2009-08-12 09:05:03.000000000 +0200
+++ tbb22_20090809oss-pm/include/tbb/machine/linux_ia32.h 2010-06-10 17:11:17.000000000 +0200
@@ -39,7 +39,13 @@
#define __TBB_release_consistency_helper() __asm__ __volatile__("": : :"memory")
-inline void __TBB_rel_acq_fence() { __asm__ __volatile__("mfence": : :"memory"); }
+inline void __TBB_rel_acq_fence() {
+ int tmp;
+ __asm__ __volatile__("xchg %0,%0"
+ : "=r"(tmp)
+ : "r"(tmp)
+ : "memory");
+}
#define __MACHINE_DECL_ATOMICS(S,T,X) \
static inline T __TBB_machine_cmpswp##S (volatile void *ptr, T value, T comparand ) \
Diff finished. Thu Jun 10 17:13:43 2010

View File

@ -11,7 +11,7 @@
Summary: The Threading Building Blocks library abstracts low-level threading details
Name: tbb
Version: %{major}.%{minor}
Release: 1.%{releasedate}%{?dist}
Release: 2.%{releasedate}%{?dist}
License: GPLv2 with exceptions
Group: Development/Tools
URL: http://threadingbuildingblocks.org/
@ -26,6 +26,7 @@ Source2: %{source_2}
Source3: %{source_3}
Source4: %{source_4}
Patch1: tbb-2.2-20090809-cxxflags.patch
Patch2: tbb-2.2-mfence.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libstdc++-devel
# We need "arch" and "hostname" binaries:
@ -66,6 +67,7 @@ C++ library.
%prep
%setup -q -n %{sourcebasename}
%patch1 -p1
%patch2 -p1
%build
make %{?_smp_mflags} CXXFLAGS="$RPM_OPT_FLAGS" tbb_build_prefix=obj
@ -115,6 +117,11 @@ rm -rf ${RPM_BUILD_ROOT}
%doc %{source_4}
%changelog
* Thu Jun 10 2010 Petr Machata <pmachata@redhat.com> - 2.2-2.20090809
- Replace mfence instruction with xchg to make it run on ia32-class
machines without SSE2.
- Resolves: #600654
* Tue Nov 3 2009 Petr Machata <pmachata@redhat.com> - 2.2-1.20090809
- New upstream 2.2
- Resolves: #521571