-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symbol conflict when building lvm2 against libudev.a #20600
Comments
not sure we should do anything about this. We are very careful with marking all symbols we export with export info. This doesn't work with static libs, obviously, but not sure we should care. If you are asking us to rename all our internal symbols that have names that could conflict, then no way, that's not going to happen. I think we should just revert 70848ec as unsupportable. |
/cc @davide125 @keszybz |
I just checked and we still rely on this on our end, but we don't build with lvm2 support so we never noticed this issue. When we hit a similar thing for I'm all for making it more clear that static builds aren't officially supported, but I'd love to keep 70848ec in if possible as it makes our life a lot easier. |
So a kludgy workaround would be to rename specific symbols in libudev.a using objcopy. For example, to resolve this conflict with lvm2, we could do this:
A more general workaround would be to write a script to prefix all symbols that are marked with "hidden" visibility. I'm guessing that's not the sort of workaround you would want to support upstream? I'm also ok with dropping support for building libudev.a; Gentoo doesn't really rely on it, but it will make some of our users unhappy. |
I ran into this independently, see #20621. That name is just too generic for an exported symbol IMHO. |
The |
Anyway, let's close this. If you want to make static linking work, then please work with the linker people to add a way to add namespacing to static linking. But we are simply not going to rename all our internal symbols. |
systemd does not support being built statically[1], which means that, prior to this patch, nothing that depends on udev can be built statically. libudev-zero is a daemonless implementation of libudev, that supports being built statically. So, by setting udev to be libudev-zero when systemd is unavailable, we can get static builds of packages like linuxPackages.usbip. [1]: systemd/systemd#20600 (comment)
systemd does not support being built statically[1], which means that, prior to this patch, nothing that depends on udev can be built statically. libudev-zero is a daemonless implementation of libudev, that supports being built statically. So, by setting udev to be libudev-zero when systemd is unavailable, we can get static builds of packages like linuxPackages.usbip. [1]: systemd/systemd#20600 (comment)
systemd version the issue has been seen with
v249
Used distribution
Gentoo
CPU architecture issue was seen on
x86_64
Details
I am attempting to build lvm2 with
--enable-static_link
.udev was built with
-Dstatic-libudev=true
Linking the lvm.static binary fails due to a conflicting symbol
version
that is defined in both libudev.a and the lvm2 sources.I am aware that the systemd project has no love for static linking, but I wanted to raise the issue in case there is some easy solution.
The text was updated successfully, but these errors were encountered: