JetBrains / JetBrainsRuntime

Runtime environment based on OpenJDK for running IntelliJ Platform-based products on Windows, macOS, and Linux
GNU General Public License v2.0
1.35k stars 198 forks source link

main branch build fail on macos with xcode16 #461

Open Geker opened 2 months ago

Geker commented 2 months ago

The error information is as follows

os: macos 14.7 xcode version: 16

Compiling up to 4 files for COMPILE_CREATE_SYMBOLS
Compiling up to 68 files for COMPILE_CREATE_SYMBOLS
Exception in thread "main" java.lang.ClassFormatError: StackMapTable format error: bad verification type
    at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:64)
    at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:52)
gmake[3]: *** [Gendata.gmk:64: /Users/songqingqing/work/dev_projects/githubs/jetBrainsRuntime/build/macosx-aarch64-server-release/buildtools/create_symbols_javac/_the.COMPILE_CREATE_SYMBOLS_batch] Error 1
gmake[2]: *** [make/Main.gmk:139: jdk.compiler-gendata] Error 2
gmake[2]: *** Waiting for unfinished jobs....

ERROR: Build failed for target 'images' in configuration 'macosx-aarch64-server-release' (exit code 2)
Stopping javac server

=== Output from failing command(s) repeated here ===
* For target buildtools_create_symbols_javac__the.COMPILE_CREATE_SYMBOLS_batch:
Exception in thread "main" java.lang.ClassFormatError: StackMapTable format error: bad verification type
    at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:64)
    at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:52)

* All command lines available in /Users/songqingqing/work/dev_projects/githubs/jetBrainsRuntime/build/macosx-aarch64-server-release/make-support/failure-logs.
=== End of repeated output ===

No indication of failed target found.
HELP: Try searching the build log for '] Error'.
HELP: Run 'make doctor' to diagnose build problems.

make[1]: *** [main] Error 2
make: *** [images] Error 2
Geker commented 2 months ago

it's a clang bug,which was report on openjdk bugs https://bugs.openjdk.org/browse/JDK-8340341

bourgesl commented 2 months ago

I did the update to macos 14.7 + xcode 16 too yesterday.

Here is the patch that worked yesterday (derived from jbs file):

git diff make/autoconf/flags-cflags.m4

diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4
index 992a0282c04..cefadaee012 100644
--- a/make/autoconf/flags-cflags.m4
+++ b/make/autoconf/flags-cflags.m4
@@ -337,9 +337,9 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
       C_O_FLAG_HIGHEST="-O3 -finline-functions"
       C_O_FLAG_HI="-O3 -finline-functions"
     else
-      C_O_FLAG_HIGHEST_JVM="-O3"
-      C_O_FLAG_HIGHEST="-O3"
-      C_O_FLAG_HI="-O3"
+      C_O_FLAG_HIGHEST_JVM="-O1"
+      C_O_FLAG_HIGHEST="-O1"
+      C_O_FLAG_HI="-O1"
     fi
     C_O_FLAG_NORM="-O2"
     C_O_FLAG_DEBUG_JVM="-O0"