mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-04-04 07:15:53 -04:00
tests: Update os-wrappers-test to build on non-ELF platforms
The !ELF case just avoids the weak link-fu that was added to support sanitizers. Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
This commit is contained in:
parent
276a28afd1
commit
04654ba7b5
1 changed files with 8 additions and 0 deletions
|
|
@ -47,6 +47,7 @@
|
||||||
|
|
||||||
static int fall_back;
|
static int fall_back;
|
||||||
|
|
||||||
|
#ifdef __ELF__
|
||||||
/* Play nice with sanitizers
|
/* Play nice with sanitizers
|
||||||
*
|
*
|
||||||
* Sanitizers need to intercept syscalls in the compiler run-time library. As
|
* Sanitizers need to intercept syscalls in the compiler run-time library. As
|
||||||
|
|
@ -71,6 +72,13 @@ static int fall_back;
|
||||||
#define REAL(func) (__interceptor_ ## func) ? \
|
#define REAL(func) (__interceptor_ ## func) ? \
|
||||||
__interceptor_ ## func : \
|
__interceptor_ ## func : \
|
||||||
(__typeof__(&__interceptor_ ## func))dlsym(RTLD_NEXT, #func)
|
(__typeof__(&__interceptor_ ## func))dlsym(RTLD_NEXT, #func)
|
||||||
|
#else
|
||||||
|
#define DECL(ret_type, func, ...) \
|
||||||
|
static ret_type (*real_ ## func)(__VA_ARGS__); \
|
||||||
|
static int wrapped_calls_ ## func;
|
||||||
|
|
||||||
|
#define REAL(func) (__typeof__(real_ ## func)) dlsym(RTLD_NEXT, #func)
|
||||||
|
#endif
|
||||||
|
|
||||||
DECL(int, socket, int, int, int);
|
DECL(int, socket, int, int, int);
|
||||||
DECL(int, fcntl, int, int, ...);
|
DECL(int, fcntl, int, int, ...);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue