On Tue, 27 Feb 2024 11:06:15 GMT, Magnus Ihse Bursie <i...@openjdk.org> wrote:

>> This was actually an important part of this PR, trying to combat the all too 
>> general solution we had when trying to combine microsoft and non-microsoft 
>> linking. On all Unix-style linkers, the option to mark the output file is 
>> `-o `. That is such a fundemental option that we do not want to make it 
>> general, especially not considering the additional difficulty that the 
>> corresponding option for the microsoft `link.exe` is to specify 
>> `/out:<filename>`, without a space. This forced us to define LD_OUT_OPTION 
>> as `-o$(SPACE)` on unix linkers, and it forced us to setup the linker 
>> command line with `$(LD_OUT_OPTION)$$($1_TARGET_RELOCATABLE)` with no space 
>> between. 
>> 
>> That is in clear contrast with how we can add multiple sets of command line 
>> options like e.g. `(LDFLAGS_CXX_PARTIAL_LINKING) $$($1_SYSROOT_LDFLAGS)` 
>> where we can just stack them after each other with a space between.
>
> Also, 
> 
>> the flexibility of specifying the non-linker specific option here
> 
> I don't know what you mean by that. LD_OUT_OPTION was thought of as an 
> abstraction between the difference of `-o ` and `/out:`. It should not be 
> used to include anything else, so no flexibility is lost.

Thanks for the explanation. With the separation of Microsoft linking and this 
handling the Unix style linking only, using the non-general `-o` seems 
reasonable.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17987#discussion_r1504622620

Reply via email to