RFR: 8351322: Parameterize link option for pthreads
Magnus Ihse Bursie
ihse at openjdk.org
Thu Mar 6 18:24:05 UTC 2025
On Thu, 6 Mar 2025 17:28:10 GMT, snake66 <duke at openjdk.org> wrote:
>> make/autoconf/libraries.m4 line 142:
>>
>>> 140: # Threading library
>>> 141: if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xaix; then
>>> 142: BASIC_JVM_LIBS="$BASIC_JVM_LIBS $(LIBPTHREAD)"
>>
>> If you specifically need this to be resolved in the makefile rather than here, then please add a comment explaining why, otherwise use a shell script variable reference.
>>
>> Suggestion:
>>
>> BASIC_JVM_LIBS="$BASIC_JVM_LIBS $LIBPTHREAD"
>
> @erikj79 There will be a later patch to libraries.m4 that sets the variable based on the target platform, and then populates the `LIBPTHREAD` variable in spec.gmk. (https://github.com/openjdk/jdk/pull/23930/files#diff-56172cd2ec5804a5f764a6d0d5970da6144b024a06e008571f9822b2dc83cc36R147) That means the parenthesis should stay, right?
I'm not sure what you mean now. The link is to this very patch, which does what you describe -- sets LIBPTHREAD according to OS and stores it in spec.gmk.
And no, the paranthesis should not stay. If you keep them, the variable will be re-evaluated in make every time BASIC_JVM_LIBS is evaluated. That is not needed; by dropping the parenthesis the actual value to be used will be inserted as a string constant. Which is what we want, since we know the value at configure time.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23930#discussion_r1983853576
More information about the build-dev
mailing list