Source: openjfx
Followup-For: Bug #1021894

I was surprised to find that this package was missing on arm64 (making josm 
uninstallable) so I investigated. 

11.0.11+0-1 built OK on 2021-02-03. But 11.0.11+1-3 FTBFS.

11.0.11+0-1 no longer builds either. Failing in:
Execution failed for task ':media:buildAVPlugin'
../../../plugins/av/decoder.c:79:5: error: implicit declaration of function 
'avcodec_register_all'
which seems to be a problem with ffmpeg, but lets ignore that for now - it 
seems to be fixed with a patch in +1-3

11.0.11+1-3 fails with:
[ 28%] Building CXX object 
Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/llint/LLIntOffsetsExtractor.cpp.o
        Gradle is still running, please be patient...
In file included from 
/<<PKGBUILDDIR>>/modules/javafx.web/src/main/native/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h:30,
                 from 
/<<PKGBUILDDIR>>/modules/javafx.web/src/main/native/Source/JavaScriptCore/assembler/MacroAssembler.h:46,
                 from 
/<<PKGBUILDDIR>>/modules/javafx.web/src/main/native/Source/JavaScriptCore/jit/GPRInfo.h:28,
                 from 
/<<PKGBUILDDIR>>/modules/javafx.web/src/main/native/Source/JavaScriptCore/bytecode/ArithProfile.h:28,
                 from 
/<<PKGBUILDDIR>>/modules/javafx.web/src/main/native/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp:28:
/<<PKGBUILDDIR>>/modules/javafx.web/src/main/native/Source/JavaScriptCore/assembler/ARM64Assembler.h:
 In static member function ‘static void 
JSC::ARM64Assembler::replaceWithJump(void*, void*)’:
/<<PKGBUILDDIR>>/modules/javafx.web/src/main/native/Source/JavaScriptCore/assembler/ARM64Assembler.h:2576:51:
 error: ‘class JSC::ExecutableAllocator’ has no member named ‘getJumpIslandTo’
 2576 |             to = 
ExecutableAllocator::singleton().getJumpIslandTo(where, to);
      |                                                   ^~~~~~~~~~~~~~~
/<<PKGBUILDDIR>>/modules/javafx.web/src/main/native/Source/JavaScriptCore/assembler/ARM64Assembler.h:
 In static member function ‘static void* 
JSC::ARM64Assembler::prepareForAtomicRelinkJumpConcurrently(void*, void*)’:
/<<PKGBUILDDIR>>/modules/javafx.web/src/main/native/Source/JavaScriptCore/assembler/ARM64Assembler.h:2781:49:
 error: ‘class JSC::ExecutableAllocator’ has no member named 
‘getJumpIslandToConcurrently’
 2781 |         return 
ExecutableAllocator::singleton().getJumpIslandToConcurrently(from, to);
      |                                                 
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/<<PKGBUILDDIR>>/modules/javafx.web/src/main/native/Source/JavaScriptCore/assembler/ARM64Assembler.h:
 In static member function ‘static void 
JSC::ARM64Assembler::linkJumpOrCall(int*, const int*, void*)’:
/<<PKGBUILDDIR>>/modules/javafx.web/src/main/native/Source/JavaScriptCore/assembler/ARM64Assembler.h:3024:51:
 error: ‘class JSC::ExecutableAllocator’ has no member named ‘getJumpIslandTo’
 3024 |             to = 
ExecutableAllocator::singleton().getJumpIslandTo(bitwise_cast<void*>(fromInstruction),
 to);
      |                                                   ^~~~~~~~~~~~~~~

(Which is actually a different failure point from the one Sebastian posted in 
this bug)

So all this jumpisland stuff comes from webkit's JavaScript JIT.

It turns out that this upstream Webkit bug explains what's going on:
https://bugs.webkit.org/show_bug.cgi?id=217079
jumpislands allow +-128MB jumps to get to the whole 1GB executable space by 
having a particular memory layout.
And the build should use _either_ the JIT or 'CLOOP', but not both.

Applying the patch in that bug (which gates JUMP_ISLANDS on the JIT
being enabled, and avoids compiling in a call to dumpJITMemory if JIT
is disabled) allows everything to get compiled. However it then fails
to link:
 
[100%] Linking CXX shared library ../../lib/libjfxwebkit.so
/usr/include/c++/11/ext/new_allocator.h:116: error: undefined reference to 
'std::__throw_bad_array_new_length()'
collect2: error: ld returned 1 exit status
gmake[4]: *** [Source/WebKitLegacy/CMakeFiles/WebKitLegacy.dir/build.make:2237: 
lib/libjfxwebkit.so] Error 1

Which seems to be a problem with compiling with gcc11/12, but then trying
to link to the gcc-libstd++ from gcc10.  Removing all the gcc-10
packages from the build environment fixed this. I think this means
the package should get a build-conflict on libstdc++-10-dev

Also the discussion in the above bug suggests that the JIT should in fact be 
enabled on debian arm64.
It only needs to be turned off on iOS and 64k aarch64 kernel (RHEL). I will 
test that next.

