Open nektro opened 2 years ago
Try adding -Dconfig_h=config.h
to stage 2 build command.
This makes available the paths to LLVM that the stage1 build used (which are in "/root/out").
that did not fix it
adding apt install pkg-config
to the setup steps did not solve the issue either but did produce a different stack trace
ld.lld: error: unable to find library -lLLVM-14
error: FileNotFound
/root/zig/lib/std/os.zig:2749:19: 0x2e556b in std.os.mkdiratZ (build)
.EXIST => return error.PathAlreadyExists,
^
/root/zig/lib/std/os.zig:2709:9: 0x2e5453 in std.os.mkdirat (build)
return mkdiratZ(dir_fd, &sub_dir_path_c, mode);
^
/root/zig/lib/std/fs.zig:1359:9: 0x2e5346 in std.fs.Dir.makeDir (build)
try os.mkdirat(self.fd, sub_path, default_new_dir_mode);
^
/root/zig/lib/std/build.zig:2116:13: 0x35d503 in std.build.LibExeObjStep.runPkgConfig (build)
return error.PackageNotFound;
^
/root/zig/lib/std/build.zig:2116:13: 0x35d503 in std.build.LibExeObjStep.runPkgConfig (build)
return error.PackageNotFound;
^
/root/zig/lib/std/os.zig:1680:23: 0x2cb0cd in std.os.openatZ (build)
.NOENT => return error.FileNotFound,
^
/root/zig/lib/std/fs.zig:1108:13: 0x2b6f2c in std.fs.Dir.openFileZ (build)
try os.openatZ(self.fd, sub_path, os_flags, 0);
^
/root/zig/lib/std/fs.zig:1035:9: 0x2b4d21 in std.fs.Dir.openFile (build)
return self.openFileZ(&path_c, flags);
^
/root/zig/lib/std/fs.zig:2248:24: 0x35fea4 in std.fs.Dir.updateFile (build)
var src_file = try source_dir.openFile(source_path, .{});
^
/root/zig/lib/std/build.zig:1088:29: 0x362478 in std.build.Builder.updateFile (build)
const prev_status = try fs.Dir.updateFile(cwd, source_path, cwd, dest_path, .{});
^
/root/zig/lib/std/build.zig:3413:9: 0x362a30 in std.build.InstallArtifactStep.make (build)
try builder.updateFile(self.artifact.getOutputSource().getPath(builder), full_dest_path);
^
/root/zig/lib/std/build.zig:3648:9: 0x2e5a7e in std.build.Step.make (build)
try self.makeFn(self);
^
/root/zig/lib/std/build.zig:508:9: 0x2e4ecc in std.build.Builder.makeOneStep (build)
try s.make();
^
/root/zig/lib/std/build.zig:502:17: 0x2e4e78 in std.build.Builder.makeOneStep (build)
return err;
^
/root/zig/lib/std/build.zig:463:13: 0x2d7771 in std.build.Builder.make (build)
try self.makeOneStep(s);
^
/root/zig/lib/build_runner.zig:213:21: 0x2d1305 in main (build)
else => return err,
^
error: the following build command failed with exit code 1:
/root/zig/zig-cache/o/f308e9d11ab0866603c6b08f5ba2f992/build /root/zig/build/zig /root/zig /root/zig/zig-cache /root/.cache/zig -p stage2 -Denable-llvm -Dskip-install-lib-files -Dconfig_h=config.h
cmake .. -DCMAKE_INSTALL_PREFIX='/root/out' -DZIG_OMIT_STAGE2=ON
Append -DZIG_SHARED_LLVM=ON
to this build command, and append -Dstatic-llvm=false
to stage2 build command
If you want to build LLVM as a shared library, you should use the LLVM_BUILD_LLVM_DYLIB option.
Which is enabled in your command
The same issue is currently causing the live-package in Gentoo to fail as well.
The same issue is currently causing the live-package in Gentoo to fail as well.
Same as above, my PR https://github.com/gentoo/gentoo/pull/26325 still not merged :(
thanks @BratishkaErik can confirm that mitigation worked
the fix also removes the requirement on the pkg-config
dependency
Zig Version
0.10.0-dev.3504+85a3f9b05
Steps to Reproduce
With a Debian 10.10.0 image made from the following commands after logging into
root
,Expected Behavior
Successful build.
Actual Behavior