Rebase to 4.4u2.

Also:
- Fix the mfence patch to actually emit a memory barrier (bz 1288314).
- Build an sse2 version for i386 for better performance on capable CPUs.
- Enable use of C++0x features.
- Drop out-of-date CHANGES.txt from git.
This commit is contained in:
Jerry James 2016-01-15 15:15:44 -07:00
parent 72fa33663f
commit 6de60177fd
8 changed files with 90 additions and 1292 deletions

1
.gitignore vendored
View File

@ -11,3 +11,4 @@ tbb*/
/tbb41_20130314oss_src.tgz
.*.log
/tbb43_20141204oss_src.tgz
/tbb44_20151115oss_src.tgz

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
e903dd92d9433701f097fa7ca29a3c1f tbb43_20141204oss_src.tgz
7fae6a6bbca68bbdc18e844d6721d5e4 tbb44_20151115oss_src.tgz

View File

@ -1,18 +0,0 @@
diff -up tbb30_20110419oss/build/linux.gcc.inc\~ tbb30_20110419oss/build/linux.gcc.inc
--- tbb30_20110419oss/build/linux.gcc.inc~ 2011-04-19 13:48:58.000000000 +0200
+++ tbb30_20110419oss/build/linux.gcc.inc 2011-07-26 14:02:48.482006056 +0200
@@ -59,10 +59,10 @@ ifneq (,$(shell gcc -dumpversion | egrep
endif
ifeq ($(cfg), release)
- CPLUS_FLAGS = $(ITT_NOTIFY) -g -O2 -DUSE_PTHREAD
+ CPLUS_FLAGS = $(CXXFLAGS) $(ITT_NOTIFY) -g -O2 -DUSE_PTHREAD
endif
ifeq ($(cfg), debug)
- CPLUS_FLAGS = -DTBB_USE_DEBUG $(ITT_NOTIFY) -g -O0 -DUSE_PTHREAD
+ CPLUS_FLAGS = $(CXXFLAGS) -DTBB_USE_DEBUG $(ITT_NOTIFY) -g -O0 -DUSE_PTHREAD
endif
ifneq (00,$(lambdas)$(cpp0x))
Diff finished. Tue Feb 26 13:00:13 2013

View File

@ -1,21 +1,14 @@
diff -up tbb40_20110809oss/include/tbb/machine/linux_ia32.h\~ tbb40_20110809oss/include/tbb/machine/linux_ia32.h
--- tbb40_20110809oss/include/tbb/machine/linux_ia32.h~ 2011-08-24 15:51:56.000000000 +0200
+++ tbb40_20110809oss/include/tbb/machine/linux_ia32.h 2011-10-18 15:04:01.994271994 +0200
@@ -42,7 +42,14 @@
diff -up tbb44_20151115oss/include/tbb/machine/linux_ia32.h\~ tbb44_20151115oss/include/tbb/machine/linux_ia32.h
--- tbb44_20151115oss/include/tbb/machine/linux_ia32.h~ 2015-11-25 03:49:14.000000000 -0700
+++ tbb44_20151115oss/include/tbb/machine/linux_ia32.h 2016-01-14 20:29:45.251333321 -0700
@@ -34,7 +34,7 @@
#define __TBB_control_consistency_helper() __TBB_compiler_fence()
#define __TBB_acquire_consistency_helper() __TBB_compiler_fence()
#define __TBB_release_consistency_helper() __TBB_compiler_fence()
-#define __TBB_full_memory_fence() __asm__ __volatile__("mfence": : :"memory")
+#define __TBB_full_memory_fence() __TBB_full_memory_fence_imp()
+inline void __TBB_full_memory_fence_imp() {
+ int tmp;
+ __asm__ __volatile__("xchg %0,%0"
+ : "=r"(tmp)
+ : "r"(tmp)
+ : "memory");
+}
+#define __TBB_full_memory_fence() __sync_synchronize()
#if __TBB_ICC_ASM_VOLATILE_BROKEN
#define __TBB_VOLATILE
Diff finished. Tue Oct 18 15:04:09 2011
Diff finished. Thu Jan 14 20:30:12 2016

View File

@ -1,14 +1,14 @@
diff -up tbb43_20141204oss/build/Makefile.tbbmalloc\~ tbb43_20141204oss/build/Makefile.tbbmalloc
--- tbb43_20141204oss/build/Makefile.tbbmalloc~ 2014-12-12 12:56:34.000000000 +0100
+++ tbb43_20141204oss/build/Makefile.tbbmalloc 2015-01-19 09:52:44.419120714 +0100
diff -up tbb44_20151115oss/build/Makefile.tbbmalloc\~ tbb44_20151115oss/build/Makefile.tbbmalloc
--- tbb44_20151115oss/build/Makefile.tbbmalloc~ 2016-01-14 20:20:49.514774850 -0700
+++ tbb44_20151115oss/build/Makefile.tbbmalloc 2016-01-14 20:36:32.126342096 -0700
@@ -51,7 +51,7 @@ ORIG_LINK_MALLOC.LIB:=$(LINK_MALLOC.LIB)
MALLOC_CPLUS.OBJ = backend.$(OBJ) large_objects.$(OBJ) backref.$(OBJ) tbbmalloc.$(OBJ)
MALLOC.OBJ := $(MALLOC_CPLUS.OBJ) $(MALLOC_ASM.OBJ) itt_notify_malloc.$(OBJ) frontend.$(OBJ)
PROXY.OBJ := proxy.$(OBJ) tbb_function_replacement.$(OBJ)
-M_CPLUS_FLAGS := $(subst $(WARNING_KEY),,$(M_CPLUS_FLAGS)) $(DEFINE_KEY)__TBBMALLOC_BUILD=1
+M_CPLUS_FLAGS := -fno-strict-aliasing $(DEFINE_KEY)__TBBMALLOC_BUILD=1
-M_CPLUS_FLAGS := $(subst $(WARNING_KEY),,$(M_CPLUS_FLAGS)) $(CXXFLAGS) $(DEFINE_KEY)__TBBMALLOC_BUILD=1
+M_CPLUS_FLAGS := $(CXXFLAGS) -fno-strict-aliasing $(DEFINE_KEY)__TBBMALLOC_BUILD=1
M_INCLUDES := $(INCLUDES) $(INCLUDE_KEY)$(MALLOC_ROOT) $(INCLUDE_KEY)$(MALLOC_SOURCE_ROOT)
# Suppress superfluous warnings for TBBMalloc compilation
Diff finished. Mon Jan 19 09:52:48 2015
Diff finished. Thu Jan 14 20:37:02 2016

30
tbb-4.4-cxxflags.patch Normal file
View File

@ -0,0 +1,30 @@
diff -up tbb44_20151115oss/build/linux.gcc.inc\~ tbb44_20151115oss/build/linux.gcc.inc
--- tbb44_20151115oss/build/linux.gcc.inc~ 2015-11-25 03:48:43.000000000 -0700
+++ tbb44_20151115oss/build/linux.gcc.inc 2016-01-14 20:02:13.829449849 -0700
@@ -54,10 +54,10 @@ ifneq (,$(shell gcc -dumpversion | egrep
endif
ifeq ($(cfg), release)
- CPLUS_FLAGS = $(ITT_NOTIFY) -g -O2 -DUSE_PTHREAD
+ CPLUS_FLAGS = $(CXXFLAGS) $(ITT_NOTIFY) -g -O2 -DUSE_PTHREAD
endif
ifeq ($(cfg), debug)
- CPLUS_FLAGS = -DTBB_USE_DEBUG $(ITT_NOTIFY) -g -O0 -DUSE_PTHREAD
+ CPLUS_FLAGS = $(CXXFLAGS) -DTBB_USE_DEBUG $(ITT_NOTIFY) -g -O0 -DUSE_PTHREAD
endif
ifneq (00,$(lambdas)$(cpp0x))
diff -up tbb44_20151115oss/build/Makefile.tbbmalloc\~ tbb44_20151115oss/build/Makefile.tbbmalloc
--- tbb44_20151115oss/build/Makefile.tbbmalloc~ 2015-11-25 03:48:44.000000000 -0700
+++ tbb44_20151115oss/build/Makefile.tbbmalloc 2016-01-14 20:20:49.514774850 -0700
@@ -51,7 +51,7 @@ ORIG_LINK_MALLOC.LIB:=$(LINK_MALLOC.LIB)
MALLOC_CPLUS.OBJ = backend.$(OBJ) large_objects.$(OBJ) backref.$(OBJ) tbbmalloc.$(OBJ)
MALLOC.OBJ := $(MALLOC_CPLUS.OBJ) $(MALLOC_ASM.OBJ) itt_notify_malloc.$(OBJ) frontend.$(OBJ)
PROXY.OBJ := proxy.$(OBJ) tbb_function_replacement.$(OBJ)
-M_CPLUS_FLAGS := $(subst $(WARNING_KEY),,$(M_CPLUS_FLAGS)) $(DEFINE_KEY)__TBBMALLOC_BUILD=1
+M_CPLUS_FLAGS := $(subst $(WARNING_KEY),,$(M_CPLUS_FLAGS)) $(CXXFLAGS) $(DEFINE_KEY)__TBBMALLOC_BUILD=1
M_INCLUDES := $(INCLUDES) $(INCLUDE_KEY)$(MALLOC_ROOT) $(INCLUDE_KEY)$(MALLOC_SOURCE_ROOT)
# Suppress superfluous warnings for TBBMalloc compilation
Diff finished. Thu Jan 14 20:22:27 2016

View File

@ -1,6 +1,6 @@
%define releasedate 20141204
%define releasedate 20151115
%define major 4
%define minor 3
%define minor 4
%define update 2
%define dotver %{major}.%{minor}
%define sourcebasename tbb%{major}%{minor}_%{releasedate}oss
@ -10,7 +10,7 @@
Name: tbb
Summary: The Threading Building Blocks library abstracts low-level threading details
Version: %{dotver}
Release: 3.%{releasedate}%{?dist}
Release: 1.%{releasedate}%{?dist}
License: GPLv2 with exceptions
Group: Development/Tools
URL: http://threadingbuildingblocks.org/
@ -22,12 +22,13 @@ Source7: tbbmalloc.pc
Source8: tbbmalloc_proxy.pc
# Propagate CXXFLAGS variable into flags used when compiling C++.
# This so that RPM_OPT_FLAGS are respected.
Patch1: tbb-3.0-cxxflags.patch
# This is so that RPM_OPT_FLAGS are respected.
Patch1: tbb-4.4-cxxflags.patch
# Replace mfence with xchg (for 32-bit builds only) so that TBB
# compiles and works supported hardware. mfence was added with SSE2,
# which we still don't assume.
# For 32-bit x86 only, don't assume that the mfence instruction is available.
# It was added with SSE2. This patch causes a lock xchg instruction to be
# emitted for non-SSE2 builds, and the mfence instruction to be emitted for
# SSE2-enabled builds.
Patch2: tbb-4.0-mfence.patch
# Don't snip -Wall from C++ flags. Add -fno-strict-aliasing, as that
@ -62,6 +63,7 @@ Blocks (TBB) C++ libraries.
%package doc
Summary: The Threading Building Blocks documentation
Group: Documentation
Provides: bundled(jquery)
%description doc
PDF documentation for the user of the Threading Building Block (TBB)
@ -74,22 +76,44 @@ C++ library.
%patch2 -p1
%patch3 -p1
# For repeatable builds, don't query the hostname
sed -i 's/`hostname -s`/fedorabuild/' build/version_info_linux.sh
%build
make %{?_smp_mflags} CXXFLAGS="$RPM_OPT_FLAGS" tbb_build_prefix=obj
%ifarch %{ix86}
# Build an SSE2-enabled version so the mfence instruction can be used
cp -a build build.orig
make %{?_smp_mflags} CXXFLAGS="$RPM_OPT_FLAGS -march=pentium4 -msse2" \
tbb_build_prefix=obj cpp0x=1
mv build build.sse2
mv build.orig build
%endif
make %{?_smp_mflags} CXXFLAGS="$RPM_OPT_FLAGS" tbb_build_prefix=obj cpp0x=1
for file in %{SOURCE6} %{SOURCE7} %{SOURCE8}; do
sed 's/_FEDORA_VERSION/%{major}.%{minor}.%{update}/' ${file} \
> $(basename ${file})
base=$(basename ${file})
sed 's/_FEDORA_VERSION/%{major}.%{minor}.%{update}/' ${file} > ${base}
touch -r ${file} ${base}
done
%check
%ifarch ppc64le
make test
make test CXXFLAGS="$RPM_OPT_FLAGS" cpp0x=1
%endif
%install
mkdir -p $RPM_BUILD_ROOT/%{_libdir}
mkdir -p $RPM_BUILD_ROOT/%{_includedir}
%ifarch %{ix86}
mkdir -p $RPM_BUILD_ROOT/%{_libdir}/sse2
pushd build.sse2/obj_release
for file in libtbb{,malloc{,_proxy}}; do
install -p -D -m 755 ${file}.so.2 $RPM_BUILD_ROOT/%{_libdir}/sse2
done
popd
%endif
pushd build/obj_release
for file in libtbb{,malloc{,_proxy}}; do
install -p -D -m 755 ${file}.so.2 $RPM_BUILD_ROOT/%{_libdir}
@ -115,6 +139,9 @@ done
%files
%doc COPYING doc/Release_Notes.txt
%{_libdir}/*.so.2
%ifarch %{ix86}
%{_libdir}/sse2/*.so.2
%endif
%files devel
%doc CHANGES
@ -127,6 +154,13 @@ done
%doc doc/html
%changelog
* Fri Jan 15 2016 Jerry James <loganjerry@gmail.com> - 4.4-1.20151115
- Rebase to 4.4u2
- Fix the mfence patch to actually emit a memory barrier (bz 1288314)
- Build an sse2 version for i386 for better performance on capable CPUs
- Enable use of C++0x features
- Drop out-of-date CHANGES.txt from git
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.3-3.20141204
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild