diff --git a/src/main/java/com/gluonhq/substrate/feature/GluonFeature.java b/src/main/java/com/gluonhq/substrate/feature/GluonFeature.java index 192f17ee..38720ddf 100644 --- a/src/main/java/com/gluonhq/substrate/feature/GluonFeature.java +++ b/src/main/java/com/gluonhq/substrate/feature/GluonFeature.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Gluon + * Copyright (c) 2021, 2023, Gluon * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,8 +29,6 @@ import com.oracle.svm.core.jdk.NativeLibrarySupport; import com.oracle.svm.core.jdk.PlatformNativeLibrarySupport; -import com.oracle.svm.hosted.FeatureImpl.BeforeAnalysisAccessImpl; -import com.oracle.svm.hosted.c.NativeLibraries; import org.graalvm.nativeimage.hosted.Feature; diff --git a/src/main/java/com/gluonhq/substrate/target/AbstractTargetConfiguration.java b/src/main/java/com/gluonhq/substrate/target/AbstractTargetConfiguration.java index d95d5ab5..070df97e 100644 --- a/src/main/java/com/gluonhq/substrate/target/AbstractTargetConfiguration.java +++ b/src/main/java/com/gluonhq/substrate/target/AbstractTargetConfiguration.java @@ -83,7 +83,8 @@ public abstract class AbstractTargetConfiguration implements TargetConfiguration "-H:+ReportExceptionStackTraces", "-H:-DeadlockWatchdogExitOnTimeout", "-H:DeadlockWatchdogInterval=0", - "-H:+RemoveSaturatedTypeFlows" + "-H:+RemoveSaturatedTypeFlows", + "--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED" // Required for GluonFeature ); private static final List verboseNativeImageArguments = Arrays.asList( "-H:+PrintAnalysisCallTree", diff --git a/src/main/java/com/gluonhq/substrate/target/LinuxTargetConfiguration.java b/src/main/java/com/gluonhq/substrate/target/LinuxTargetConfiguration.java index e6087ace..73f4d542 100644 --- a/src/main/java/com/gluonhq/substrate/target/LinuxTargetConfiguration.java +++ b/src/main/java/com/gluonhq/substrate/target/LinuxTargetConfiguration.java @@ -63,6 +63,13 @@ public class LinuxTargetConfiguration extends PosixTargetConfiguration { "java", "nio", "zip", "net", "prefs", "j2pkcs11", "sunec", "extnet", "fdlibm", "fontmanager", "javajpeg", "lcms", "awt_headless", "awt" ); + /** + * fdlibm no longer required, unsure since when + */ + private static final List staticJavaLibs21 = Arrays.asList( + "java", "nio", "zip", "net", "prefs", "j2pkcs11", "sunec", "extnet", + "fontmanager", "javajpeg", "lcms", "awt_headless", "awt" + ); private static final List staticJvmLibs = Arrays.asList( "jvm", "libchelper" @@ -232,7 +239,13 @@ List getStaticJavaLibs() { } catch (IOException ex) { throw new RuntimeException ("No static java libs found, cannot continue"); } - return staticJavaLibs.stream() + List libs; + if (javaVersion.getMajor() >= 21) { + libs = staticJavaLibs21; + } else { + libs = staticJavaLibs; + } + return libs.stream() .map(lib -> javaStaticLibPath.resolve("lib" + lib + ".a").toString()) .collect(Collectors.toList()); }