unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
blob 835113df719fe806a0f87ec57ed5e7c9ee13c034 1126 bytes (raw)
name: gnu/packages/patches/classpath-miscompilation.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
For some reason, the original code gets miscompiled on x86_64, leading
'Java_java_io_VMFile_isFile' to return true when the return value of
'cpio_checkType' is ENOENT (= 2).

See <https://issues.guix.gnu.org/issue/36685>
and <https://issues.guix.gnu.org/49990>.

diff --git a/native/jni/java-io/java_io_VMFile.c b/native/jni/java-io/java_io_VMFile.c
index de1320b..9a5d375 100644
--- a/native/jni/java-io/java_io_VMFile.c
+++ b/native/jni/java-io/java_io_VMFile.c
@@ -278,6 +278,7 @@ Java_java_io_VMFile_isFile (JNIEnv * env,
   const char *filename;
   int result;
   jint entryType;
+  jboolean isfile;
 
   /* Don't use the JCL convert function because it throws an exception
      on failure */
@@ -288,9 +289,10 @@ Java_java_io_VMFile_isFile (JNIEnv * env,
     }
 
   result = cpio_checkType (filename, &entryType);
+  isfile = (result == CPNATIVE_OK && entryType == CPFILE_FILE ? 1 : 0);
   (*env)->ReleaseStringUTFChars (env, name, filename);
 
-  return result == CPNATIVE_OK && entryType == CPFILE_FILE ? 1 : 0;
+  return isfile;
 #else /* not WITHOUT_FILESYSTEM */
   return 0;
 #endif /* not WITHOUT_FILESYSTEM */

debug log:

solving 835113df71 ...
found 835113df71 in https://yhetil.org/guix-bugs/878s0h8cu0.fsf@gnu.org/

applying [1/1] https://yhetil.org/guix-bugs/878s0h8cu0.fsf@gnu.org/
diff --git a/gnu/packages/patches/classpath-miscompilation.patch b/gnu/packages/patches/classpath-miscompilation.patch
new file mode 100644
index 0000000000..835113df71

1:23: trailing whitespace.
 
1:28: trailing whitespace.
 
1:32: trailing whitespace.
 
Checking patch gnu/packages/patches/classpath-miscompilation.patch...
Applied patch gnu/packages/patches/classpath-miscompilation.patch cleanly.
warning: 3 lines add whitespace errors.

index at:
100644 835113df719fe806a0f87ec57ed5e7c9ee13c034	gnu/packages/patches/classpath-miscompilation.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).