# GlusterFS 7.0 "ld: error: undefined symbol: basename_r"



## tuaris (Dec 11, 2019)

I'm trying to create a port for GlusterFS 7.0 using the existing net/glusterfs port as a starting point.  With some small adjustments to the line numbering in the patches and re-configuring dependencies it looks like Gluster 7.0 compiles the code just fine.   When it gets to the linking step it fails with the following:


```
/bin/sh ../../libtool  --tag=CC    --mode=link cc -Wall -I/usr/local/include/uuid -I/usr/local/include  -Wformat -Werror=format-security -Werror=implicit-function-declaration -Wno-gnu -O0 -DTHREAD_UNSAFE_BASENAME -DTHREAD_UNSAFE_DIRNAME -D_LIBGEN_H_ -DO_DSYNC=0 -Dxdr_quad_t=xdr_longlong_t -Dxdr_u_quad_t=xdr_u_longlong_t -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -isystem /usr/local/include  -rdynamic -lexecinfo -ldl -L/usr/local/lib -largp -L/usr/local/lib  -fstack-protector-strong -o glusterfsd glusterfsd.o glusterfsd-mgmt.o ../../libglusterfs/src/libglusterfs.la  ../../rpc/rpc-lib/src/libgfrpc.la  ../../rpc/xdr/src/libgfxdr.la -largp -lm -lrt -lintl -lpthread -lcrypto
libtool: link: cc -Wall -I/usr/local/include/uuid -I/usr/local/include -Wformat -Werror=format-security -Werror=implicit-function-declaration -Wno-gnu -O0 -DTHREAD_UNSAFE_BASENAME -DTHREAD_UNSAFE_DIRNAME -D_LIBGEN_H_ -DO_DSYNC=0 -Dxdr_quad_t=xdr_longlong_t -Dxdr_u_quad_t=xdr_u_longlong_t -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -isystem /usr/local/include -rdynamic -fstack-protector-strong -o .libs/glusterfsd glusterfsd.o glusterfsd-mgmt.o  -ldl -L/usr/local/lib ../../libglusterfs/src/.libs/libglusterfs.so ../../rpc/rpc-lib/src/.libs/libgfrpc.so /usr/ports/net/glusterfs7/work/glusterfs-7.0/rpc/xdr/src/.libs/libgfxdr.so ../../rpc/xdr/src/.libs/libgfxdr.so /usr/ports/net/glusterfs7/work/glusterfs-7.0/libglusterfs/src/.libs/libglusterfs.so -lexecinfo -largp -lz -lm -luuid -lrt -lintl -lpthread -lcrypto -Wl,-rpath -Wl,/usr/local/lib
ld: error: undefined symbol: basename_r
>>> referenced by glusterfsd.c
>>>               glusterfsd.o:(parse_cmdline)

ld: error: undefined symbol: basename_r
>>> referenced by glusterfsd.c
>>>               glusterfsd.o:(parse_cmdline)
```

I'm not sure how to fix this or what it means.  I search glusterfsd.c for the calls to basename(3) and compared it between version 3.11.1 and 7.0.  There doesn't seem to be any obvious difference.


----------

