RFR: 8339128: Cannot resolve user specified tool properly after JDK-8338304 [v2]
Jiangli Zhou
jiangli at openjdk.org
Fri Nov 1 19:46:28 UTC 2024
On Fri, 1 Nov 2024 15:32:31 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:
>> 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.
>
> The solution to this conundrum is not trivial. You could use a `$1_IS_USER_SUPPLIED` instead, but then you need to determine what to do with the `lld` check. Maybe you should skip it if either of `CC_IS_USER_SUPPLIED` or `CXX_IS_USER_SUPPLIED` is true; or only if both.
>
> I guess it is unlikely that anyone runs with such a combination, but it is possible and (technically sort-of) supported.
@erikj79 and @magicus thanks for the quick feedback.
Using separate CC_IS_USER_SUPPLIED and CXX_IS_USER_SUPPLIED for checking seems fine. I think we probably only want to do `UTIL_REQUIRE_PROGS(LLD, lld)` if both `CC_IS_USER_SUPPLIED` and `CXX_IS_USER_SUPPLIED` are false. I updated the PR based on @magicus input. I tested with the updated change in our build environment that uses clang, it works ok.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21817#discussion_r1826231682
More information about the build-dev
mailing list