RFR: 8282191: Implementation of Foreign Function & Memory API (Preview) [v3]
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Tue Mar 22 14:04:10 UTC 2022
On Mon, 21 Mar 2022 17:36:53 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> 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.
>
> Good points - there is really no need AFAIK for the lib name to be different. I'll do few experiments.
I've fixed the makefile as you suggested - I agree the result is much simpler. I've tested the changes on mac/linux/win and everything looks good.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7888
More information about the security-dev
mailing list