Skip to content

arm-linux-musleabihf #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andrewrk opened this issue Mar 29, 2020 · 5 comments
Closed

arm-linux-musleabihf #7

andrewrk opened this issue Mar 29, 2020 · 5 comments

Comments

@andrewrk
Copy link
Member

[  5%] Linking CXX executable ../../bin/llvm-tblgen
warning: unsupported linker arg: -allow-shlib-undefined
warning: unsupported linker arg: -O3
warning: unsupported linker arg: --gc-sections
lld: error: undefined symbol: _Unwind_Resume
>>> referenced by cxa_guard.cpp
>>>               /home/andy/.cache/zig/stage1/o/LXJ6UCtVoQ2R9vWp__dOACHpfLGEHpsWZAbrKIseuPa2QI20nDtL1U6OlB0dmZSh/cxa_guard.o:(__cxa_guard_acquire) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a
>>> referenced by cxa_demangle.cpp
>>>               /home/andy/.cache/zig/stage1/o/nTgnXN0Jb-D7x1Fyg3kX1rA2lf0ZBX6O7Jv-3wCaFT1cyXdPB3blFvdhBRpJzlbo/cxa_demangle.o:(__cxa_demangle) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a
>>> referenced by cxa_demangle.cpp
>>>               /home/andy/.cache/zig/stage1/o/nTgnXN0Jb-D7x1Fyg3kX1rA2lf0ZBX6O7Jv-3wCaFT1cyXdPB3blFvdhBRpJzlbo/cxa_demangle.o:(__cxa_demangle) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a
>>> referenced by cxa_demangle.cpp
>>>               /home/andy/.cache/zig/stage1/o/nTgnXN0Jb-D7x1Fyg3kX1rA2lf0ZBX6O7Jv-3wCaFT1cyXdPB3blFvdhBRpJzlbo/cxa_demangle.o:((anonymous namespace)::itanium_demangle::AbstractManglingParser<(anonymous namespace)::itanium_demangle::ManglingParser<(anonymous namespace)::DefaultAllocator>, (anonymous namespace)::DefaultAllocator>::parseTemplateArgs(bool)) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a
>>> referenced by cxa_demangle.cpp
>>>               /home/andy/.cache/zig/stage1/o/nTgnXN0Jb-D7x1Fyg3kX1rA2lf0ZBX6O7Jv-3wCaFT1cyXdPB3blFvdhBRpJzlbo/cxa_demangle.o:((anonymous namespace)::itanium_demangle::ForwardTemplateReference::hasRHSComponentSlow((anonymous namespace)::itanium_demangle::OutputStream&) const) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a
>>> referenced by cxa_demangle.cpp
>>>               /home/andy/.cache/zig/stage1/o/nTgnXN0Jb-D7x1Fyg3kX1rA2lf0ZBX6O7Jv-3wCaFT1cyXdPB3blFvdhBRpJzlbo/cxa_demangle.o:((anonymous namespace)::itanium_demangle::ForwardTemplateReference::hasArraySlow((anonymous namespace)::itanium_demangle::OutputStream&) const) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a
>>> referenced by cxa_demangle.cpp
>>>               /home/andy/.cache/zig/stage1/o/nTgnXN0Jb-D7x1Fyg3kX1rA2lf0ZBX6O7Jv-3wCaFT1cyXdPB3blFvdhBRpJzlbo/cxa_demangle.o:((anonymous namespace)::itanium_demangle::ForwardTemplateReference::hasFunctionSlow((anonymous namespace)::itanium_demangle::OutputStream&) const) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a
>>> referenced by cxa_demangle.cpp
>>>               /home/andy/.cache/zig/stage1/o/nTgnXN0Jb-D7x1Fyg3kX1rA2lf0ZBX6O7Jv-3wCaFT1cyXdPB3blFvdhBRpJzlbo/cxa_demangle.o:((anonymous namespace)::itanium_demangle::ForwardTemplateReference::getSyntaxNode((anonymous namespace)::itanium_demangle::OutputStream&) const) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a
>>> referenced by cxa_demangle.cpp
>>>               /home/andy/.cache/zig/stage1/o/nTgnXN0Jb-D7x1Fyg3kX1rA2lf0ZBX6O7Jv-3wCaFT1cyXdPB3blFvdhBRpJzlbo/cxa_demangle.o:((anonymous namespace)::itanium_demangle::ForwardTemplateReference::printLeft((anonymous namespace)::itanium_demangle::OutputStream&) const) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a
>>> referenced by cxa_demangle.cpp
>>>               /home/andy/.cache/zig/stage1/o/nTgnXN0Jb-D7x1Fyg3kX1rA2lf0ZBX6O7Jv-3wCaFT1cyXdPB3blFvdhBRpJzlbo/cxa_demangle.o:((anonymous namespace)::itanium_demangle::ForwardTemplateReference::printRight((anonymous namespace)::itanium_demangle::OutputStream&) const) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a
>>> referenced 90 more times

