On Mon, 21 Mar 2022 10:45:27 GMT, Maurizio Cimadamore <mcimadam...@openjdk.org> 
wrote:

> This PR contains the API and implementation changes for JEP-424 [1]. A more 
> detailed description of such changes, to avoid repetitions during the review 
> process, is included as a separate comment.
> 
> [1] - https://openjdk.java.net/jeps/424

Build changes look ok.

make/modules/java.base/Lib.gmk line 217:

> 215:       CXXFLAGS := $(CXXFLAGS_JDKLIB), \
> 216:       LDFLAGS := $(LDFLAGS_JDKLIB) -Wl$(COMMA)--no-as-needed, \
> 217:       LIBS := $(LIBCXX) -lc -lm -ldl, \

Instead of repeating this whole macro call for both Linux and non Linux, you 
can use parameters of the form LDFLAGS_linux and LIBS_linux to add the Linux 
specific flags. Something like this:


LDFLAGS := $(LDFLAGS_JDKLIB), \
LDFLAGS_linux := -Wl$(COMMA)--no-as-needed, \


For the NAME field, there is no such support, so the way we usually do that is 
through a variable and conditionals before the macro call. What's the reason to 
have a different lib name on Windows? If they were the same, and the source 
file in windows/native/... had the same name, it would just automatically 
override in the build.

I realize now that this is just moved code from jdk.incubator.foreign, and this 
patch is probably big enough as it is so no need to refactor the build logic at 
the same time.

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

Marked as reviewed by erikj (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/7888

Reply via email to