Summary: | -Wl,--no-undefined gives undefined references to libc symbols on OpenBSD | ||
---|---|---|---|
Product: | Mesa | Reporter: | Jonathan Gray <jsg> |
Component: | Other | Assignee: | mesa-dev |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | ||
Version: | git | ||
Hardware: | Other | ||
OS: | OpenBSD | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | patch to disable no-undefined on OpenBSD |
Description
Jonathan Gray
2014-03-31 18:12:03 UTC
Hmm how "nice" :-) As my *BSD fu is virtually non existent would you mind checking which library(ies) provides those functions, so that we handle this appropriately. Unless of course *BSD have the policy of leaving those symbols unresolved. As I said in the subject these are all symbols in libc. It seems --Wl,--no-undefined has different behaviour on Linux. Evolution for example does not enable this on FreeBSD/OpenBSD https://mail.gnome.org/archives/commits-list/2010-December/msg06238.html sdl does not enable it on OpenBSD http://lists.libsdl.org/pipermail/commits-libsdl.org/2013-November/007649.html So it seems DT_NEEDED entries are not added for libc and libpthread over concerns that specific versions of those libraries would be referenced in a way that would prevent changing the major version of those libraries in future. So the problem here is the combination of --no-uneeded and -no-undefined. If the relevant lines could be contained to a variable in configure.ac instead of mentioned in the various Makefile.am files that would allow them to not be specified on OpenBSD. Maybe check with OpenBSD to figure out why this doesn't work? (In reply to comment #4) > Maybe check with OpenBSD to figure out why this doesn't work? Oh, I missed the more recent comment. Seems like a lovely case. There is a very nice 10+ old topic wrt this behaviour and libtool [1]. To make things even better sometimes the linking rules differ between versions (FreeBSD 5 vs 4)[2]. Most annoying part IMHO is that the ld manual does not even hint about this *BSD "feature". With that said, we should avoid using -Wl,--no-undefined for OpenBSD but I would prefer to keep this on "as needed" basis. I.e. other *BSD flavours can opt in if needed. Jonathan Feel free to prep a patch and use your comment 3 to prevent other zealots like me from ever touching that piece of mesa :) Thank you [1] http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00483.html [2] http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00494.html Created attachment 96753 [details] [review] patch to disable no-undefined on OpenBSD Pushed to master commit 11623be934f8573910484de2a5fb50c95f0a1d44 Author: Jonathan Gray <jsg@jsg.id.au> Date: Thu Apr 3 15:46:01 2014 +1100 automake: don't enable -Wl,--no-undefined on OpenBSD OpenBSD does not have DT_NEEDED entries for libc by design, over concerns how the symbols would be referenced after changing the major version of the library. So avoid -no-undefined checks on OpenBSD as they will fail. v2: don't include the -no-undefined libtool option in the variable and change -Wl,--no-undefined references in Automake.inc as well. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76856 Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com> |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.