Source: bost1.92
Version: 1.92.0-4+b1
Severity: normal
Tags: patch upstream
X-Debbugs-Cc: [email protected]
User: [email protected]
Usertags: sparc64

Hello,

the nix package manager is currently failing to build from source on sparc64 
[1]:

FAILED: [code=1] src/nswrapper/nix-nswrapper 
c++  -o src/nswrapper/nix-nswrapper 
src/nswrapper/nix-nswrapper.p/nswrapper.cc.o src/nswrapper/ \
nix-nswrapper.p/nix-meson-build-support_common_assert-fail_wrap-assert-fail.cc.o
 -Wl,--as-needed \
-Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -g -O2 
-ffile-prefix-map=/build/reproducible-path/nix-2.35.4+dfsg=. \
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time 
-D_FORTIFY_SOURCE=2 \
-Wl,--start-group src/libutil/libnixutil.a 
/usr/lib/sparc64-linux-gnu/libarchive.so -pthread -Wl,--wrap=__assert_fail \
/usr/lib/sparc64-linux-gnu/libblake3.so /usr/lib/sparc64-linux-gnu/libcrypto.so 
/usr/lib/sparc64-linux-gnu/libsodium.so \
/usr/lib/sparc64-linux-gnu/libbrotlicommon.so 
/usr/lib/sparc64-linux-gnu/libbrotlidec.so 
/usr/lib/sparc64-linux-gnu/libbrotlienc.so \
/usr/lib/sparc64-linux-gnu/libzstd.so 
/usr/lib/sparc64-linux-gnu/libboost_context.so.1.92.0 \
/usr/lib/sparc64-linux-gnu/libboost_coroutine.so.1.92.0 \
/usr/lib/sparc64-linux-gnu/libboost_iostreams.so.1.92.0 
/usr/lib/sparc64-linux-gnu/libboost_url.so.1.92.0 -Wl,--end-group 
-Wl,--wrap=__assert_fail
/usr/bin/sparc64-linux-gnu-ld.bfd: src/libutil/libnixutil.a(nixutil-prelink.o): 
in function `boost::context::fiber::~fiber()':
/usr/include/boost/context/fiber_fcontext.hpp:356:(.text+0x86474): undefined 
reference to\
`boost::context::detail::ontop_fcontext(void*, void*, 
boost::context::detail::transfer_t (*)(boost::context::detail::transfer_t))'
(...)
collect2: error: ld returned 1 exit status

It turns out that this linker issue is caused by incomplete architecture 
support for sparc64
in the boost context library [2]. The issue has been fixed upstream and the 
patch can be
trivially backported to older boost versions.

I am attaching a version of the patch for boost1.92. Please consider including 
in the next
upload of the boost1.92 package in Debian unstable!

Thanks,
Adrian

> [1] 
> https://buildd.debian.org/status/fetch.php?pkg=nix&arch=sparc64&ver=2.35.4%2Bdfsg-1&stamp=1793398862&raw=0
> [2] https://github.com/sparclinux/issues/issues/124
> [3] https://github.com/boostorg/context/pull/344

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
--- boost1.92-1.92.0.orig/libs/context/CMakeLists.txt
+++ boost1.92-1.92.0/libs/context/CMakeLists.txt
@@ -50,7 +50,7 @@ unset(_default_abi)
 
 ## Arch-and-model
 
-set(_all_archs arm arm64 e2k loongarch64 mips32 mips64 ppc32 ppc64 riscv64 
s390x i386 x86_64 combined)
+set(_all_archs arm arm64 e2k loongarch64 mips32 mips64 ppc32 ppc64 riscv64 
s390x i386 x86_64 sparc64 combined)
 
 # Try at start to auto determine arch from CMake.
 if(CMAKE_SYSTEM_PROCESSOR IN_LIST _all_archs)
@@ -80,7 +80,7 @@ else()
   endif()
 endif()
 
-set(BOOST_CONTEXT_ARCHITECTURE "${_default_arch}" CACHE STRING "Boost.Context 
architecture (arm, arm64, e2k, loongarch64, mips32, mips64, ppc32, ppc64, 
riscv64, s390x, i386, x86_64, combined)")
+set(BOOST_CONTEXT_ARCHITECTURE "${_default_arch}" CACHE STRING "Boost.Context 
architecture (arm, arm64, e2k, loongarch64, mips32, mips64, ppc32, ppc64, 
riscv64, s390x, i386, x86_64, sparc64, combined)")
 set_property(CACHE BOOST_CONTEXT_ARCHITECTURE PROPERTY STRINGS ${_all_archs})
 
 unset(_all_archs)

Reply via email to