ziglang / zig

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
https://ziglang.org
MIT License
34.35k stars 2.51k forks source link

undefined references in bootstrap build of 0.13 #21698

Open themaddoctor opened 5 hours ago

themaddoctor commented 5 hours ago

Zig Version

zig-bootstrap-0.13.0

Steps to Reproduce and Observed Behavior

tar -xf zig-bootstrap-0.13.0.tar.xz cd zig-bootstrap-0.13.0 PATH=/opt/gcc-14.1.0/bin:$PATH LD_LIBRARY_PATH=/opt/gcc-14.1.0/lib64 ./build x86_64-linux-gnu x86_64 ... [ 84%] Building C object CMakeFiles/zig2.dir/zig2.c.o [ 89%] Building C object CMakeFiles/zig2.dir/compiler_rt.c.o [ 94%] Linking CXX executable zig2 /usr/bin/ld: CMakeFiles/zig2.dir/zig2.c.o: in function posix_getrandom__2384': zig2.c:(.text+0x5ba80a): undefined reference togetrandom' /usr/bin/ld: CMakeFiles/zig2.dir/zig2.c.o: in function posix_copy_file_range__2600': zig2.c:(.text+0x6046f7): undefined reference tocopy_file_range' collect2: error: ld returned 1 exit status CMakeFiles/zig2.dir/build.make:1126: recipe for target 'zig2' failed make[2]: [zig2] Error 1 CMakeFiles/Makefile2:117: recipe for target 'CMakeFiles/zig2.dir/all' failed make[1]: [CMakeFiles/zig2.dir/all] Error 2 Makefile:135: recipe for target 'all' failed make: *** [all] Error 2

Expected Behavior

successful build?

alexrp commented 5 hours ago

Try x86_64-linux-gnu.2.24 instead, or whatever glibc version you actually have. Zig defaults to 2.28, which has both of those functions.