RFR: 8352481: Extra a.out generated after configure with clang [v4]
SendaoYan
syan at openjdk.org
Tue Mar 25 04:10:53 UTC 2025
On Mon, 24 Mar 2025 15:31:41 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:
>> SendaoYan has updated the pull request incrementally with one additional commit since the last revision:
>>
>> fix spelling bug
>
> `RM` is actually defined as `rm -f` so the `-f` is not necessary.
>
> I'm still not very happy with this solution. It will remove any `a.out` file the user has lying around. Granted, they are normally temporary testing files, but it is highly surprising that running `configure` should remove them. To fix that, we would need to check for the existence of `a.out` prior to running the link command to set a flag if we should allow deletion or not. That would make the patch more complex. So I don't think this is the right way to go.
>
> Later on, we will pass `-fuse-ld=lld` to `clang`. I think the correct fix is to make sure it is always passed, from the very beginning, even when checking version strings etc.
Hi @magicus Check [linker version string](https://github.com/openjdk/jdk/tree/master/make/autoconf/configure.ac#L189) is before [set linker options](https://github.com/openjdk/jdk/blob/master/make/autoconf/configure.ac#L212) in make/autoconf/configure.ac. If we want to pass `-fuse-ld=lld` to `clang` during check linker version string, this will make this PR as big project.
So, I want to change the command which get the linker version like below, this will avoid generated a.out file:
LINKER_VERSION_STRING=`$LINKER -Wl,-v 2>/dev/null | $HEAD -n 1`
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24125#issuecomment-2750014717
More information about the build-dev
mailing list