Hi all,
I found libsyslookup.so in lib directory in JDK, and it seems to be used
in `SystemLookup` in FFM to find symbols from the system. But I wonder
why SystemLookup depends on libsyslookup on Linux. I think it is not
needed on Linux with some changes.
I understand syslookup.dll is needed for Windows because some functions
might not be lookup'ed. OTOH on Linux, `dlsym` can lookup symbols from
library dependencies. In `SystemLookup`, handle of libsyslookup would be
passed to `dlsym` eventually, but I think it is better to pass
`RTLD_DEFAULT` in this case. I know it works when the handle of
libsyslookup is passed, but `RTLD_DEFAULT` is better because Javadoc of
`Linker::defaultLookup` says it returns a set of commonly used
libraries. I guess the reson of use libsyslookup is to use
`NativeLibraryImpl`.
I think we can fix not to use libsyslookup like [1]. It works on Linux
(including static image of course). If it does not have a problem, I
want to create JBS issue and PR for this. Do you have any comments?
In addition, I guess we can apply this change to all of POSIX platforms
because `dlsym` is defined in POSIX, but I'm not sure we can do
(especially AIX - it has own syslookup.c in JDK source tree).
Thanks,
Yasumasa
[1]
https://github.com/YaSuenag/jdk/commit/b125cc164d60ac14316549e59d18544d75f6fcb2
- [External] : Is libsyslookup.so needed for FFM on Linu... suenaga
-