-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Test tweaks #158
Test tweaks #158
Conversation
uses dlvsym to load ld.so anholt/libepoxy#158
test/meson.build
Outdated
@@ -1,3 +1,4 @@ | |||
has_dlvsym = cc.has_function('dlvsym', prefix : '#include<dlfcn.h>') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to also define _GNU_SOURCE
, according to the man page for dlvsym
:
has_dlvsym = cc.has_function(
'dlvsym',
prefix: '''#define _GNU_SOURCE
#include <dlfcn.h>''',
)
So yes, please simplify the logic ;-). By the way, the same file also uses unportable |
Finally, the whole purpose of that file is to find |
afb5d18
to
c8a5284
Compare
Pushed revised commits. Passing GNU_SOURCE isn't required as has_function doesn't care about headers, but I do need to find libdl as a dependency first. Removed all traces of build_apple. |
Thanks, @rossburton. One last hurdle: as much as I'd like to ignore the Autotools build, we're still supporting it, so |
Another patch pushed. You owe me 🍺 for making me wrestle autoconf after the glory of meson. 😉 |
build_apple was introduced in 756dca as a proxy for the fact that Apple's libc doesn't have dlvsym(), which is glibc-specific so also isn't present in other libc implementations such as musl. Instead of detecting whether we are building for Apple or not, just probe the to see if we have dlvsym.
As per the previous commit, instead of assuming that Apple doesn't have dlvsym but everywhere else does, actually check for dlvsym() existing as that function is glibc-specific.
Two patches:
One to add an option to disable the test suite entirely for eg distro builders that won't run it
The other checks if dlvsym is present as that is a glibc-specific function and the tests fail to build on musl. Note that there's an existing "if not apple" check in all the functions which use dlvsym(), if that is because dlvsym isn't present on apple then I can revise the patch to simplify the logic.