From 9fda6c6e9e649eb5b52f068a3847e3a38ecce6f0 Mon Sep 17 00:00:00 2001 From: Dan Heidinga Date: Mon, 27 Aug 2018 16:20:39 -0400 Subject: [PATCH] Support OSX dylib syntax The code needs to be ifdefed this way due to zOS and the way it has macroized dlopen The code needs to be ifdefed this way due to zOS and the way it has macroized dlopen. Otherwise, the zOS compile will fail Signed-off-by: Dan Heidinga --- runtime/jsigWrapper/jsig.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/runtime/jsigWrapper/jsig.c b/runtime/jsigWrapper/jsig.c index 23a21aee656..46cd47e13ec 100644 --- a/runtime/jsigWrapper/jsig.c +++ b/runtime/jsigWrapper/jsig.c @@ -74,7 +74,13 @@ getFunction(void **tableAddress, char *name) void *handle = dlopen("libomrsig.so", RTLD_LAZY); *tableAddress = dlsym(handle, name); #else /* defined(WIN32) */ - void *handle = dlopen("libomrsig.so", RTLD_GLOBAL | RTLD_LAZY); + /* Note: this needs to be ifdef'd this way for zOS to compile as it redefines dlopen */ + void *handle = +#if defined(OSX) + dlopen("libomrsig.dylib", RTLD_GLOBAL | RTLD_LAZY); +#else /* OSX */ + dlopen("libomrsig.so", RTLD_GLOBAL | RTLD_LAZY); +#endif /*OSX */ *tableAddress = dlsym(handle, name); #endif /* defined(WIN32) */ }