From 3dd30e5a12a1de9cd057fcd6448af99c4a38e07a Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Thu, 4 Jul 2024 15:37:09 +0200 Subject: [PATCH] Add support for libsvm_container.a in Mandrel Closes: https://github.com/graalvm/mandrel/issues/765 Depends on this upstream PR to be merged: https://github.com/oracle/graal/pull/8989 (cherry picked from commit d6ba9ca9cccfbdcc42ddf81b76771c7738d05516) --- build.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build.java b/build.java index 5ea095c..ad47972 100644 --- a/build.java +++ b/build.java @@ -44,6 +44,7 @@ public class build static final Logger logger = LogManager.getLogger(build.class); public static final boolean IS_WINDOWS = System.getProperty("os.name").matches(".*[Ww]indows.*"); public static final boolean IS_MAC = System.getProperty("os.name").matches(".*[Mm]ac.*"); + public static final boolean IS_LINUX = !IS_WINDOWS && !IS_MAC; public static final String JDK_VERSION = "jdk" + Runtime.version().feature(); public static final String MAVEN_VERSION_FILE = ".maven-version"; private static final String MANDREL_RELEASE_FILE = "mandrel.release"; @@ -186,8 +187,13 @@ public static void main(String... args) throws IOException else { Path libdarwinSource = null; + Path libContainerSource = null; Path libchelperSource = Path.of("substratevm", "mxbuild", PLATFORM, "com.oracle.svm.native.libchelper", PLATFORM, (IS_MAC ? "default" : "glibc"), "liblibchelper.a"); Path libjvmSource = Path.of("substratevm", "mxbuild", platformAndJDK, "com.oracle.svm.native.jvm.posix", PLATFORM, (IS_MAC ? "default" : "glibc"), "libjvm.a"); + if (IS_LINUX) + { + libContainerSource = Path.of("substratevm", "mxbuild", PLATFORM, "com.oracle.svm.native.libcontainer", PLATFORM, (IS_MAC ? "default" : "glibc"), "libsvm_container.a"); + } if (IS_MAC) { libdarwinSource = Path.of("substratevm", "mxbuild", PLATFORM, "com.oracle.svm.native.darwin", PLATFORM, "default", "libdarwin.a"); @@ -200,6 +206,10 @@ public static void main(String... args) throws IOException } FileSystem.copy(mandrelRepo.resolve(libchelperSource), clibsBasePath.resolve(Path.of("liblibchelper.a"))); FileSystem.copy(mandrelRepo.resolve(libjvmSource), clibsBasePath.resolve(Path.of("libjvm.a"))); + if (IS_LINUX) + { + FileSystem.copy(mandrelRepo.resolve(libContainerSource), clibsBasePath.resolve(Path.of("libsvm_container.a"))); + } if (IS_MAC) { FileSystem.copy(mandrelRepo.resolve(libdarwinSource), clibsBasePath.resolve(Path.of("libdarwin.a"))); @@ -884,6 +894,7 @@ class Mx { projects = "com.oracle.svm.native.libchelper," + "com.oracle.svm.native.reporterchelper," + + "com.oracle.svm.native.libcontainer," + "com.oracle.svm.native.jvm.posix"; if (build.IS_MAC) {