On Thu, 29 Feb 2024 13:39:41 GMT, Julian Waters <jwat...@openjdk.org> wrote:

>> After we removed mapfiles, we can setup -fvisibility=hidden (and 
>> -Wl,--exclude-libs,ALL) in the most basic flags, so this applies to all 
>> compilation.
>> 
>> This will remove duplicate code and make the underlying assumptions of the 
>> build clearer.
>> 
>> Doing this will result in the same output result -- with one exception: 
>> native test libraries has not been compiled with this flag (and this caused 
>> an error for a Oracle-internal test).
>
> make/autoconf/flags-ldflags.m4 line 85:
> 
>> 83: 
>> 84:     if test "x$OPENJDK_TARGET_OS" = xlinux; then
>> 85:       BASIC_LDFLAGS="-Wl,--exclude-libs,ALL"
> 
> Duplicated code? It already adds -Wl,--exclude-libs,ALL above if the compiler 
> is gcc

Yes, but this is in `if test "x$TOOLCHAIN_TYPE" = xclang`.

The way all these flags are split between compiler, os, and "category" (like 
BASIC etc) is less than ideal, to put it mildly. However, fixing that properly 
is beyond the scope of this PR.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18061#discussion_r1507657481

Reply via email to