[boost] Add libboost_atomic.so.* to the libboost_thread.so linker script

Petr Machata pmachata at fedoraproject.org
Thu Nov 28 17:10:35 UTC 2013


commit 94c7ec494decb6915edd5821496d9ba2fd7fbed0
Author: Petr Machata <pmachata at redhat.com>
Date:   Wed Nov 27 17:10:53 2013 +0100

    Add libboost_atomic.so.* to the libboost_thread.so linker script

 boost.spec         |   24 +++++++++++++++++++-----
 libboost_thread.so |    9 +++++++++
 2 files changed, 28 insertions(+), 5 deletions(-)
---
diff --git a/boost.spec b/boost.spec
index b67a05d..1e73540 100644
--- a/boost.spec
+++ b/boost.spec
@@ -36,7 +36,7 @@ Name: boost
 Summary: The free peer-reviewed portable C++ source libraries
 Version: 1.54.0
 %define version_enc 1_54_0
-Release: 5%{?dist}
+Release: 6%{?dist}
 License: Boost and MIT and Python
 
 %define toplev_dirname %{name}_%{version_enc}
@@ -716,7 +716,6 @@ using python : %{python3_version} : /usr/bin/python3 : /usr/include/python%{pyth
 EOF
 
 ./bootstrap.sh --with-toolset=gcc --with-icu
-sed 's/%%{version}/%{version}/g' %{SOURCE2} > $(basename %{SOURCE2})
 
 # N.B. When we build the following with PCH, parts of boost (math
 # library in particular) end up being built second time during
@@ -739,6 +738,17 @@ echo ============================= build serial ==================
 	variant=release threading=multi debug-symbols=on pch=off \
 	python=%{python2_version} stage
 
+# See boost-1.54.0-thread-link_atomic.patch for where this file comes
+# from.
+if [ -e serial/boost/bin.v2/libs/thread/build/gcc-4.6.3/debug/threading-multi/has_atomic_flag_lockfree ]; then
+	DEF=D
+else
+	DEF=U
+fi
+
+sed 's/%%{version}/%{version}/g' %{SOURCE2} |
+	cpp -C -P -${DEF}HAS_ATOMIC_FLAG_LOCKFREE > $(basename %{SOURCE2})
+
 # Build MPI parts of Boost with OpenMPI support
 
 %if %{with openmpi} || %{with mpich}
@@ -870,11 +880,11 @@ find libs doc more -type f -regex $DOCREGEX \
     | sort -u > tmp-doc-directories
 
 sed "s:^:$DOCPATH/:" tmp-doc-directories \
-    | xargs --no-run-if-empty %{__install} -d
+    | xargs -P 0 --no-run-if-empty %{__install} -d
 
 cat tmp-doc-directories | while read tobeinstalleddocdir; do
     find $tobeinstalleddocdir -mindepth 1 -maxdepth 1 -regex $DOCREGEX \
-    | xargs %{__install} -p -m 644 -t $DOCPATH/$tobeinstalleddocdir
+    | xargs -P 0 %{__install} -p -m 644 -t $DOCPATH/$tobeinstalleddocdir
 done
 rm -f tmp-doc-directories
 %{__install} -p -m 644 -t $DOCPATH LICENSE_1_0.txt index.htm index.html boost.png rst.css boost.css
@@ -901,7 +911,7 @@ find libs -type d -name example -exec find {} -type f \; \
     | sed -n '/\//{s,/[^/]*$,,;p}' \
     | sort -u > tmp-doc-directories
 sed "s:^:$EXAMPLESPATH/:" tmp-doc-directories \
-    | xargs --no-run-if-empty %{__install} -d
+    | xargs -P 0 --no-run-if-empty %{__install} -d
 rm -f tmp-doc-files-to-be-installed && touch tmp-doc-files-to-be-installed
 cat tmp-doc-directories | while read tobeinstalleddocdir
 do
@@ -1267,6 +1277,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/bjam.1*
 
 %changelog
+* Wed Nov 27 2013 Petr Machata <pmachata at redhat.com> - 1.54.0-6
+- Add libboost_atomic.so.* to the libboost_thread.so linker script on
+  architectures that need it.
+
 * Thu Aug 29 2013 Petr Machata <pmachata at redhat.com> - 1.54.0-5
 - Fix atomic_cas32 (thanks Jaroslav Škarvada for figuring out where
   the problem is) (boost-1.54.0-interprocess-atomic_cas32-ppc.patch)
diff --git a/libboost_thread.so b/libboost_thread.so
index a5280de..606a415 100644
--- a/libboost_thread.so
+++ b/libboost_thread.so
@@ -10,3 +10,12 @@
 
 INPUT(libboost_thread.so.%{version})
 INPUT(libboost_system.so.%{version})
+
+#ifndef HAS_ATOMIC_FLAG_LOCKFREE
+
+/* If the given architecture doesn't have lock-free implementation of
+   boost::atomic_flag, the dependency on Boost.Atomic may leak from
+   the header files to client binaries.  */
+
+INPUT(libboost_atomic.so.%{version})
+#endif


More information about the scm-commits mailing list