Package: nfs-ganesha
Version: 2.4.4-1
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch


After applying patch for bug #859689, new problem appears.

Package nfs-ganesha_2.4.4-1 FTBFS on mips and mipsel with following error:

> [ 95%] Linking C executable ganesha.nfsd
> cd 
> /build/nfs-ganesha-6qoZzY/nfs-ganesha-2.4.4/src/obj-mipsel-linux-gnu/MainNFSD 
> && /usr/bin/cmake -E cmake_link_script CMakeFiles/ganesha.nfsd.dir/link.txt 
> --> verbose=1
> /usr/bin/cc  -g -O2 
> -fdebug-prefix-map=/build/nfs-ganesha-6qoZzY/nfs-ganesha-2.4.4=. 
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -> 
> D_FORTIFY_SOURCE=2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g 
> -DNDEBUG  -Wl,-z,relro -Wl,-z,now CMakeFiles/ganesha.nfsd.dir/nfs_main.c.o 
> CMakeFiles/ganesha.nfsd.dir/__/FSAL/fsal_convert.c.o 
> CMakeFiles/ganesha.nfsd.dir/__/FSAL/commonlib.c.o 
> CMakeFiles/ganesha.nfsd.dir/__/FSAL/fsal_manager.c.o 
> CMakeFiles/ganesha.nfsd.dir/__/FSAL/access_check.c.o 
> CMakeFiles/ganesha.nfsd.dir/__/FSAL/fsal_config.c.o 
> CMakeFiles/ganesha.nfsd.dir/__/FSAL/default_methods.c.o 
> CMakeFiles/ganesha.nfsd.dir/__/FSAL/common_pnfs.c.o 
> CMakeFiles/ganesha.nfsd.dir/__/FSAL/fsal_destroyer.c.o 
> CMakeFiles/ganesha.nfsd.dir/__/FSAL/fsal_helper.c.o 
> CMakeFiles/ganesha.nfsd.dir/__/FSAL_UP/fsal_up_top.c.o 
> CMakeFiles/ganesha.nfsd.dir/__/FSAL_UP/fsal_up_async.c.o  -o ganesha.nfsd 
> -Wl,-rpath,/usr/lib/mipsel-linux-gnu/mit-krb5: -rdynamic libMainServices.a 
> ../Protocols/NFS/libnfsproto.a ../Protocols/RQUOTA/librquota.a 
> ../Protocols/NLM/libnlm.a ../Protocols/9P/lib9p.a 
> ../Protocols/XDR/libnfs_mnt_xdr.a ../SAL/libsal.a ../idmapper/libidmap.a 
> ../avl/libavltree.a ../hashtable/libhashtable.a ../RPCAL/librpcal.a 
> ../support/libsupport.a ../Protocols/NFS/libnfs4callbacks.a ../cidr/libcidr.a 
> ../support/libstring_utils.a ../support/libhash.a ../log/liblog.a 
> ../support/libuid2grp.a ../support/libnetgroup_cache.a 
> ../FSAL/FSAL_PSEUDO/libfsalpseudo.a 
> ../FSAL/Stackable_FSALs/FSAL_MDCACHE/libfsalmdcache.a ../dbus/libgshdbus.a 
> ../config_parsing/libconfig_parsing.a -lwbclient -lnfsidmap -ldbus-1 -lcap 
> -lblkid -luuid ../os/libgos.a -ldl 
> /usr/lib/mipsel-linux-gnu/mit-krb5/libkrb5.so 
> /usr/lib/mipsel-linux-gnu/mit-krb5/libk5crypto.so -lcom_err 
> /usr/lib/mipsel-linux-gnu/mit-krb5/libgssapi_krb5.so -lpthread -lrt -lntirpc 
> /usr/bin/ld: libMainServices.a(client_mgr.c.o): undefined reference to symbol 
> '__atomic_fetch_sub_8@@LIBATOMIC_1.0'
> //usr/lib/mipsel-linux-gnu/libatomic.so.1: error adding symbols: DSO missing 
> from command line
> collect2: error: ld returned 1 exit status
> MainNFSD/CMakeFiles/ganesha.nfsd.dir/build.make:419: recipe for target 
> 'MainNFSD/ganesha.nfsd' failed
> make[4]: *** [MainNFSD/ganesha.nfsd] Error 101

The problem occurs because mips 32-bit architectures does not support use of 
8-byte atomics functions.
To solve this problem, it is necessary to provide linking with libatomic 
library.

I have created and attached a patch that enables linking with latomic library 
as needed.
With this patch package builds successfully on mips, mipsel, mips64el and i386.

Regards,
Radovan
--- nfs-ganesha-2.4.4.orig/src/CMakeLists.txt
+++ nfs-ganesha-2.4.4/src/CMakeLists.txt
@@ -883,6 +883,7 @@ set(SYSTEM_LIBRARIES
   ${CMAKE_THREAD_LIBS_INIT}
   ${LIBRT}
   ${NTIRPC_LIBRARY}
+  -Wl,--as-needed -latomic
 )
 
 # Config file; make sure it doesn't clobber an existing one

Reply via email to