lld: error: undefined symbol: _Unwind_RaiseException
>>> referenced by cxa_exception.cpp
>>>               /home/andy/.cache/zig/stage1/o/2UpEDygc3DpAQeDk9mwJcBinvpku9bfuYICqJbD-ihBbJGMIVn4o9vk4sS62MEGZ/cxa_exception.o:(__cxa_throw) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a
>>> referenced by cxa_exception.cpp
>>>               /home/andy/.cache/zig/stage1/o/2UpEDygc3DpAQeDk9mwJcBinvpku9bfuYICqJbD-ihBbJGMIVn4o9vk4sS62MEGZ/cxa_exception.o:(__cxa_rethrow) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a
>>> referenced by cxa_exception.cpp
>>>               /home/andy/.cache/zig/stage1/o/2UpEDygc3DpAQeDk9mwJcBinvpku9bfuYICqJbD-ihBbJGMIVn4o9vk4sS62MEGZ/cxa_exception.o:(__cxa_rethrow_primary_exception) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a

lld: error: undefined symbol: _Unwind_DeleteException
>>> referenced by cxa_exception.cpp
>>>               /home/andy/.cache/zig/stage1/o/2UpEDygc3DpAQeDk9mwJcBinvpku9bfuYICqJbD-ihBbJGMIVn4o9vk4sS62MEGZ/cxa_exception.o:(__cxa_end_catch) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a

lld: error: undefined symbol: _Unwind_VRS_Set
>>> referenced by cxa_personality.cpp
>>>               /home/andy/.cache/zig/stage1/o/FFtIKI4fP9Vftn2C2fQht7A0PKVyVfOBPDBYXNvAo2sR73USdUTDk_jSLNdV9kVA/cxa_personality.o:(__gxx_personality_v0) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a
>>> referenced by cxa_personality.cpp
>>>               /home/andy/.cache/zig/stage1/o/FFtIKI4fP9Vftn2C2fQht7A0PKVyVfOBPDBYXNvAo2sR73USdUTDk_jSLNdV9kVA/cxa_personality.o:(__gxx_personality_v0) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a
>>> referenced by cxa_personality.cpp
>>>               /home/andy/.cache/zig/stage1/o/FFtIKI4fP9Vftn2C2fQht7A0PKVyVfOBPDBYXNvAo2sR73USdUTDk_jSLNdV9kVA/cxa_personality.o:(__gxx_personality_v0) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a
>>> referenced by cxa_personality.cpp
>>>               /home/andy/.cache/zig/stage1/o/FFtIKI4fP9Vftn2C2fQht7A0PKVyVfOBPDBYXNvAo2sR73USdUTDk_jSLNdV9kVA/cxa_personality.o:(__gxx_personality_v0) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a

lld: error: undefined symbol: _Unwind_VRS_Get
>>> referenced by cxa_personality.cpp
>>>               /home/andy/.cache/zig/stage1/o/FFtIKI4fP9Vftn2C2fQht7A0PKVyVfOBPDBYXNvAo2sR73USdUTDk_jSLNdV9kVA/cxa_personality.o:(__gxx_personality_v0) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a
>>> referenced by cxa_personality.cpp
>>>               /home/andy/.cache/zig/stage1/o/FFtIKI4fP9Vftn2C2fQht7A0PKVyVfOBPDBYXNvAo2sR73USdUTDk_jSLNdV9kVA/cxa_personality.o:(__gxx_personality_v0) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a
>>> referenced by cxa_personality.cpp
>>>               /home/andy/.cache/zig/stage1/o/FFtIKI4fP9Vftn2C2fQht7A0PKVyVfOBPDBYXNvAo2sR73USdUTDk_jSLNdV9kVA/cxa_personality.o:(__gxx_personality_v0) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a
>>> referenced by cxa_personality.cpp
>>>               /home/andy/.cache/zig/stage1/o/FFtIKI4fP9Vftn2C2fQht7A0PKVyVfOBPDBYXNvAo2sR73USdUTDk_jSLNdV9kVA/cxa_personality.o:(__cxxabiv1::scan_eh_tab(__cxxabiv1::(anonymous namespace)::scan_results&, _Unwind_Action, bool, _Unwind_Control_Block*, _Unwind_Context*)) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a

