Ricardo Wurmus <rek...@elephly.net> writes:

> Ricardo Wurmus <rek...@elephly.net> writes:
>
>> I have confirmed that this is the problem by replacing “while
>> (VMFile.exists(file.path))” with “while (false)”.  The build doesn’t
>> fully complete then either, but it gets past the compilation of the Ant
>> source files.  This clears JamVM and Jikes.
>
> It doesn’t.
>
> VMFile.exists always returns “true”, no matter what.  The C part is
> fine, but the Java part is not, so I suspected the JVM to be at fault.
>
> I managed to build ant-bootstrap successfully with this patch: […]

Here’s a shorter patch:

--8<---------------cut here---------------start------------->8---
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 403c446a82..bd98784232 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -152,6 +152,13 @@ and binary format defined in The Java Virtual Machine 
Specification.")
              "--disable-gjdoc")
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'foo
+           (lambda _
+             (substitute* "native/jni/java-io/java_io_VMFile.c"
+               (("result = cpio_isFileExists.*" m)
+                (string-append m "
+//Without a long comment the Java side will return \"true\" on x86_64 all the 
time.")))
+             #t))
          (add-after 'install 'install-data
            (lambda _ (invoke "make" "install-data"))))))
     (native-inputs
--8<---------------cut here---------------end--------------->8---

This only adds a comment.  If the comment is too short it won’t work.

I suspected some misguided optimizations, so I built jamvm-1-bootstrap
and classpath-bootstrap with -O0, -O1, and I disabled stripping of
binaries, but to no avail.

Any ideas?

--
Ricardo


Reply via email to