-
Notifications
You must be signed in to change notification settings - Fork 958
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
build: don't generate fake GNU libtool .la files #1665
Conversation
When building on unix systems TigerVNC will build several static archives (.a) and corresponding GNU libtool archive (.la) files within cmake build files. However these .la files are specific to GNU libtool and are not compatible with alternative libtool implementations such as Slibtool which results in build issues. Instead it is better to link directly with the static archives which both GNU libtool and Slibtool can consume, but this requires the dependency_libs variable from the fake libtool archives which are now generated in automake (unix.mk) files and then included in Makefile.am. Gentoo bug: https://bugs.gentoo.org/913581
Thanks for your submission! I'm a bit concerned about just dumping the whole .la approach, though. That is what Xorg's build system uses normally, after all. Can't we try to fix the incompatibility in Slibtool instead? Ideally in Slibtool, since I would assume it is a bug there since libtool can handle these files just fine? But as a second choice, try to work around it in our end. I don't quite understand what Slibtool is upset about though from that bug report. Can you attempt to clarify what the problem is? |
I can understand your concern, but given that TigerVNC mixes cmake and autotools that puts the build issue in a unique position. GNU libtool and slibtool are not compatible when used within the same build invocation which can be evidenced by the
And with GNU libtool.
Additionally looking at the
I am doubtful that slibtool is the right place to fix this nor do I think their upstream is going to want to do that. This leaves a few choices that I can see:
Given that future xserver releases will be different I think the first and third choice are the better ones. |
I looked a bit closer at this, and slibtool do state that they don't actually use any existing .la files:
On the other hand, they also claim:
I tried using the "c" version, and it still didn't use the .la files. I'm uncertain if this is a bug in slibtool, or if "perfect emulation" doesn't necessarily cover this use case. Either way, I still maintain the opinion that if slibtool is to be a libtool replacement, then it needs to be able to consume libtool compatible .la files. Otherwise, slibtool is just another competing build system. Which we would need to justify maintaining support for. And slibtool seems to be a very niche tool, so I don't really see why we can't just tell people that standard libtool is what is supported? Related to that, the change suggested in this PR doesn't seem to be worth the risk. I can already see one bug, in that it doesn't seem to handle propagation of dependencies recursively, which is need in some cases. That can likely be fixed, but I don't see the big upside of having to take on that burden of duplicating what libtool currently does for us. Exploring meson is probably more interesting, as it is likely that we'll need to support that build system eventually anyway. |
The compatibility "c" version exists so that one could install compatible .la files to the target directory. The content of .la files, and likewise the name and format of temporary files that are created as part of the build process (in the .libs directory), are considered an implementation-specific detail that one should not rely upon. As things currently stand, tigervnc generates the .la files under the assumption that there exists only a single libtool implementation, namely GNU's. In C programming, that would be the same as writing one's code against glibc's internals rather than against the POSIX specification. Then again, GNU libtool itself might decide at some point to change its implementation internals (format of .la files, .libs directory structure, etc.), which would then result in tigervnc failing to build. (admittedly, this last scenario is highly unlikely 🤪) As far as I can tell, the best and least intrusive solution would be to:
|
When building on unix systems TigerVNC will build several static archives (
.a
) and corresponding GNU libtool archive (.la
) files within cmake build files. However these .la files are specific to GNU libtool and are not compatible with alternative libtool implementations such as Slibtool which results in build issues.Instead it is better to link directly with the static archives which both GNU libtool and Slibtool can consume, but this requires the
dependency_libs
variable from the fake libtool archives which are now generated in automake (unix.mk
) files and then included inMakefile.am
.Gentoo bug: https://bugs.gentoo.org/913581
Note that there is more clean up in the
CMakeMacroLibtoolFile.cmake
file that can be done, perhaps even changing its name, but as a build fix I tried to make this commit as small as possible.