lld: error: undefined symbol: __gnu_unwind_frame
>>> referenced by cxa_personality.cpp
>>>               /home/andy/.cache/zig/stage1/o/FFtIKI4fP9Vftn2C2fQht7A0PKVyVfOBPDBYXNvAo2sR73USdUTDk_jSLNdV9kVA/cxa_personality.o:(__gxx_personality_v0) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a

lld: error: undefined symbol: _Unwind_GetLanguageSpecificData
>>> referenced by cxa_personality.cpp
>>>               /home/andy/.cache/zig/stage1/o/FFtIKI4fP9Vftn2C2fQht7A0PKVyVfOBPDBYXNvAo2sR73USdUTDk_jSLNdV9kVA/cxa_personality.o:(__cxxabiv1::scan_eh_tab(__cxxabiv1::(anonymous namespace)::scan_results&, _Unwind_Action, bool, _Unwind_Control_Block*, _Unwind_Context*)) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a

lld: error: undefined symbol: _Unwind_GetRegionStart
>>> referenced by cxa_personality.cpp
>>>               /home/andy/.cache/zig/stage1/o/FFtIKI4fP9Vftn2C2fQht7A0PKVyVfOBPDBYXNvAo2sR73USdUTDk_jSLNdV9kVA/cxa_personality.o:(__cxxabiv1::scan_eh_tab(__cxxabiv1::(anonymous namespace)::scan_results&, _Unwind_Action, bool, _Unwind_Control_Block*, _Unwind_Context*)) in archive /home/andy/.cache/zig/stage1/o/_TNe8eWFsSv6GGM1wA2mhHGPTa9t9p1Uf5-tXWy6rTl5YdbnT1QDjiXZSA-6EmxW/libc++abi.a

make[2]: *** [utils/TableGen/CMakeFiles/llvm-tblgen.dir/build.make:176: bin/llvm-tblgen] Error 1
make[1]: *** [CMakeFiles/Makefile2:8865: utils/TableGen/CMakeFiles/llvm-tblgen.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
@andrewrk
Copy link
Member Author

andrewrk commented Mar 30, 2020

The linker args are ziglang/zig#4784 but I don't think are required to be fixed for this particular issue.

Next steps:

  • determine whether llvm's libunwind (which zig has copied the sources of) supports 32-bit arm
  • make sure the linker line includes libunwind.a

@andrewrk
Copy link
Member Author

With the following diff (which I will test and apply upstream):

diff --git a/zig/src/link.cpp b/zig/src/link.cpp
index 693aaca0e..ed6275ec3 100644
--- a/zig/src/link.cpp
+++ b/zig/src/link.cpp
@@ -1947,15 +1947,11 @@ static void construct_linker_job_elf(LinkJob *lj) {
                 lj->args.append("-lpthread");
             }
         } else if (target_is_glibc(g->zig_target)) {
-            if (target_supports_libunwind(g->zig_target)) {
-                lj->args.append(build_libunwind(g, lj->build_dep_prog_node));
-            }
+            lj->args.append(build_libunwind(g, lj->build_dep_prog_node));
             add_glibc_libs(lj);
             lj->args.append(get_libc_crt_file(g, "libc_nonshared.a", lj->build_dep_prog_node));
         } else if (target_is_musl(g->zig_target)) {
-            if (target_supports_libunwind(g->zig_target)) {
-                lj->args.append(build_libunwind(g, lj->build_dep_prog_node));
-            }
+            lj->args.append(build_libunwind(g, lj->build_dep_prog_node));
             lj->args.append(build_musl(g, lj->build_dep_prog_node));
         } else if (g->libcpp_link_lib != nullptr) {
             lj->args.append(build_libunwind(g, lj->build_dep_prog_node));
diff --git a/zig/src/target.cpp b/zig/src/target.cpp
index 030721683..4430adfe5 100644
--- a/zig/src/target.cpp
+++ b/zig/src/target.cpp
@@ -1295,19 +1295,6 @@ const char *target_arch_musl_name(ZigLLVM_ArchType arch) {
     }
 }
 
