Github messages for voidlinux
 help / color / mirror / Atom feed
* [ISSUE] zig: cross-compile support
@ 2020-09-17 21:42 jjsullivan5196
  2020-09-17 22:07 ` jjsullivan5196
                   ` (29 more replies)
  0 siblings, 30 replies; 31+ messages in thread
From: jjsullivan5196 @ 2020-09-17 21:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 13213 bytes --]

New issue by jjsullivan5196 on void-packages repository

https://github.com/void-linux/void-packages/issues/24959

Description:
I've been trying to get the zig compiler cross-compiled to aarch64 (want to have it on the pinephone) but I'm getting snubbed by some linker errors. 

I took a look at the zig project's own [bootstrap package](https://github.com/ziglang/zig-bootstrap) and found that it needs an AVR codegen target for cross targets, and that the host zig compiler can be used to cross-compiler the later stages. I made appropriate changes to the [`llvm10` and `zig` templates](https://github.com/jjsullivan5196/void-packages/tree/zig-cross), on `aarch64` and `aarch64-musl` I can fully compile stage0 with `cross-gcc`, but I get this mess when it links

```
[ 97%] Linking CXX static library zig_cpp/libzigcompiler.a
[ 97%] Built target zigcompiler
Scanning dependencies of target zig0
[ 98%] Building CXX object CMakeFiles/zig0.dir/src/stage2.cpp.o
[ 98%] Building CXX object CMakeFiles/zig0.dir/src/main.cpp.o
[ 99%] Linking CXX executable zig0
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: /usr/aarch64-linux-gnu/usr/lib/libLLVMWindowsManifest.a(WindowsManifestMerger.cpp.o): in function `stripComments(_xmlNode*) [clone .isra.0]':
(.text._ZL13stripCommentsP8_xmlNode.isra.0+0x54): undefined reference to `xmlUnlinkNode'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZL13stripCommentsP8_xmlNode.isra.0+0x60): undefined reference to `xmlFreeNode'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: /usr/aarch64-linux-gnu/usr/lib/libLLVMWindowsManifest.a(WindowsManifestMerger.cpp.o): in function `searchOrDefine(unsigned char const*, _xmlNode*)':
(.text._ZL14searchOrDefinePKhP8_xmlNode+0x15c): undefined reference to `xmlNewNs'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: /usr/aarch64-linux-gnu/usr/lib/libLLVMWindowsManifest.a(WindowsManifestMerger.cpp.o): in function `llvm::windows_manifest::WindowsManifestMerger::WindowsManifestMergerImpl::~WindowsManifestMergerImpl()':
(.text._ZN4llvm16windows_manifest21WindowsManifestMerger25WindowsManifestMergerImplD2Ev+0x24): undefined reference to `xmlFreeDoc'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm16windows_manifest21WindowsManifestMerger25WindowsManifestMergerImplD2Ev+0x38): undefined reference to `xmlFree'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm16windows_manifest21WindowsManifestMerger25WindowsManifestMergerImplD2Ev+0x3c): undefined reference to `xmlFree'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: /usr/aarch64-linux-gnu/usr/lib/libLLVMWindowsManifest.a(WindowsManifestMerger.cpp.o): in function `treeMerge(_xmlNode*, _xmlNode*)':
(.text._ZL9treeMergeP8_xmlNodeS0_+0xc4): undefined reference to `xmlNewProp'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZL9treeMergeP8_xmlNodeS0_+0x120): undefined reference to `xmlStrdup'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZL9treeMergeP8_xmlNodeS0_+0x180): undefined reference to `xmlCopyNamespace'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZL9treeMergeP8_xmlNodeS0_+0x52c): undefined reference to `xmlUnlinkNode'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZL9treeMergeP8_xmlNodeS0_+0x538): undefined reference to `xmlAddChild'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZL9treeMergeP8_xmlNodeS0_+0x74c): undefined reference to `xmlFree'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZL9treeMergeP8_xmlNodeS0_+0x754): undefined reference to `xmlFree'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZL9treeMergeP8_xmlNodeS0_+0x924): undefined reference to `xmlFree'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZL9treeMergeP8_xmlNodeS0_+0x928): undefined reference to `xmlFree'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: /usr/aarch64-linux-gnu/usr/lib/libLLVMWindowsManifest.a(WindowsManifestMerger.cpp.o): in function `checkAndStripPrefixes(_xmlNode*, std::vector<_xmlNs*, std::allocator<_xmlNs*> >&)':
(.text._ZL21checkAndStripPrefixesP8_xmlNodeRSt6vectorIP6_xmlNsSaIS3_EE+0x2a8): undefined reference to `xmlFreeNs'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: /usr/aarch64-linux-gnu/usr/lib/libLLVMWindowsManifest.a(WindowsManifestMerger.cpp.o): in function `llvm::windows_manifest::WindowsManifestMerger::WindowsManifestMergerImpl::getMergedManifest()':
(.text._ZN4llvm16windows_manifest21WindowsManifestMerger25WindowsManifestMergerImpl17getMergedManifestEv+0x44): undefined reference to `xmlDocGetRootElement'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm16windows_manifest21WindowsManifestMerger25WindowsManifestMergerImpl17getMergedManifestEv+0x64): undefined reference to `xmlNewDoc'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm16windows_manifest21WindowsManifestMerger25WindowsManifestMergerImpl17getMergedManifestEv+0x70): undefined reference to `xmlDocSetRootElement'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm16windows_manifest21WindowsManifestMerger25WindowsManifestMergerImpl17getMergedManifestEv+0x78): undefined reference to `xmlKeepBlanksDefault'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm16windows_manifest21WindowsManifestMerger25WindowsManifestMergerImpl17getMergedManifestEv+0x98): undefined reference to `xmlDocDumpFormatMemoryEnc'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm16windows_manifest21WindowsManifestMerger25WindowsManifestMergerImpl17getMergedManifestEv+0xac): undefined reference to `xmlFree'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm16windows_manifest21WindowsManifestMerger25WindowsManifestMergerImpl17getMergedManifestEv+0xb0): undefined reference to `xmlFree'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm16windows_manifest21WindowsManifestMerger25WindowsManifestMergerImpl17getMergedManifestEv+0xc4): undefined reference to `xmlFreeDoc'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: /usr/aarch64-linux-gnu/usr/lib/libLLVMWindowsManifest.a(WindowsManifestMerger.cpp.o): in function `llvm::windows_manifest::WindowsManifestMerger::WindowsManifestMergerImpl::merge(llvm::MemoryBuffer const&)':
(.text._ZN4llvm16windows_manifest21WindowsManifestMerger25WindowsManifestMergerImpl5mergeERKNS_12MemoryBufferE+0x54): undefined reference to `xmlSetGenericErrorFunc'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm16windows_manifest21WindowsManifestMerger25WindowsManifestMergerImpl5mergeERKNS_12MemoryBufferE+0x70): undefined reference to `xmlReadMemory'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm16windows_manifest21WindowsManifestMerger25WindowsManifestMergerImpl5mergeERKNS_12MemoryBufferE+0x84): undefined reference to `xmlSetGenericErrorFunc'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm16windows_manifest21WindowsManifestMerger25WindowsManifestMergerImpl5mergeERKNS_12MemoryBufferE+0xb0): undefined reference to `xmlDocGetRootElement'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm16windows_manifest21WindowsManifestMerger25WindowsManifestMergerImpl5mergeERKNS_12MemoryBufferE+0xe0): undefined reference to `xmlUnlinkNode'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm16windows_manifest21WindowsManifestMerger25WindowsManifestMergerImpl5mergeERKNS_12MemoryBufferE+0xec): undefined reference to `xmlFreeNode'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm16windows_manifest21WindowsManifestMerger25WindowsManifestMergerImpl5mergeERKNS_12MemoryBufferE+0x104): undefined reference to `xmlDocGetRootElement'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: /usr/aarch64-linux-gnu/usr/lib/libLLVMSupport.a(Compression.cpp.o): in function `llvm::zlib::compress(llvm::StringRef, llvm::SmallVectorImpl<char>&, int)':
(.text._ZN4llvm4zlib8compressENS_9StringRefERNS_15SmallVectorImplIcEEi+0x40): undefined reference to `compressBound'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm4zlib8compressENS_9StringRefERNS_15SmallVectorImplIcEEi+0x6c): undefined reference to `compress2'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: /usr/aarch64-linux-gnu/usr/lib/libLLVMSupport.a(Compression.cpp.o): in function `llvm::zlib::uncompress(llvm::StringRef, char*, unsigned long&)':
(.text._ZN4llvm4zlib10uncompressENS_9StringRefEPcRm+0x3c): undefined reference to `uncompress'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: /usr/aarch64-linux-gnu/usr/lib/libLLVMSupport.a(Compression.cpp.o): in function `llvm::zlib::crc32(llvm::StringRef)':
(.text._ZN4llvm4zlib5crc32ENS_9StringRefE+0x14): undefined reference to `crc32'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: /usr/aarch64-linux-gnu/usr/lib/libLLVMSupport.a(CRC.cpp.o): in function `llvm::crc32(unsigned int, llvm::ArrayRef<unsigned char>)':
(.text._ZN4llvm5crc32EjNS_8ArrayRefIhEE+0x38): undefined reference to `crc32'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: /usr/aarch64-linux-gnu/usr/lib/libLLVMSupport.a(DynamicLibrary.cpp.o): in function `llvm::sys::DynamicLibrary::HandleSet::~HandleSet()':
(.text._ZN4llvm3sys14DynamicLibrary9HandleSetD2Ev+0x24): undefined reference to `dlclose'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm3sys14DynamicLibrary9HandleSetD2Ev+0x38): undefined reference to `dlclose'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: /usr/aarch64-linux-gnu/usr/lib/libLLVMSupport.a(DynamicLibrary.cpp.o): in function `llvm::sys::DynamicLibrary::HandleSet::DLOpen(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
(.text._ZN4llvm3sys14DynamicLibrary9HandleSet6DLOpenEPKcPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x14): undefined reference to `dlopen'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm3sys14DynamicLibrary9HandleSet6DLOpenEPKcPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x2c): undefined reference to `dlerror'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: /usr/aarch64-linux-gnu/usr/lib/libLLVMSupport.a(DynamicLibrary.cpp.o): in function `llvm::sys::DynamicLibrary::HandleSet::DLClose(void*)':
(.text._ZN4llvm3sys14DynamicLibrary9HandleSet7DLCloseEPv+0x0): undefined reference to `dlclose'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: /usr/aarch64-linux-gnu/usr/lib/libLLVMSupport.a(DynamicLibrary.cpp.o): in function `llvm::sys::DynamicLibrary::HandleSet::DLSym(void*, char const*)':
(.text._ZN4llvm3sys14DynamicLibrary9HandleSet5DLSymEPvPKc+0x0): undefined reference to `dlsym'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: /usr/aarch64-linux-gnu/usr/lib/libLLVMSupport.a(Process.cpp.o): in function `llvm::sys::Process::FileDescriptorHasColors(int)':
(.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0xa0): undefined reference to `setupterm'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0xcc): undefined reference to `tigetnum'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0xd8): undefined reference to `set_curterm'
/usr/lib/gcc/aarch64-linux-gnu/9.3.0/../../../../aarch64-linux-gnu/bin/ld: (.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0xdc): undefined reference to `del_curterm'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/zig0.dir/build.make:309: zig0] Error 1
make[1]: *** [CMakeFiles/Makefile2:110: CMakeFiles/zig0.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 99%] Built target zig_build_libstage2
make: *** [Makefile:149: all] Error 2
=> ERROR: zig-0.6.0_1: do_build: '${make_cmd} ${makejobs} ${make_build_args} ${make_build_target}' exited with 2
=> ERROR:   in do_build() at common/build-style/cmake.sh:74
```