Attached is the debdiff that at least makes the build work again for now. Happy 
to do an NMU if that's helpful
diff -Nru openjfx-11.0.11+1/debian/changelog openjfx-11.0.11+1/debian/changelog
--- openjfx-11.0.11+1/debian/changelog  2023-02-07 14:59:22.000000000 +0000
+++ openjfx-11.0.11+1/debian/changelog  2023-07-14 11:53:33.000000000 +0000
@@ -1,3 +1,10 @@
+openjfx (11.0.11+1-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Apply patch from webkit #217079 so arm64 builds again
+
+ -- Wookey <woo...@debian.org>  Fri, 14 Jul 2023 11:53:33 +0000
+
 openjfx (11.0.11+1-3) unstable; urgency=medium
 
   * Team upload.
diff -Nru openjfx-11.0.11+1/debian/patches/38-javadoc.patch 
openjfx-11.0.11+1/debian/patches/38-javadoc.patch
diff -Nru openjfx-11.0.11+1/debian/patches/series 
openjfx-11.0.11+1/debian/patches/series
--- openjfx-11.0.11+1/debian/patches/series     2023-02-07 14:59:22.000000000 
+0000
+++ openjfx-11.0.11+1/debian/patches/series     2023-07-12 00:09:09.000000000 
+0000
@@ -20,3 +20,4 @@
 36-disable-swt-on-32bit-arch.patch
 disable-ffmpeg.patch
 38-javadoc.patch
+webkit-217079-only-use-jumpislands-with-JIT.patch
diff -Nru 
openjfx-11.0.11+1/debian/patches/webkit-217079-only-use-jumpislands-with-JIT.patch
 
openjfx-11.0.11+1/debian/patches/webkit-217079-only-use-jumpislands-with-JIT.patch
--- 
openjfx-11.0.11+1/debian/patches/webkit-217079-only-use-jumpislands-with-JIT.patch
  1970-01-01 00:00:00.000000000 +0000
+++ 
openjfx-11.0.11+1/debian/patches/webkit-217079-only-use-jumpislands-with-JIT.patch
  2023-07-12 01:33:04.000000000 +0000
@@ -0,0 +1,48 @@
+Description: Fix code from Webkit to build on arm64 when JIT is disabled
+        REGRESSION(r259582): Build fails on aarch64 Linux with WebKit 2.30.1 
on LLIntOffsetsExtractor.cpp.o
+        * assembler/LinkBuffer.cpp:
+        (JSC::LinkBuffer::copyCompactAndLinkCode): DOn't compile in a call to
+        dumpJITMemory if JIT is disabled; leads to a build failure.
+        * wtf/PlatformEnable.h: Only define USE_JUMP_ISLANDS if JIT is enabled.
+       This patch is a workaround rather than a proper fix. See bug discussion
+Bug:    https://bugs.webkit.org/show_bug.cgi?id=217079
+Author: Mike Gorse  <mgo...@suse.com>
+Last-Update:   2020-09-30
+
+
+
+Index: 
openjfx-11.0.11+1/modules/javafx.web/src/main/native/Source/WTF/wtf/PlatformEnable.h
+===================================================================
+--- 
openjfx-11.0.11+1.orig/modules/javafx.web/src/main/native/Source/WTF/wtf/PlatformEnable.h
++++ 
openjfx-11.0.11+1/modules/javafx.web/src/main/native/Source/WTF/wtf/PlatformEnable.h
+@@ -882,6 +882,6 @@
+ #error "ENABLE(WEBGL2) requires ENABLE(WEBGL)"
+ #endif
+ 
+-#if CPU(ARM64) && CPU(ADDRESS64)
++#if CPU(ARM64) && CPU(ADDRESS64) && ENABLE(JIT)
+ #define USE_JUMP_ISLANDS 1
+ #endif
+Index: 
openjfx-11.0.11+1/modules/javafx.web/src/main/native/Source/JavaScriptCore/assembler/LinkBuffer.cpp
+===================================================================
+--- 
openjfx-11.0.11+1.orig/modules/javafx.web/src/main/native/Source/JavaScriptCore/assembler/LinkBuffer.cpp
++++ 
openjfx-11.0.11+1/modules/javafx.web/src/main/native/Source/JavaScriptCore/assembler/LinkBuffer.cpp
+@@ -374,6 +374,7 @@ void LinkBuffer::copyCompactAndLinkCode(
+         m_executableMemory->shrink(m_size);
+     }
+ 
++#if ENABLE(JIT)
+     if (useFastJITPermissions()) {
+         ASSERT(codeOutData == outData);
+         if (UNLIKELY(Options::dumpJITMemoryPath()))
+@@ -382,6 +383,10 @@ void LinkBuffer::copyCompactAndLinkCode(
+         ASSERT(codeOutData != outData);
+         performJITMemcpy(codeOutData, outData, m_size);
+     }
++#else
++    ASSERT(codeOutData != outData);
++    performJITMemcpy(codeOutData, outData, m_size);
++#endif // ENABLE_JIT
+ 
+     jumpsToLink.clear();
+ 

Reply via email to