RFR: 8339128: Cannot resolve user specified tool properly after JDK-8338304

Erik Joelsson erikj at openjdk.org
Fri Nov 1 12:51:34 UTC 2024


On Fri, 1 Nov 2024 00:08:56 GMT, Jiangli Zhou <jiangli at openjdk.org> wrote:

> Please review this PR that fixes JDK build configure failure when using clang after JDK-8338304:
> 
> 
> Found candidate GCC installation: <snip>
> Selected GCC installation: <snip>
> ...
> clang: error: unsupported option '-V -static-libgcc'
> configure:85215: $? = 1
> configure:85204: <snip> -qversion >&5
> clang: error: unknown argument '-qversion'; did you mean '--version'?
> ...
> 
> 
> Tool from Clang GCC installation is being picked up unexpectedly (JDK build configured with `--with-toolchain-type=clang`). With this fix, it avoids `UTIL_REQUIRE_PROGS(LLD, lld)` if user supplies compiler toolchain. The user supplied compiler toolchain is used by setting `CXX=<user_specified_path_to_tools_script>` during configuration.

I think I'm ok with this, but would like Magnus to weigh in if possible.

make/autoconf/flags-ldflags.m4 line 76:

> 74:       # Clang needs the lld linker to work correctly
> 75:       BASIC_LDFLAGS="-fuse-ld=lld -Wl,--exclude-libs,ALL"
> 76:       if test "x$USE_USER_SUPPLIED_COMPILER" = xfalse; then

The variable name sounds like it's directing something, rather than reflecting an observation (USE vs for example USING), which risks confusion. I think we should just shorten it to `USER_SUPPLIED_COMPILER`.

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

PR Review: https://git.openjdk.org/jdk/pull/21817#pullrequestreview-2410009503
PR Review Comment: https://git.openjdk.org/jdk/pull/21817#discussion_r1825781396


More information about the build-dev mailing list