This version of `llvm10` can still build zig on the host target (x86_64) without a problem. Not sure what's causing this to happen. Has anyone seen errors like this trying to build other llvm10-based software, maybe rust? @Duncaen @ifreund 

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2021-01-21 17:44 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17 21:42 [ISSUE] zig: cross-compile support jjsullivan5196
2020-09-17 22:07 ` jjsullivan5196
2020-09-18  9:36 ` jjsullivan5196
2020-09-18  9:36 ` jjsullivan5196
2020-09-18 11:20 ` zig: cross-compile the toolchain jjsullivan5196
2020-09-18 11:21 ` jjsullivan5196
2020-09-18 11:21 ` jjsullivan5196
2020-09-18 11:35 ` jjsullivan5196
2020-09-18 18:42 ` jjsullivan5196
2020-09-18 18:43 ` jjsullivan5196
2020-09-18 20:54 ` jjsullivan5196
2020-09-18 21:10 ` q66
2020-09-18 21:46 ` andrewrk
2020-09-18 21:47 ` andrewrk
2020-09-18 22:02 ` Johnnynator
2020-09-18 22:02 ` Johnnynator
2020-09-18 22:03 ` andrewrk
2020-09-18 22:03 ` andrewrk
2020-09-18 22:03 ` jjsullivan5196
2020-09-18 22:33 ` jjsullivan5196
2020-09-18 22:34 ` andrewrk
2020-09-18 22:36 ` jjsullivan5196
2020-09-18 22:36 ` jjsullivan5196
2020-09-18 22:52 ` jjsullivan5196
2020-09-18 22:52 ` jjsullivan5196
2020-09-18 22:53 ` jjsullivan5196
2020-09-19 22:39 ` jjsullivan5196
2020-09-19 22:41 ` jjsullivan5196
2020-09-20 23:49 ` jjsullivan5196
2021-01-21 17:44 ` ericonr
2021-01-21 17:44 ` [ISSUE] [CLOSED] " ericonr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).