ziglang / zig-bootstrap

take off every zig
368 stars 86 forks source link

LLD error: Mach-O enconding not found #128

Closed kassane closed 1 year ago

kassane commented 1 year ago

LLVM version: 15.0.0 Zig version: 0.10.0-dev (master) Compiler used: clang-14 (ArchLinux - amd64)


Build command: ./build -j 2 native-linux-musl baseline

First stage : build LLVM

Output:

[100%] Built target llvm-reduce
/home/kassane/Code/zig-bootstrap/lld/MachO/Arch/X86_64.cpp:15:10: fatal error: 'mach-o/compact_unwind_encoding.h' file not found
#include "mach-o/compact_unwind_encoding.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [tools/lld/MachO/CMakeFiles/lldMachO.dir/build.make:132: tools/lld/MachO/CMakeFiles/lldMachO.dir/Arch/X86_64.cpp.o] Error 1
make[2]: ** Waiting for other processes to be finished.
/home/kassane/Code/zig-bootstrap/lld/MachO/Arch/ARM64.cpp:16:10: fatal error: 'mach-o/compact_unwind_encoding.h' file not found
#include "mach-o/compact_unwind_encoding.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [tools/lld/MachO/CMakeFiles/lldMachO.dir/build.make:90: tools/lld/MachO/CMakeFiles/lldMachO.dir/Arch/ARM64.cpp.o] Error 1
In file included from /home/kassane/Code/zig-bootstrap/lld/MachO/UnwindInfoSection.cpp:9:
/home/kassane/Code/zig-bootstrap/lld/MachO/UnwindInfoSection.h:16:10: fatal error: 'mach-o/compact_unwind_encoding.h' file not found
#include "mach-o/compact_unwind_encoding.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [tools/lld/MachO/CMakeFiles/lldMachO.dir/build.make:440: tools/lld/MachO/CMakeFiles/lldMachO.dir/UnwindInfoSection.cpp.o] Error 1
In file included from /home/kassane/Code/zig-bootstrap/lld/MachO/Writer.cpp:22:
/home/kassane/Code/zig-bootstrap/lld/MachO/UnwindInfoSection.h:16:10: fatal error: 'mach-o/compact_unwind_encoding.h' file not found
#include "mach-o/compact_unwind_encoding.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [tools/lld/MachO/CMakeFiles/lldMachO.dir/build.make:454: tools/lld/MachO/CMakeFiles/lldMachO.dir/Writer.cpp.o] Error 1
In file included from /home/kassane/Code/zig-bootstrap/lld/MachO/InputSection.cpp:17:
/home/kassane/Code/zig-bootstrap/lld/MachO/UnwindInfoSection.h:16:10: fatal error: 'mach-o/compact_unwind_encoding.h' file not found
#include "mach-o/compact_unwind_encoding.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [tools/lld/MachO/CMakeFiles/lldMachO.dir/build.make:258: tools/lld/MachO/CMakeFiles/lldMachO.dir/InputSection.cpp.o] Error 1
In file included from /home/kassane/Code/zig-bootstrap/lld/MachO/ICF.cpp:15:
/home/kassane/Code/zig-bootstrap/lld/MachO/UnwindInfoSection.h:16:10: fatal error: 'mach-o/compact_unwind_encoding.h' file not found
#include "mach-o/compact_unwind_encoding.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [tools/lld/MachO/CMakeFiles/lldMachO.dir/build.make:230: tools/lld/MachO/CMakeFiles/lldMachO.dir/ICF.cpp.o] Error 1
In file included from /home/kassane/Code/zig-bootstrap/lld/MachO/MarkLive.cpp:14:
/home/kassane/Code/zig-bootstrap/lld/MachO/UnwindInfoSection.h:16:10: fatal error: 'mach-o/compact_unwind_encoding.h' file not found
#include "mach-o/compact_unwind_encoding.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [tools/lld/MachO/CMakeFiles/lldMachO.dir/build.make:300: tools/lld/MachO/CMakeFiles/lldMachO.dir/MarkLive.cpp.o] Error 1
In file included from /home/kassane/Code/zig-bootstrap/lld/MachO/Driver.cpp:23:
/home/kassane/Code/zig-bootstrap/lld/MachO/UnwindInfoSection.h:16:10: fatal error: 'mach-o/compact_unwind_encoding.h' file not found
#include "mach-o/compact_unwind_encoding.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [tools/lld/MachO/CMakeFiles/lldMachO.dir/build.make:160: tools/lld/MachO/CMakeFiles/lldMachO.dir/Driver.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:42422: tools/lld/MachO/CMakeFiles/lldMachO.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Ref.:

kassane commented 1 year ago

Fixed: missing libunwind folder

matu3ba commented 1 year ago

@kassane Does this now work for you? Did you try the nix patch? https://github.com/awakesecurity/nixpkgs/pull/41/files LLVM 15.6 did fix quite some bugs.

kassane commented 1 year ago

@kassane Does this now work for you? Did you try the nix patch? https://github.com/awakesecurity/nixpkgs/pull/41/files LLVM 15.6 did fix quite some bugs.

Cool! Just saw your message yesterday and tested it with the current version of LLVM and there was no longer the problem. The problem is not persisting, I'll close the issue.

matu3ba commented 10 months ago

Looks like LLVM broke standalone builds of lld again with moving mach-o/compact_unwind_encoding.h into dir libunwind and not offering a cmake workaround to reference it. Detected on LLVM 17.0.4 on Windows.

I guess the standard full repo build just works.