On Mon, 11 Mar 2024 08:59:03 GMT, Joachim Kern <[email protected]> wrote:
>> make/autoconf/flags-cflags.m4 line 687:
>>
>>> 685: PICFLAG="-fPIC"
>>> 686: PIEFLAG="-fPIE"
>>> 687: elif test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS"
>>> = xaix; then
>>
>> Just a remark: This code has never been executed, since running with clang
>> on any OS would hit the branch above. Also, the code is syntactically
>> incorrect, missing a trailing `"`.
>
> OK this was a flaw in my introduction of clang toolchain for AIX. The
> intention was to keep the xlc options in form of their clang counterparts. I
> will try with a corrected version for clang on AIX and will come back to you.
OK, the `-Wl,-bbigtoc` is not a compiler option but a linker option and it is
already set in the linker options.
But the `-fpic -mcmodel=large` should be set to avoid creating a jump to
out-of-order code.
So we can replace the
JVM_PICFLAG="$PICFLAG"
JDK_PICFLAG="$PICFLAG"
code some lines below by
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
JVM_PICFLAG="-fpic -mcmodel=large"
else
JVM_PICFLAG="$PICFLAG"
fi
JDK_PICFLAG="$PICFLAG"
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18172#discussion_r1519747481