#44 Linking problem when using --no-undefined

open
nobody
None
5
2011-02-14
2011-01-25
Anonymous
No

Latest stable release ( 2.3.1 ) and also latest head do not compile if the option --no-undefined is for ld. The option warn if there is a missing object file at link time :

.libs/libvdesnmp.o: In function `mgmt_init':
/mnt/video/mgarepo/vde2/BUILD/vde2-2.3.1/src/lib/libvdesnmp.c:106: undefined reference to `vdemgmt_open'
/mnt/video/mgarepo/vde2/BUILD/vde2-2.3.1/src/lib/libvdesnmp.c:119: undefined reference to `vdemgmt_sendcmd'
.libs/libvdesnmp.o: In function `counters_parse':
/mnt/video/mgarepo/vde2/BUILD/vde2-2.3.1/src/lib/libvdesnmp.c:225: undefined reference to `vdemgmt_sendcmd'
.libs/libvdesnmp.o: In function `vde_snmp_init':
/mnt/video/mgarepo/vde2/BUILD/vde2-2.3.1/src/lib/libvdesnmp.c:363: undefined reference to `vdemgmt_asyncreg'
.libs/libvdesnmp.o: In function `vde_snmp_getfd':
/mnt/video/mgarepo/vde2/BUILD/vde2-2.3.1/src/lib/libvdesnmp.c:420: undefined reference to `vdemgmt_getfd'
.libs/libvdesnmp.o: In function `vde_snmp_event':
/mnt/video/mgarepo/vde2/BUILD/vde2-2.3.1/src/lib/libvdesnmp.c:425: undefined reference to `vdemgmt_asyncrecv'
collect2: ld returned 1 exit status
make[2]: *** [libvdesnmp.la] Erreur 1

The following patch ( from Funda Wang, funda@mandriva.org , ported by me to 2.3.1 ) fix the issue. It is against stable release, but should be trivial to port on trunk ( if needed ). You can compile with LDFLAGS="-Wl,--as-needed -Wl,--no-undefined" to see the issue.

Discussion


  • Anonymous
    2011-01-25

     
    Last edit: Anonymous 2013-11-20
  • renzo davoli
    renzo davoli
    2011-02-14

    fgiunchedi should have already fixed the problem in svn #468

     
  • renzo davoli
    renzo davoli
    2011-02-14

    • status: open --> open-fixed
     
  • this specific error is fixed but the underlying issue remains, the fact is that vde is building some shared objects for its internal usage. For example libvdehist is depending on the global variable prompt which is defined in vdeterm.c which in turn is built as a binary so you can't link it to the .so.
    While we can certainly fix this I'm not convinced is worth the effort nor have a clear/clean resolution in mind.

     
    • status: open-fixed --> open