systemd fails to build with static kmod library
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 15 lines · Stephan Raue
Am 02.06.2013 19:36, schrieb Greg KH:
Quoted 10 lines · Stephan Raue
Quoted 6 lines
i dont agree, i some cases it makes sense. since udev is included in systemd and udev has now its own buildins for the modprobe stuff it should be possible to use kmod statically linked, esp. if no other installed program uses kmod (and for our usage the kmod userspace binarys are not neccessary)
Quoted 4 lines
If you are so worried about other programs / users calling kmod, then just build your needed kernel modules into the kernel and don't use any kernel modules at all.
Quoted 6 lines
i am not much worried about this, but more about the comment "Do not use static linking, with systemd, ever, in fact do not use with any other component.". Statically linking works for so many programs and even kmod supports the "--enable-static" configure option. So basically i tried to report this broken behavior, because i never seen a statement like "dont link anything statically against systemd"
It's not advised to do it, so it's up to you to fix it in your custom build. Basically what you could do either of these in libkmod.a:
1) Rename the clashing symbols with objcopy (use --redefine-sym option)
2) Localize symbols with objcopy (--localize-hidden)
3) Extract the .o objects (ar -x) and relink them into a single .o (ld -r). Then turn it into a .a using libtool --static
If you integrate (2) or (3) nicely in the build system I think it could be acceptable upstream.
Another option is... while building systemd, you could achieve something similar to (2) above without the trouble of modifying libkmod.a by passing "-Wl,--exclude-libs,ALL" in LDFLAGS (untested).
Lucas De Marchi