[boost] Fix build of Boost.Context on ppc64, future-proof the linker script
Petr Machata
pmachata at fedoraproject.org
Mon Feb 11 19:30:46 UTC 2013
commit 91de02f8dbaac9f7118d5897d1edf88f57845993
Author: Petr Machata <pmachata at redhat.com>
Date: Mon Feb 11 20:06:45 2013 +0100
Fix build of Boost.Context on ppc64, future-proof the linker script
boost-1.53.0-context.patch | 38 ++++++++++++++++++++++++++++++++++++++
boost.spec | 13 +++++++++++--
libboost_thread-mt.so | 4 ++--
3 files changed, 51 insertions(+), 4 deletions(-)
---
diff --git a/boost-1.53.0-context.patch b/boost-1.53.0-context.patch
new file mode 100644
index 0000000..c7ba24c
--- /dev/null
+++ b/boost-1.53.0-context.patch
@@ -0,0 +1,38 @@
+diff -up boost_1_53_0/libs/context/src/asm/make_ppc64_sysv_elf_gas.S\~ boost_1_53_0/libs/context/src/asm/make_ppc64_sysv_elf_gas.S
+--- boost_1_53_0/libs/context/src/asm/make_ppc64_sysv_elf_gas.S~ 2012-11-30 08:38:52.000000000 +0100
++++ boost_1_53_0/libs/context/src/asm/make_ppc64_sysv_elf_gas.S 2013-02-11 19:14:45.179845740 +0100
+@@ -89,7 +89,7 @@ make_fcontext:
+ .quad .make_fcontext,.TOC. at tocbase,0
+ .previous
+ .size make_fcontext,24
+-.type .make_fcontext, at function
++.type make_fcontext, at function
+ .globl .make_fcontext
+ .make_fcontext:
+ mflr %r6 # save return address into R6
+@@ -99,13 +99,13 @@ make_fcontext:
+
+ # call align_stack, R3 contains address at 16 byte boundary after return
+ # == pointer to fcontext_t and address of context stack
+- rlwinm %r3, %r3, 0, 0, 59
++ rldicr %r3, %r3, 0, 59
+
+ std %r0, 184(%r3) # save address of context stack (base) in fcontext_t
+ std %r4, 192(%r3) # save context stack size in fcontext_t
+ std %r5, 176(%r3) # save address of context function in fcontext_t
+
+- subf %r0, %r3, 64 # 64 bytes on stack for parameter area (== 8 registers)
++ addi %r0, %r3, -64 # 64 bytes on stack for parameter area (== 8 registers)
+ std %r0, 152(%r3) # save the stack base
+
+ mflr %r0 # load LR
+@@ -128,5 +128,6 @@ finish:
+ stwu %r1, -32(%r1) # allocate stack space, SP % 16 == 0
+
+ li %r3, 0 # set return value to zero
+- bl _exit at plt # exit application
++ bl _exit # exit application
++ nop # padding for R_PPC64_REL24
+ .size .make_fcontext, .-.make_fcontext
+
+Diff finished. Mon Feb 11 19:15:05 2013
diff --git a/boost.spec b/boost.spec
index d9180e4..55cb58f 100644
--- a/boost.spec
+++ b/boost.spec
@@ -25,7 +25,7 @@ Name: boost
Summary: The free peer-reviewed portable C++ source libraries
Version: 1.53.0
%define version_enc 1_53_0
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Boost and MIT and Python
%define toplev_dirname %{name}_%{version_enc}
@@ -101,6 +101,9 @@ Patch10: boost-1.50.0-long-double-1.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=828857
Patch15: boost-1.50.0-pool.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=909888
+Patch16: boost-1.53.0-context.patch
+
%bcond_with tests
%bcond_with docs_generated
@@ -496,6 +499,7 @@ a number of significant features and is now developed independently
%patch9 -p1
%patch10 -p1
%patch15 -p0
+%patch16 -p1
# At least python2_version needs to be a macro so that it's visible in
# %%install as well.
@@ -522,6 +526,7 @@ 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
@@ -640,7 +645,7 @@ echo ============================= install serial ==================
# itself for details of why we need to do this.
[ -f $RPM_BUILD_ROOT%{_libdir}/libboost_thread-mt.so ] # Must be present
rm -f $RPM_BUILD_ROOT%{_libdir}/libboost_thread-mt.so
-install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_libdir}/
+install -p -m 644 $(basename %{SOURCE2}) $RPM_BUILD_ROOT%{_libdir}/
echo ============================= install Boost.Build ==================
(cd tools/build/v2
@@ -1011,6 +1016,10 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/bjam.1*
%changelog
+* Mon Feb 11 2013 Petr Machata <pmachata at redhat.com> - 1.53.0-3
+- Fix Boost.Context on ppc64
+- Future-proof the linker script boost_thread-mt.so
+
* Sun Feb 10 2013 Denis Arnaud <denis.arnaud_fedora at m4x.org> - 1.53.0-2
- Fixed the libboost_thread-mt.so script (which wrongly referred to Boost-1.50)
diff --git a/libboost_thread-mt.so b/libboost_thread-mt.so
index 832b2e4..cb4f809 100644
--- a/libboost_thread-mt.so
+++ b/libboost_thread-mt.so
@@ -8,5 +8,5 @@
transitive one. Hence this linker script, which brings in the
Boost.System DSO. */
-INPUT(libboost_thread-mt.so.1.53.0)
-INPUT(libboost_system-mt.so.1.53.0)
+INPUT(libboost_thread-mt.so.%{version})
+INPUT(libboost_system-mt.so.%{version})
More information about the scm-commits
mailing list