Skip to content

Commit

Permalink
Migrate patch to 24.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Oct 20, 2024
1 parent afd9845 commit 2b797c5
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 146 deletions.
145 changes: 0 additions & 145 deletions mx.trufflesqueak/graalvm-24.0.2.patch

This file was deleted.

50 changes: 50 additions & 0 deletions mx.trufflesqueak/graalvm-24.1.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
diff --git a/sdk/src/org.graalvm.launcher.native/src/launcher.cc b/sdk/src/org.graalvm.launcher.native/src/launcher.cc
index a5ee4d97a47..6b4157b77cd 100644
--- a/sdk/src/org.graalvm.launcher.native/src/launcher.cc
+++ b/sdk/src/org.graalvm.launcher.native/src/launcher.cc
@@ -263,7 +263,7 @@ static void *load_jli_lib(std::string exeDir) {

/* load the language library (either native library or libjvm) and return a
* pointer to the JNI_CreateJavaVM function */
-static CreateJVM load_vm_lib(std::string liblangPath) {
+static CreateJVM load_vm_lib(bool jvmMode, std::string liblangPath) {
if (debug) {
std::cout << "Loading library " << liblangPath << std::endl;
}
@@ -277,6 +277,14 @@ static CreateJVM load_vm_lib(std::string liblangPath) {
std::cerr << "Error while loading " << liblangPath << ":" << std::endl << errorString << std::endl;
}
#else
+ if (!jvmMode) {
+ std::string exeDir = exe_directory();
+ std::stringstream languageLibPath;
+ languageLibPath << exeDir << DIR_SEP_STR << ".." << DIR_SEP_STR << "lib";
+ if (SetDllDirectory(languageLibPath.str().c_str()) == 0) {
+ std::cerr << "Error adding dll search path: " << languageLibPath.str() << std::endl;
+ }
+ }
HMODULE jvmHandle = LoadLibraryA(liblangPath.c_str());
if (jvmHandle != NULL) {
return (CreateJVM) GetProcAddress(jvmHandle, "JNI_CreateJavaVM");
@@ -723,7 +731,7 @@ static int jvm_main_thread(int argc, char *argv[], std::string exeDir, bool jvmM

/* load VM library - after parsing arguments s.t. NMT
* tracking variable is already set */
- CreateJVM createVM = load_vm_lib(libPath);
+ CreateJVM createVM = load_vm_lib(jvmMode, libPath);
if (!createVM) {
std::cerr << "Could not load JVM." << std::endl;
return -1;
diff --git a/truffle/src/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java b/truffle/src/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java
index 10b976c323e..18e3fd6a8a8 100644
--- a/truffle/src/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java
+++ b/truffle/src/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java
@@ -175,7 +175,7 @@ public final class NodeUtil {
current = current.getParent();
} while (current != null);

- if (!(prev instanceof ExecutableNode)) {
+ if (prev.isAdoptable() && !(prev instanceof ExecutableNode)) {
failNotAdopted(node, prev);
}
return true;
2 changes: 1 addition & 1 deletion mx.trufflesqueak/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ shallow-clone-graalvm-project() {
shallow-clone-graal() {
shallow-clone-graalvm-project https://github.com/oracle/graal.git "${GRAAL_VERSION}"
echo "[graal repo (${GRAAL_VERSION}) cloned successfully]"
$(cd ${BASE_DIRECTORY}/../graal && git apply "${SCRIPT_DIRECTORY}/graalvm-24.0.2.patch")
$(cd ${BASE_DIRECTORY}/../graal && git apply "${SCRIPT_DIRECTORY}/graalvm-24.1.1.patch")
echo "[graal repo patched successfully]"
}

Expand Down

0 comments on commit 2b797c5

Please sign in to comment.