Description
Zig Version
0.15.0-dev.784+4a02e080d
Steps to Reproduce and Observed Behavior
When building from git, the software builds up until stage 3 and then it fails with the following error message:
[100%] Building stage3
install
+- install zig
+- compile exe zig ReleaseFast native 1 errors
error: sub-compilation of libunwind failed
/usr/include/linux/types.h:5:10: note: 'asm/types.h' file not found
#include <asm/types.h>
^~~~~~~~~~~~~~
lib/libunwind/src/libunwind.cpp:31:10: note: in file included from lib/libunwind/src/libunwind.cpp:31:
#include "UnwindCursor.hpp"
^
lib/libunwind/src/UnwindCursor.hpp:51:10: note: in file included from lib/libunwind/src/UnwindCursor.hpp:51:
#include "RWMutex.hpp"
^
lib/libunwind/src/RWMutex.hpp:19:10: note: in file included from lib/libunwind/src/RWMutex.hpp:19:
#include <pthread.h>
^
/usr/include/pthread.h:22:10: note: in file included from /usr/include/pthread.h:22:
#include <sched.h>
^
/usr/include/sched.h:43:10: note: in file included from /usr/include/sched.h:43:
#include <bits/sched.h>
^
/usr/include/bits/sched.h:63:13: note: in file included from /usr/include/bits/sched.h:63:
include <linux/sched/types.h>
^
/usr/include/linux/sched/types.h:5:10: note: in file included from /usr/include/linux/sched/types.h:5:
#include <linux/types.h>
^
error: the following command failed with 1 compilation errors:
/home/xxxxxx/Programs/Development-Tools/Languages/Zig/zig/build-release/zig2 build-exe -fallow-so-scripts --stack 48234496 /home/xxxxxx/Programs/Development-Tools/Languages/Zig/zig/build-release/zigcpp/libzigcpp.a /usr/lib/llvm-20/lib/libclang-cpp.so.20.1 /usr/lib/llvm-20/lib/liblldMinGW.a /usr/lib/llvm-20/lib/liblldELF.a /usr/lib/llvm-20/lib/liblldCOFF.a /usr/lib/llvm-20/lib/liblldWasm.a /usr/lib/llvm-20/lib/liblldMachO.a /usr/lib/llvm-20/lib/liblldCommon.a -lLLVM-20 /usr/lib/x86_64-linux-gnu/libz3.so -lz -lzstd -lxml2 /usr/lib/gcc/x86_64-linux-gnu/14/libstdc++.so -I/usr/include/x86_64-linux-gnu -lunwind -fstrip -fno-sanitize-thread -OReleaseFast -I /usr/lib/llvm-20/include -I /usr/lib/llvm-20/include -L /usr/lib/llvm-20/lib --dep aro --dep aro_translate_c --dep build_options -Mroot=/home/xxxxxx/Programs/Development-Tools/Languages/Zig/zig/src/main.zig -Maro=/home/xxxxxx/Programs/Development-Tools/Languages/Zig/zig/lib/compiler/aro/aro.zig --dep aro -Maro_translate_c=/home/xxxxxx/Programs/Development-Tools/Languages/Zig/zig/lib/compiler/aro_translate_c.zig -Mbuild_options=.zig-cache/c/c617f7d12f0353d1301aa6d6a8fc00ba/options.zig -lc --cache-dir .zig-cache --global-cache-dir /home/xxxxxx/.cache/zig --name zig --zig-lib-dir lib/ --listen=-
Build Summary: 2/5 steps succeeded; 1 failed
install transitive failure
+- install zig transitive failure
+- compile exe zig ReleaseFast native 1 errors
error: the following build command failed with exit code 1:
.zig-cache/o/96dad1c7053be61aea498d1e8eff77fb/build /home/xxxxxx/Programs/Development-Tools/Languages/Zig/zig/build-release/zig2 lib /home/xxxxxx/Programs/Development-Tools/Languages/Zig/zig .zig-cache /home/xxxxxx/.cache/zig --seed 0xbc6d24f -Z223c2ed8c81f956d --prefix /home/xxxxxx/Programs/Development-Tools/Languages/Zig/zig/build-release/stage3 -Dversion-string=0.15.0-dev.784+4a02e080d -Dtarget=native -Dcpu=native -Denable-llvm -Dconfig_h=/home/xxxxxx/Programs/Development-Tools/Languages/Zig/zig/build-release/config.h -Dno-langref -Doptimize=ReleaseFast -Dstrip
make[2]: *** [CMakeFiles/stage3.dir/build.make:73: stage3/bin/zig] Error 1
make[1]: *** [CMakeFiles/Makefile2:228: CMakeFiles/stage3.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
I note that there is an include path set for -I/usr/include/x86_64-linux-gnu and under this directory the file asm/types.h can be found on my Debian trixie/testing system.
I am compiling with 14.2.0 of the C and C++ compiler as per:
-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
I am also compiling with LLVM version 20.1.7.
Expected Behavior
The compiler should build to completion thus allowing an install to occur.