-bool target_supports_libunwind(const ZigTarget *target) {
-    switch (target->arch) {
-        case ZigLLVM_arm:
-        case ZigLLVM_armeb:
-        case ZigLLVM_riscv32:
-        case ZigLLVM_riscv64:
-            return false;
-        default:
-            return true;
-    }
-    return true;
-}
-
 bool target_libc_needs_crti_crtn(const ZigTarget *target) {
     if (target->arch == ZigLLVM_riscv32 || target->arch == ZigLLVM_riscv64 || target_is_android(target)) {
         return false;
diff --git a/zig/src/target.hpp b/zig/src/target.hpp
index c3f8530e0..898fa9020 100644
--- a/zig/src/target.hpp
+++ b/zig/src/target.hpp
@@ -119,7 +119,6 @@ bool target_supports_stack_probing(const ZigTarget *target);
 bool target_supports_sanitize_c(const ZigTarget *target);
 bool target_has_debug_info(const ZigTarget *target);
 const char *target_arch_musl_name(ZigLLVM_ArchType arch);
-bool target_supports_libunwind(const ZigTarget *target);
 
 uint32_t target_arch_pointer_bit_width(ZigLLVM_ArchType arch);
 uint32_t target_arch_largest_atomic_bits(ZigLLVM_ArchType arch);

The new problem is:

lld: error: undefined symbol: typeinfo for llvm::cl::GenericOptionValue
>>> referenced by YAMLBench.cpp
>>>               CMakeFiles/yaml-bench.dir/YAMLBench.cpp.o:(typeinfo for llvm::cl::OptionValueCopy<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)
>>> referenced by YAMLBench.cpp
>>>               CMakeFiles/yaml-bench.dir/YAMLBench.cpp.o:(typeinfo for llvm::cl::OptionValueCopy<bool>)
>>> referenced by YAMLBench.cpp
>>>               CMakeFiles/yaml-bench.dir/YAMLBench.cpp.o:(typeinfo for llvm::cl::OptionValueCopy<unsigned int>)
>>> did you mean: vtable for llvm::cl::GenericOptionValue
>>> defined in: ../../lib/libLLVMSupport.a(CommandLine.cpp.o)

lld: error: undefined symbol: typeinfo for llvm::cl::Option
>>> referenced by YAMLBench.cpp
>>>               CMakeFiles/yaml-bench.dir/YAMLBench.cpp.o:(typeinfo for llvm::cl::opt<llvm::cl::boolOrDefault, false, llvm::cl::parser<llvm::cl::boolOrDefault> >)
>>> did you mean: vtable for llvm::cl::Option
>>> defined in: ../../lib/libLLVMSupport.a(CommandLine.cpp.o)

@andrewrk
Copy link
Member Author

This diff gets past the problem (since we have tbl-gen from the host llvm we don't need to build tools or utilities):

--- a/build
+++ b/build
@@ -53,6 +53,8 @@ cmake "$ROOTDIR/llvm" \
   -DLLVM_TABLEGEN="$ROOTDIR/out/host/bin/llvm-tblgen" \
   -DCLANG_TABLEGEN="$ROOTDIR/out/build-llvm-host/bin/clang-tblgen" \
   -DLLVM_BUILD_TOOLS=OFF \
+  -DLLVM_INCLUDE_TOOLS=OFF \
+  -DLLVM_INCLUDE_UTILS=OFF \
   -DLLVM_INCLUDE_TESTS=OFF \
   -DLLVM_INCLUDE_GO_TESTS=OFF \
   -DLLVM_INCLUDE_EXAMPLES=OFF \

Now it gets to here, when configuring Zig:

Configuring zig version 0.5.0+6408766d6
-- Found llvm: /home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMXRay.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMWindowsManifest.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMTableGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMSymbolize.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMDebugInfoPDB.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMOrcJIT.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMOrcError.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMJITLink.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMObjectYAML.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMMCA.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMLTO.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMPasses.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMObjCARCOpts.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMLineEditor.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMLibDriver.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMInterpreter.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMFuzzMutate.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMFrontendOpenMP.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMMCJIT.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMExecutionEngine.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMRuntimeDyld.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMDWARFLinker.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMDlltoolDriver.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMOption.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMDebugInfoGSYM.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMCoverage.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMCoroutines.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAVRDisassembler.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAVRCodeGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAVRAsmParser.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAVRDesc.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAVRInfo.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMXCoreDisassembler.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMXCoreCodeGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMXCoreDesc.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMXCoreInfo.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMX86Disassembler.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMX86AsmParser.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMX86CodeGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMX86Desc.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMX86Utils.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMX86Info.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMWebAssemblyDisassembler.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMWebAssemblyCodeGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMWebAssemblyDesc.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMWebAssemblyAsmParser.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMWebAssemblyInfo.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMSystemZDisassembler.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMSystemZCodeGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMSystemZAsmParser.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMSystemZDesc.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMSystemZInfo.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMSparcDisassembler.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMSparcCodeGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMSparcAsmParser.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMSparcDesc.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMSparcInfo.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMRISCVDisassembler.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMRISCVCodeGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMRISCVAsmParser.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMRISCVDesc.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMRISCVUtils.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMRISCVInfo.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMPowerPCDisassembler.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMPowerPCCodeGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMPowerPCAsmParser.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMPowerPCDesc.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMPowerPCInfo.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMNVPTXCodeGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMNVPTXDesc.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMNVPTXInfo.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMMSP430Disassembler.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMMSP430CodeGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMMSP430AsmParser.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMMSP430Desc.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMMSP430Info.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMMipsDisassembler.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMMipsCodeGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMMipsAsmParser.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMMipsDesc.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMMipsInfo.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMLanaiDisassembler.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMLanaiCodeGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMLanaiAsmParser.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMLanaiDesc.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMLanaiInfo.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMHexagonDisassembler.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMHexagonCodeGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMHexagonAsmParser.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMHexagonDesc.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMHexagonInfo.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMBPFDisassembler.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMBPFCodeGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMBPFAsmParser.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMBPFDesc.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMBPFInfo.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMARMDisassembler.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMARMCodeGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMARMAsmParser.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMARMDesc.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMARMUtils.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMARMInfo.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAMDGPUDisassembler.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAMDGPUCodeGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMMIRParser.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMipo.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMInstrumentation.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMVectorize.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMLinker.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMIRReader.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAsmParser.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAMDGPUAsmParser.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAMDGPUDesc.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAMDGPUUtils.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAMDGPUInfo.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAArch64Disassembler.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMMCDisassembler.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAArch64CodeGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMCFGuard.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMGlobalISel.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMSelectionDAG.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAsmPrinter.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMDebugInfoDWARF.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMCodeGen.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMTarget.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMScalarOpts.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMInstCombine.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAggressiveInstCombine.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMTransformUtils.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMBitWriter.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAnalysis.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMProfileData.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMObject.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMTextAPI.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMBitReader.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMCore.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMRemarks.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMBitstreamReader.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAArch64AsmParser.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMMCParser.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAArch64Desc.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMMC.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMDebugInfoCodeView.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMDebugInfoMSF.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMBinaryFormat.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAArch64Utils.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMAArch64Info.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMSupport.a;/home/andy/dev/bootstrap-zig/out/arm-linux-musleabihf/lib/libLLVMDemangle.a  
-- Could NOT find clang (missing: CLANG_LIBRARIES CLANG_INCLUDE_DIRS) 
-- Could NOT find lld (missing: LLD_LIBRARIES LLD_INCLUDE_DIRS) 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CLANG_INCLUDE_DIRS (ADVANCED)
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
LLD_INCLUDE_DIRS (ADVANCED)
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig
   used as include directory in directory /home/andy/dev/bootstrap-zig/zig

@andrewrk
Copy link
Member Author

Oops, that was a red herring. That actually caused Clang and LLD to not be built. So the only improvement is -DDLLVM_INCLUDE_UTILS=OFF. With that, we hit missing compiler-rt function, __clear_cache.

Next we apply ziglang/zig#4867

And next we get to actually a flaw in zig's self hosted code!

./src-self-hosted/translate_c.zig:3859:57: error: expected type 'usize', found 'u64'
    while (i < num_limbs) : (i += 1) big.limbs[i] = data[i];
                                                        ^
./src-self-hosted/translate_c.zig:3859:57: note: unsigned 32-bit int cannot represent all possible unsigned 64-bit values
    while (i < num_limbs) : (i += 1) big.limbs[i] = data[i];
                                                        ^
./src-self-hosted/translate_c.zig:960:28: note: referenced here
                break :blk try transCreateNodeAPInt(c, ZigClangEnumConstantDecl_getInitVal(enum_const));
                           ^
./lib/std/zig/system.zig:816:40: error: expected type 'usize', found 'u64'
            const len = file.pread(buf[i .. buf.len - i], offset + i) catch |err| switch (err) {
                                       ^
./lib/std/zig/system.zig:816:40: note: unsigned 32-bit int cannot represent all possible unsigned 64-bit values
            const len = file.pread(buf[i .. buf.len - i], offset + i) catch |err| switch (err) {
                                       ^
./lib/std/zig/system.zig:816:39: note: referenced here
            const len = file.pread(buf[i .. buf.len - i], offset + i) catch |err| switch (err) {
                                      ^
./lib/std/zig/system.zig:570:13: note: referenced here
        _ = try preadMin(file, &hdr_buf, 0, hdr_buf.len);
            ^

@andrewrk
Copy link
Member Author

With ziglang/zig#4870 this is solved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant