Zig Version
0.15.0-dev.171+1b62a2226
Steps to Reproduce and Observed Behavior
Repro steps:
zig init
Change
const lib = b.addLibrary(.{
.linkage = .static,
.name = "use_llvm_repro",
.root_module = lib_mod,
});
to
const lib = b.addLibrary(.{
.linkage = .dynamic, // change
.name = "use_llvm_repro",
.root_module = lib_mod,
.use_llvm = false, // change
});
Output:
install
+- install use_llvm_repro
+- zig build-lib use_llvm_repro Debug native 59597 errors
error: relocation at offset 0xb058b against symbol '.debug_info' cannot be used
note: in root.o:.debug_info
note: recompile with -fPIC
error: relocation at offset 0xb0579 against symbol '.debug_abbrev' cannot be used
note: in root.o:.debug_info
note: recompile with -fPIC
...
error: the following command failed with 59597 compilation errors:
/home/sam/.vscode-server/data/User/globalStorage/ziglang.vscode-zig/zig/linux-x86_64-0.14.0/zig build-lib -fno-llvm -ODebug -Mroot=/home/sam/dev/use_llvm_repro/src/root.zig --cache-dir /home/sam/dev/use_llvm_repro/.zig-cache --global-cache-dir /home/sam/.cache/zig --name use_llvm_repro -dynamic --zig-lib-dir /home/sam/.vscode-server/data/User/globalStorage/ziglang.vscode-zig/zig/linux-x86_64-0.14.0/lib/ --listen=-
Build Summary: 2/5 steps succeeded; 1 failed
install transitive failure
+- install use_llvm_repro transitive failure
+- zig build-lib use_llvm_repro Debug native 59597 errors
error: the following build command failed with exit code 1:
/home/sam/dev/use_llvm_repro/.zig-cache/o/b502fc4b7714c74ce2942a53495a0be4/build /home/sam/.vscode-server/data/User/globalStorage/ziglang.vscode-zig/zig/linux-x86_64-0.14.0/zig /home/sam/.vscode-server/data/User/globalStorage/ziglang.vscode-zig/zig/linux-x86_64-0.14.0/lib /home/sam/dev/use_llvm_repro /home/sam/dev/use_llvm_repro/.zig-cache /home/sam/.cache/zig --seed 0xe32987a -Zb7e4d0de094b01b2
It's saying recompile with -fPIC. When I try adding that flag it gets rejected as an unrecognised argument. I've tried adding .pic = true to both lib_mod and exe_mod but it makes no difference in either case.
Environment is WSL2, with kernel updated to 6.6.75.3.
Expected Behavior
Successful compilation.
Zig Version
0.15.0-dev.171+1b62a2226
Steps to Reproduce and Observed Behavior
Repro steps:
zig initChange
to
Output:
It's saying recompile with -fPIC. When I try adding that flag it gets rejected as an unrecognised argument. I've tried adding .pic = true to both lib_mod and exe_mod but it makes no difference in either case.
Environment is WSL2, with kernel updated to 6.6.75.3.
Expected Behavior
Successful compilation.