On Fri, 1 Nov 2024 00:08:56 GMT, Jiangli Zhou <jian...@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. make/autoconf/toolchain.m4 line 448: > 446: fi > 447: fi > 448: USE_USER_SUPPLIED_COMPILER=true This code is called for both CC and CXX. So if you run like `configure CC=foo` (but not with `CXX=bar` at the same time), the value of this variable will be determined by which check happens to be run first by configure. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21817#discussion_r1825959316