On 2020-08-13 09:15, Kim Barrett wrote:
On Aug 1, 2020, at 3:24 AM, Vladimir Kempik <vkem...@azul.com> wrote:
Hello
Please review this change for JDK-8250876
This changeset adds support for macos/aarch64 into build system.
It will allow to crosscompile for macos/aarch64 using intel mac as well.
This changeset does NOT address some arm specific issues in the macos related
code, we plan to do that in s separate commit.
An example of configure to cross-compile for macos/arm64:
--with-boot-jdk=/path/to/java/ --with-build-jdk=/path/to/same/java/as/compiled
--disable-warnings-as-errors --with-jvm-variants=zero
--openjdk-target=aarch64-apple-darwin --with-extra-cflags='-arch arm64'
--with-extra-ldflags='-arch arm64 -F/Path/To/Folder/Containing/JNF_framework/'
—with-extra-cxxflags='-arch arm64’
JNF.framework is missing arm64 part as of next macos release, but Apple has
opensourced it.
Fix to adlc were needed due to it using symbols from stdc++ and not linking to
it, so it fails when doing make images.
The webrev: http://cr.openjdk.java.net/~vkempik/8250876/webrev.00/
The bug: https://bugs.openjdk.java.net/browse/JDK-8250876
Testing: jdk/submit.
Thanks, Vladimir.
Coming late to the party, as I see this has already been pushed. But
one thing caught my eye.
------------------------------------------------------------------------------
42 else ifeq ($(call isBuildOs, macosx), true)
43 ADLC_LDFLAGS := -lc++
I'm surprised this is needed. I expected the C++ toolchain to
implicitly include that, the way g++ does.
If something like this really is needed, then it seems like it should
be ADLC_LIBS that should be modified, rather than ADLC_LDFLAGS.
Though I noticed there are currently no assignments to ADLC_LIBS.
I'm similarly surprised by this pre-existing bit in CoreLibraries.gmk:
$(eval $(call SetupJdkLibrary, BUILD_LIBJIMAGE, \
...
LIBS_unix := -ljvm -ldl $(LIBCXX), \
LIBS_macosx := -lc++, \
And that suggests a better place for all this (assuming its needed at
all) is in lib-std.m4, setting LIBCXX for macosx and using it where
needed.
Yes, that looks weird. Probably some left-over from the initial
integration of libjimage. I can build fine locally without it; I'm just
verifying that it also works in the CI. Thank you for noticing this!
/Magnus
------------------------------------------------------------------------------