Bug#961284: nix: FTBFS on armel and mipsel

2020-05-23 Thread Adrian Bunk
Control: tags -1 ftbfs patch

On Fri, May 22, 2020 at 11:43:24PM +0800, Boyuan Yang wrote:
>...
> /usr/include/c++/9/bits/atomic_base.h:541: undefined reference to
> `__atomic_fetch_add_8'
> collect2: error: ld returned 1 exit status
> make[1]: *** [mk/lib.mk:104: src/libutil/libnixutil.so] Error 1
>...

Fix/workaround:

--- debian/rules.old2020-05-23 18:01:16.777117658 +
+++ debian/rules2020-05-23 18:01:40.436904447 +
@@ -16,6 +16,10 @@
 # package maintainers to append LDFLAGS
 #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
 
+ifneq (,$(filter $(DEB_HOST_ARCH), armel mipsel powerpc))
+  export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-as-needed -latomic -Wl,--as-needed
+endif
+
 export EDITLINE_CFLAGS = "-DREADLINE"
 export EDITLINE_LIBS   = "/usr/lib/$(DEB_HOST_MULTIARCH)/libhistory.so 
/usr/lib/$(DEB_HOST_MULTIARCH)/libreadline.so"
 export V=1



Bug#961284: nix: FTBFS on armel and mipsel

2020-05-22 Thread Boyuan Yang
Source: nix
Version: 2.3.4+dfsg3-1
Severity: normal
X-Debbugs-CC: t...@debian.org

Dear Debian nix package maintainer,

Congratulations on getting nix into Debian!

As you can see from the buildd log, the package currently FTBFS on
armel and mipsel: https://buildd.debian.org/status/package.php?p=nix

===
g++ -std=c++17 -o /<>/src/libutil/libnixutil.so -shared
-L/usr/lib/arm-linux-gnueabi -Wl,-z,relro -Wl,-z,now -L/usr/lib/arm-
linux-gnueabi -Wl,-z,relro -Wl,-z,now -Wl,--no-copy-dt-needed-entries
src/libutil/affinity.o src/libutil/archive.o src/libutil/args.o
src/libutil/compression.o src/libutil/config.o src/libutil/hash.o
src/libutil/json.o src/libutil/logging.o src/libutil/serialise.o
src/libutil/thread-pool.o src/libutil/util.o src/libutil/xml-writer.o
-llzma -lbz2 -pthread -lcrypto -lbrotlienc -lbrotlidec -L/usr/lib/arm-
linux-gnueabi -lboost_context -Wl,-z,defs -Wl,-soname=libnixutil.so   
/usr/bin/ld: src/libutil/logging.o: in function
`std::__atomic_base::fetch_add(unsigned long long,
std::memory_order)':
/usr/include/c++/9/bits/atomic_base.h:541: undefined reference to
`__atomic_fetch_add_8'
collect2: error: ld returned 1 exit status
make[1]: *** [mk/lib.mk:104: src/libutil/libnixutil.so] Error 1


I'm not familiar with nix and/or gcc so unfortunately I cannot provide
any suggestion.

-- 
Regards,
Boyuan Yang


signature.asc
Description: This is a digitally signed message part