CONFIGURE: sh configure \ --openjdk-target=aarch64-macos-ios \ --with-build-jdk=/pt/jdk-23.jdk/Contents/Home Make sure to have CUPS installed on the referred path! ISSUE: configure: error: unsupported operating system ios /Users/johan/openjdk/github/jdk/build/.configure-support/generated-configure.sh: line 84: 5: Bad file descriptor SOLUTION: add ios in platform.m4: diff --git a/make/autoconf/platform.m4 b/make/autoconf/platform.m4 index 6aaf3b87f8d..6d49d6936ef 100644 --- a/make/autoconf/platform.m4 +++ b/make/autoconf/platform.m4 @@ -202,6 +202,10 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS], VAR_OS=android VAR_OS_TYPE=unix ;; + *ios*) + VAR_OS=ios + VAR_OS_TYPE=unix + ;; *linux*) VAR_OS=linux VAR_OS_TYPE=unix ISSUE: checking for fontconfig/fontconfig.h... no configure: error: Could not find fontconfig! SOLUTION: don't use fontconfig in libraries.m4 diff --git a/make/autoconf/libraries.m4 b/make/autoconf/libraries.m4 index d8c65109f67..2d255ec664a 100644 --- a/make/autoconf/libraries.m4 +++ b/make/autoconf/libraries.m4 @@ -52,7 +52,7 @@ AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES], fi # Check if fontconfig is needed - if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then + if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xios; then # No fontconfig support on windows or macosx NEEDS_LIB_FONTCONFIG=false else ISSUE: configure: error: Could not find freetype! You might be able to fix this by running 'brew install freetype'. SOLUTION: no freetype. diff --git a/make/autoconf/lib-freetype.m4 b/make/autoconf/lib-freetype.m4 index d0859f36cc4..02185dedc1d 100644 --- a/make/autoconf/lib-freetype.m4 +++ b/make/autoconf/lib-freetype.m4 @@ -104,6 +104,7 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], if test "x$OPENJDK_TARGET_OS" != "xwindows" && \ test "x$OPENJDK_TARGET_OS" != "xmacosx" && \ test "x$OPENJDK_TARGET_OS" != "xandroid" && \ + test "x$OPENJDK_TARGET_OS" != "xios" && \ test "x$OPENJDK_TARGET_OS" != "xaix"; then FREETYPE_TO_USE=system fi ISSUE: configure: error: Could not find X11 libraries. SOLUTION: no X11 diff --git a/make/autoconf/libraries.m4 b/make/autoconf/libraries.m4 index d8c65109f67..779fc8f72e2 100644 --- a/make/autoconf/libraries.m4 +++ b/make/autoconf/libraries.m4 @@ -42,7 +42,7 @@ m4_include([lib-tests.m4]) AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES], [ # Check if X11 is needed - if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xandroid; then + if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xandroid || test "x$OPENJDK_TARGET_OS" = xios; then # No X11 support on windows or macosx NEEDS_LIB_X11=false else Configure then works, now make cd build/ios-aarch64-minimal-release make static-libs-image add c1_globals_ios.hpp add globals_ios.hpp ISSUE: In file included from /Users/johan/openjdk/github/jdk/src/hotspot/share/runtime/mutex.hpp:30: /Users/johan/openjdk/github/jdk/src/hotspot/share/runtime/semaphore.hpp:34:11: fatal error: 'semaphore_ios.hpp' file not found SOLUTION: tell build system we're sort of LINUX, but also add __IOS__ to be able to leverage Apple headers if we want to. diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 index e3aca36ad23..f846ab67ffb 100644 --- a/make/autoconf/flags-cflags.m4 +++ b/make/autoconf/flags-cflags.m4 @@ -468,6 +468,8 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER], elif test "x$OPENJDK_TARGET_OS" = xandroid; then CFLAGS_OS_DEF_JVM="-target aarch64-linux-android -DLINUX -D_ALLBSD_SOURCE -DANDROID" CFLAGS_OS_DEF_JDK="-target aarch64-linux-android -DLINUX -D__USE_BSD" + elif test "x$OPENJDK_TARGET_OS" = xios; then + CFLAGS_OS_DEF_JVM="-DLINUX -D__IOS__" fi diff --git a/src/hotspot/share/utilities/globalDefinitions_gcc.hpp b/src/hotspot/share/utilities/globalDefinitions_gcc.hpp index e5decbcd536..3160cf0f2e5 100644 --- a/src/hotspot/share/utilities/globalDefinitions_gcc.hpp +++ b/src/hotspot/share/utilities/globalDefinitions_gcc.hpp @@ -61,7 +61,7 @@ #if defined(LINUX) || defined(_ALLBSD_SOURCE) || defined(_AIX) #include -#ifndef __OpenBSD__ +#if !defined(__OpenBSD__) && !defined(__IOS__) #include #endif #ifdef __APPLE__ Also, runtime/os.hpp will check for BSD before it checks Linux. Since we leverage a lot from Linux, we add an ios check before BSD #elif defined(__IOS__) class Linux; ISSUE: Linking with ar @ fails, needs to provide list of objectfiles diff --git a/make/common/native/Paths.gmk b/make/common/native/Paths.gmk index e021a390289..bbe5a72e4cb 100644 --- a/make/common/native/Paths.gmk +++ b/make/common/native/Paths.gmk @@ -213,7 +213,7 @@ define SetupObjectFileList # If we are building static library, 'AR' on macosx/aix may not support @-file. ifeq ($$($1_TYPE), STATIC_LIBRARY) - ifeq ($(call isTargetOs, macosx aix), true) + ifeq ($(call isTargetOs, macosx ios aix), true) $1_LD_OBJ_ARG := `cat $$($1_OBJ_FILE_LIST)` endif endif Java files ISSUE: No macosx classes included SOLUTION: diff --git a/make/common/Modules.gmk b/make/common/Modules.gmk index 38ba9f0c559..5de04e8e903 100644 --- a/make/common/Modules.gmk +++ b/make/common/Modules.gmk @@ -91,6 +91,9 @@ endif ifeq ($(OPENJDK_TARGET_OS), android) SRC_SUBDIRS += linux/classes endif +ifeq ($(OPENJDK_TARGET_OS), ios) + SRC_SUBDIRS += macosx/classes +endif SRC_SUBDIRS += share/classes ISSUE: int flags = followLinks ? 0 : CLONE_NOFOLLOW; SOLUTION: this is generated from src/java.base/unix/classes/sun/nio/fs/UnixConstants.java.template with a check on __ALLBSD_SOURCE diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 index e3aca36ad23..8227d512e4e 100644 --- a/make/autoconf/flags-cflags.m4 +++ b/make/autoconf/flags-cflags.m4 @@ -468,6 +468,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER], elif test "x$OPENJDK_TARGET_OS" = xandroid; then CFLAGS_OS_DEF_JVM="-target aarch64-linux-android -DLINUX -D_ALLBSD_SOURCE -DANDROID" CFLAGS_OS_DEF_JDK="-target aarch64-linux-android -DLINUX -D__USE_BSD" + elif test "x$OPENJDK_TARGET_OS" = xios; then + CFLAGS_OS_DEF_JVM="-DLINUX -D__IOS__ " + CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE" fi CFLAGS_OS_DEF_JDK="$CFLAGS_OS_DEF_JDK -D$OPENJDK_TARGET_OS_UPPERCASE" ISSUE: /Users/johan/openjdk/github/jdk/src/java.base/unix/native/libjava/TimeZone_md.c:500:14: error: call to undeclared function 'getPlatformTimeZoneID'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] tz = getPlatformTimeZoneID(); SOLUTION: diff --git a/src/java.base/unix/native/libjava/TimeZone_md.c b/src/java.base/unix/native/libjava/TimeZone_md.c index 988c4bd2646..7cc978a40f9 100644 --- a/src/java.base/unix/native/libjava/TimeZone_md.c +++ b/src/java.base/unix/native/libjava/TimeZone_md.c @@ -63,7 +63,7 @@ static const char popularZones[][4] = {"UTC", "GMT"}; static const char *ETC_ENVIRONMENT_FILE = "/etc/environment"; #endif -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(MACOSX) || defined(__IOS__) ISSUE: * For target support_native_jdk.management_libmanagement_ext_static_OperatingSystemImpl.o: /Users/johan/openjdk/github/jdk/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c:41:10: fatal error: 'sys/proc_info.h' file not found #include ^~~~~~~~~~~~~~~~~ SOLUTION: