On Mon, 18 Dec 2023 10:16:07 GMT, Thomas Stuefe <stu...@openjdk.org> wrote:

>> Joachim Kern has updated the pull request incrementally with two additional 
>> commits since the last revision:
>> 
>>  - trailing whitespace
>>  - Following most of Thomas proposals
>
> src/hotspot/os/aix/porting_aix.cpp line 1005:
> 
>> 1003:     // LIBPATH or LD_LIBRARY_PATH and second with burned in libpath.
>> 1004:     // No check against current working directory
>> 1005:     Libpath.print("%s:%s", env, rtv_linkedin_libpath());
> 
> Are you sure libpath env var has precedence over the baked-in libpath?

Yes, that was the outcome of my experiments, although the IBM docu says the 
oposite:
_"Specifies that the library path used at process exec time should be prepended 
to any library path specified in the load call (either as an argument or 
environment variable). It is recommended that this flag be specified in all 
calls to the load subroutine."_ 

My experiment showed: LIBPATH=libpath; baked-in-libpath=baked-in-libpath;
mylib.so is in both paths. After dlopen(mylib.so) a map call shows the library 
was loaded from libpath.
Then I remove the LIBPATH envvar and repeat. Now after dlopen(mylib.so) a map 
call shows the library was loaded from baked-in-libpath.
So the LIBPATH envvar has precedence over the baked-in-libpath.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16920#discussion_r1429919510

Reply via email to