Page 1 of 1

[ARM m32 LINUX] linking errors

Posted: Sun Jan 08, 2017 6:09
by ConSiGno
Here ya go:

Code: Select all

[ 19%] Linking CXX executable drawergen
CMakeFiles/drawergen.dir/drawergen.cpp.o: In function `llvm::InitializeNativeTarget()':
/usr/lib/llvm-3.9/include/llvm/Support/TargetSelect.h:119: undefined reference to `LLVMInitializeARMTargetInfo'
/usr/lib/llvm-3.9/include/llvm/Support/TargetSelect.h:120: undefined reference to `LLVMInitializeARMTarget'
/usr/lib/llvm-3.9/include/llvm/Support/TargetSelect.h:121: undefined reference to `LLVMInitializeARMTargetMC'
CMakeFiles/drawergen.dir/drawergen.cpp.o: In function `llvm::InitializeNativeTargetAsmPrinter()':
/usr/lib/llvm-3.9/include/llvm/Support/TargetSelect.h:133: undefined reference to `LLVMInitializeARMAsmPrinter'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
tools/drawergen/CMakeFiles/drawergen.dir/build.make:905: recipe for target 'tools/drawergen/drawergen' failed
make[2]: *** [tools/drawergen/drawergen] Error 1
CMakeFiles/Makefile2:463: recipe for target 'tools/drawergen/CMakeFiles/drawergen.dir/all' failed
make[1]: *** [tools/drawergen/CMakeFiles/drawergen.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
So close, yet so far.

ARMv8 CortexA57 Raspberri Pi 3, Debian Jessie.

Re: [ARM m32 LINUX] linking errors

Posted: Sun Jan 08, 2017 6:22
by Rachael
Interesting - it uses LLVM 3.9. Unfortunately, I am not familiar with this code enough, so I can offer very little assistance with it at this time. :(

Re: [ARM m32 LINUX] linking errors

Posted: Sun Jan 08, 2017 6:23
by ConSiGno
Hey,everything compiles up to that point! :)

Re: [ARM m32 LINUX] linking errors

Posted: Sun Jan 08, 2017 6:37
by Rachael
Actually, it's encouraging to know that Debian Jessie uses an updated LLVM. Still - the fact that it's broken in Ubuntu repositories is a huge problem and that is what has stalled development at this point.

If I have some extra time tomorrow, I'll see about installing Jessie on my SD card. Or I may just add its repositories to my sources list - but I will definitely need someone to test its implementation to make sure everything works okay.

Re: [ARM m32 LINUX] linking errors

Posted: Sun Jan 08, 2017 7:46
by ConSiGno
I'll be here for sure. I'll be on ZDoom IRC so ping me there. :)

Re: [ARM m32 LINUX] linking errors

Posted: Sun Jan 08, 2017 8:44
by _mental_
I'm using LLVM 3.9 for macOS devbuilds with no problem at all. So x64 works fine, it's something specific to ARM taking into account names of missing symbols.

Re: [ARM m32 LINUX] linking errors

Posted: Sun Jan 08, 2017 9:41
by dpJudas
It is because it only lists the x86 libraries in the list of LLVM components to link with. We need some if statement in the CMakeLists.txt that makes it use the ARM components. They are named as follows: "armasmprinter arminfo armdesc armutils armcodegen".

I'm assuming it will complain about a couple of SSE intrinsics being used after this (when it runs the drawergen tool), but those can be fixed with some #ifdefs once the building part is up and running.

Re: [ARM m32 LINUX] linking errors

Posted: Sun Jan 08, 2017 11:45
by Graf Zahl
I think that you should consider providing the precompiled LLVM output as part of the repo to avoid going through the hassle of having the users of your source compile it. In fact, I think it should be a completely separate project for those interested in this stuff, but the general user should not have to bother with this part, maybe only when they use a compiler toolchain that requires something different than what is provided.

Re: [ARM m32 LINUX] linking errors

Posted: Sun Jan 08, 2017 12:10
by dpJudas
Well, the user only has to deal with it on Linux because that's more or less an intentional feature of the entire platform. I could create a .deb or .rpm package for them, but unless that is all statically linked it will only work on one specific release for one specific distribution. At the time I wrote the LLVM thing didn't even consider the possibility that Linux would have totally destroyed their LLVM packages. That something this high profile can be so broken for so long on Linux is just.. well what can I say - someone elsewhere in the Linux community is doing a very poor job here.

The output of drawergen is currently an object file. A x86/x64 build of it would therefore not have worked on ARM - but you do have a point that adding the outputted .obj file for each supported architecture certainly is an option. I've added a define yesterday that allows the main codebase to compile without having this obj file linked in, although the catch is that this means no softpoly drawers and no truecolor drawers.

Re: [ARM m32 LINUX] linking errors

Posted: Mon Jan 09, 2017 3:00
by ConSiGno
yeowch, you're right:

Code: Select all

Scanning dependencies of target drawergen_target
Target triple is armv7l-unknown-linux-gnueabihf
Compiling drawer code for pentium4..
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
'pentium4' is not a recognized processor for this target (ignoring processor)
LLVM fatal error: Do not know how to split the result of this operator!
src/CMakeFiles/drawergen_target.dir/build.make:57: recipe for target 'src/CMakeFiles/drawergen_target' failed
make[2]: *** [src/CMakeFiles/drawergen_target] Error 1
CMakeFiles/Makefile2:923: recipe for target 'src/CMakeFiles/drawergen_target.dir/all' failed
make[1]: *** [src/CMakeFiles/drawergen_target.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Re: [ARM m32 LINUX] linking errors

Posted: Mon Jan 09, 2017 3:30
by Rachael
That particular problem should be solved, but I still haven't done the SSE intrinsics yet.