[ASMJIT] All ARM builds fail on linking

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

[ASMJIT] All ARM builds fail on linking

Postby Csonicgo » Wed Jan 02, 2019 1:58 am

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

Code: Select allExpand view
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
Csonicgo
OPL Goddess
 
Joined: 15 Apr 2004
Location: Leeds

Re: [ASMJIT] All ARM builds fail on linking

Postby Rachael » Wed Jan 02, 2019 3:23 am

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.
User avatar
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004

Re: [ASMJIT] All ARM builds fail on linking

Postby dpJudas » Wed Jan 02, 2019 4:51 am

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).
dpJudas
 
 
 
Joined: 28 May 2016

Re: [ASMJIT] All ARM builds fail on linking

Postby Rachael » Wed Jan 02, 2019 5:07 am

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.
User avatar
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004

Re: [ASMJIT] All ARM builds fail on linking

Postby dpJudas » Wed Jan 02, 2019 5:20 am

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).
dpJudas
 
 
 
Joined: 28 May 2016


Return to Bugs

Who is online

Users browsing this forum: TweetMeme [Bot] and 3 guests