Source: librandomx
Version: 1.1.7-3
Severity: important
Tags: ftbfs patch

https://buildd.debian.org/status/package.php?p=librandomx&suite=sid

...
/usr/bin/c++  -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. 
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time 
-D_FORTIFY_SOURCE=2  -Wl,-z,relro -rdynamic 
CMakeFiles/randomx-benchmark.dir/src/tests/benchmark.cpp.o 
CMakeFiles/randomx-benchmark.dir/src/tests/affinity.cpp.o  -o randomx-benchmark 
 -Wl,-rpath,/<<PKGBUILDDIR>>/obj-arm-linux-gnueabi librandomx.so.0.0.0 -pthread 
/usr/bin/ld: CMakeFiles/randomx-benchmark.dir/src/tests/benchmark.cpp.o: in 
function `std::__atomic_base<unsigned long long>::fetch_xor(unsigned long long, 
std::memory_order)':
/usr/include/c++/9/bits/atomic_base.h:581: undefined reference to 
`__atomic_fetch_xor_8'
/usr/bin/ld: CMakeFiles/randomx-benchmark.dir/src/tests/benchmark.cpp.o: in 
function `std::__atomic_base<unsigned long long>::store(unsigned long long, 
std::memory_order)':
/usr/include/c++/9/bits/atomic_base.h:397: undefined reference to 
`__atomic_store_8'
/usr/bin/ld: CMakeFiles/randomx-benchmark.dir/src/tests/benchmark.cpp.o: in 
function `std::__atomic_base<unsigned long long>::load(std::memory_order) 
const':
/usr/include/c++/9/bits/atomic_base.h:419: undefined reference to 
`__atomic_load_8'
collect2: error: ld returned 1 exit status
make[3]: *** [CMakeFiles/randomx-benchmark.dir/build.make:103: 
randomx-benchmark] Error 1


Fix/Workaround:

--- debian/rules.old    2020-05-17 09:50:19.047240718 +0000
+++ debian/rules        2020-05-18 06:09:31.089419313 +0000
@@ -11,6 +11,10 @@
 # avoid executable stack in assembly code
 export DEB_CFLAGS_MAINT_APPEND = -Wa,--noexecstack
 
+ifneq (,$(filter $(DEB_HOST_ARCH), armel mipsel powerpc))
+  export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-as-needed -latomic -Wl,--as-needed
+endif
+
 # Let d-shlibs calculate development package dependencies
 #  and handle shared library install
 override_dh_install: $(DOCS)

Reply via email to