Bug 6203 - Specifying "-Wl,-z,defs" as linker flags breaks building "vfs_recycle.c"
Summary: Specifying "-Wl,-z,defs" as linker flags breaks building "vfs_recycle.c"
Status: RESOLVED INVALID
Alias: None
Product: Samba 3.3
Classification: Unclassified
Component: VFS Modules (show other bugs)
Version: 3.3.2
Hardware: x86 Linux
: P3 normal
Target Milestone: ---
Assignee: Björn Jacke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-21 09:02 UTC by Sebastian Krysmanski
Modified: 2009-07-15 11:13 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Krysmanski 2009-03-21 09:02:24 UTC
Hello,

I tried to build Samba today (using an automatic Debian package builder called "pdebuild"). However this resulted in a compiler error.

Building plugin bin/recycle.so
gcc -Wall -pipe -fomit-frame-pointer -O2 -march=i686 -O -D_SAMBA_BUILD_=3 -shared -Wl,-Bsymbolic -Wl,-z,relro -Wl,-z,defs -L./bin  -o bin/recycle.so -Wl,-soname=`basename bin/recycle.so` modules/vfs_recycle.o
make[1]: Leaving directory `/tmp/buildd/samba-3.3.2/source'
modules/vfs_recycle.o: In function `init_samba_module':
vfs_recycle.c:(.text+0xc2): undefined reference to `smb_register_vfs'
vfs_recycle.c:(.text+0xe2): undefined reference to `debug_add_class'
vfs_recycle.c:(.text+0x103): undefined reference to `DEBUGLEVEL_CLASS'
vfs_recycle.c:(.text+0x116): undefined reference to `DEBUGLEVEL_CLASS_ISSET'
vfs_recycle.c:(.text+0x164): undefined reference to `dbghdr'
vfs_recycle.c:(.text+0x17a): undefined reference to `dbgtext'
vfs_recycle.c:(.text+0x182): undefined reference to `DEBUGLEVEL_CLASS'
vfs_recycle.c:(.text+0x195): undefined reference to `DEBUGLEVEL_CLASS_ISSET'
vfs_recycle.c:(.text+0x1db): undefined reference to `dbghdr'
vfs_recycle.c:(.text+0x1f7): undefined reference to `dbgtext'
modules/vfs_recycle.o: In function `recycle_connect':
vfs_recycle.c:(.text+0x243): undefined reference to `DEBUGLEVEL_CLASS'
vfs_recycle.c:(.text+0x256): undefined reference to `DEBUGLEVEL_CLASS_ISSET'
vfs_recycle.c:(.text+0x29c): undefined reference to `dbghdr'
vfs_recycle.c:(.text+0x2be): undefined reference to `dbgtext'
modules/vfs_recycle.o: In function `recycle_disconnect':
vfs_recycle.c:(.text+0x31c): undefined reference to `DEBUGLEVEL_CLASS'
vfs_recycle.c:(.text+0x32f): undefined reference to `DEBUGLEVEL_CLASS_ISSET'
vfs_recycle.c:(.text+0x375): undefined reference to `dbghdr'
vfs_recycle.c:(.text+0x395): undefined reference to `lp_servicename'
vfs_recycle.c:(.text+0x3a7): undefined reference to `dbgtext'
...
vfs_recycle.c:(.text+0x295a): undefined reference to `dbghdr'
vfs_recycle.c:(.text+0x2987): undefined reference to `dbgtext'
vfs_recycle.c:(.text+0x29e9): undefined reference to `talloc_free'
vfs_recycle.c:(.text+0x29f9): undefined reference to `DEBUGLEVEL_CLASS'
collect2: ld returned 1 exit status
make[1]: *** [bin/recycle.so] Error 1
make: *** [build-stamp] Error 2
pbuilder: Failed autobuilding of package


It took me quite a while to figure out what caused the problem. The problem was that I explicitly specified the linker flags (LDFLAGS) as "-Wl,-z,defs" (which is the default for this package builder). No specifying the flags "solved" the problem although I think that there shouldn't be any undefined references in the source, should they?

Regards
Comment 1 Björn Jacke 2009-07-15 11:13:25 UTC
that's normal for a vfs module. It wouldn't be normal for a library however :-)