[ASMJIT] All ARM builds fail on linking

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Csonicgo
Posts: 1193
Joined: Thu Apr 15, 2004 3:28 pm
Location: Leeds

[ASMJIT] All ARM builds fail on linking

Post by Csonicgo »

Likely an oversight, as I am the only few people running ARM :lol:

Code: Select all

CMakeFiles/zdoom.dir/scripting/vm/jit_runtime.cpp.o: In function `JitRelease()':
jit_runtime.cpp:(.text+0x3cc): undefined reference to `__deregister_frame'
CMakeFiles/zdoom.dir/scripting/vm/jit_runtime.cpp.o: In function `CreateUnwindInfoUnix(asmjit::CCFunc*, unsigned int&) [clone .constprop.25]':
jit_runtime.cpp:(.text+0xc9c): undefined reference to `asmjit::X86Assembler::X86Assembler(asmjit::CodeHolder*)'
jit_runtime.cpp:(.text+0x1844): undefined reference to `asmjit::X86Assembler::~X86Assembler()'
jit_runtime.cpp:(.text+0x1aec): undefined reference to `asmjit::X86Assembler::~X86Assembler()'
CMakeFiles/zdoom.dir/scripting/vm/jit_runtime.cpp.o: In function `AddJitFunction(asmjit::CodeHolder*, JitCompiler*)':
jit_runtime.cpp:(.text+0x1ce4): undefined reference to `__register_frame'
CMakeFiles/zdoom.dir/scripting/vm/jit.cpp.o: In function `JitCompile(VMScriptFunction*)':
jit.cpp:(.text+0x4744): undefined reference to `asmjit::X86Compiler::X86Compiler(asmjit::CodeHolder*)'
jit.cpp:(.text+0x4880): undefined reference to `asmjit::X86Compiler::~X86Compiler()'
CMakeFiles/zdoom.dir/scripting/vm/jit.cpp.o: In function `JitCompiler::Codegen()':
jit.cpp:(.text+0x53d0): undefined reference to `asmjit::X86Compiler::finalize()'
CMakeFiles/zdoom.dir/scripting/vm/jit.cpp.o: In function `JitDumpLog(_IO_FILE*, VMScriptFunction*)':
jit.cpp:(.text+0x6260): undefined reference to `asmjit::X86Compiler::X86Compiler(asmjit::CodeHolder*)'
jit.cpp:(.text+0x63ac): undefined reference to `asmjit::X86Compiler::~X86Compiler()'
CMakeFiles/zdoom.dir/scripting/vm/jit.cpp.o: In function `JitCompiler::~JitCompiler()':
jit.cpp:(.text._ZN11JitCompilerD2Ev[_ZN11JitCompilerD5Ev]+0x6c): undefined reference to `asmjit::X86Compiler::~X86Compiler()'
collect2: error: ld returned 1 exit status
src/CMakeFiles/zdoom.dir/build.make:12816: recipe for target 'gzdoom' failed
make[2]: *** [gzdoom] Error 1
CMakeFiles/Makefile2:1031: recipe for target 'src/CMakeFiles/zdoom.dir/all' failed
make[1]: *** [src/CMakeFiles/zdoom.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [ASMJIT] All ARM builds fail on linking

Post by Rachael »

Are you linking the legacy version or the modern version? 32-bit or 64-bit? Either way, unless ARM SOC's get a GPU upgrade, I am not sure how much is worth investing in this.
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: [ASMJIT] All ARM builds fail on linking

Post by dpJudas »

This is mostly a question of fixing CMakeLists.txt to not include the jit*.cpp files when asmjit isn't included. There may be 4 functions that also needs empty dummy functions (JitCompile, JitDumpLog, JitRelease and JitCaptureStackTrace).
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [ASMJIT] All ARM builds fail on linking

Post by Rachael »

I am not sure, but I have a sneaky suspicion that it would link properly on 32-bit due to the exceptions already put in place for IA32 to allow linking. That is the reason why I am asking her these questions. I want to fix this, but I also want to do the fix right, and if ARM32 is working and ARM64 is not, then it's just a question of detecting the architecture and not the bits.
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: [ASMJIT] All ARM builds fail on linking

Post by dpJudas »

The way I made x86 work was a bit of a hack. Asmjit does have x86 support, so it links it in and it could theoretically even run the JIT there with no linker errors. It is mainly because it is crashing and I don't want to fix the pointer size related bugs.

ARM is different because here there is no Asmjit support. CMake correctly identifies this and doesn't link in asmjit - hence the linker errors. In other words, to make it work on ARM the code needs to stop calling Asmjit functions completely. This is easiest done by not including the jit*.cpp files and then make stubs for the outer interface (the four functions I mentioned).
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: [ASMJIT] All ARM builds fail on linking

Post by _mental_ »

Should be fixed in 8892cb6.
Post Reply

Return to “Closed Bugs [GZDoom]”