On Fri, 20 Mar 2026 13:47:08 GMT, Erik Joelsson <[email protected]> wrote:
>> Harald Eilertsen has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Adjust FreeBSD Hsdis support to apply to *BSD. > > make/common/JdkNativeCompilation.gmk line 240: > >> 238: $1_$2_STATIC_LIBRARY := true >> 239: $1_LIBS += $(LIBZ_LIBS) $(LIBPTHREAD) >> 240: endif > > I see that this is mimicking the line above, but this file isn't meant to be > used for these kinds of exceptions. I also noticed that there is a > conditional in java.base/lib/CoreLibraries.gmk handling the static part. It > would be nice if this could all be handled there instead. @erikj79 Thank you for the review. I will reply for this openbsd specific bit. I've tried to figure out a way to have this only be in java.base/lib/CoreLibraries.gmk. As far as I can tell the JdkNativeCompilation.gmk parts are needed for two reasons. The `$1_$2_STATIC_LIBRARY := true` part is needed to influence `ResolveLibPath` so that it can look in the correct directory for the static lib. Removing it makes `ResolveLibPath` not find the static lib. I suppose `ResolveLibPath` could be adjusted to prefer the shared library dir and if the lib is not found, fall back to the static lib dir. Alternatively, is there a way to have `ResolveLibPath` to obtain the value of `BUILD_LIBJLI_TYPE`? The `$1_LIBS += $(LIBZ_LIBS) $(LIBPTHREAD)` part is needed because the static lib does not have a way to record additional libraries it depends on like a shared library has with `NEEDED`. I suppose I could add `$(LIBZ_LIBS) $(LIBPTHREAD)` in another way that only was for OpenBSD. Let me know your preference on this. It seems like these issues apply equally to aix's need for a static libjli and gtest too. ------------- PR Review Comment: https://git.openjdk.org/bsd-port/pull/6#discussion_r2969618795
