#Is there a way to specify "-rpath" to zig cc?
1 messages · Page 1 of 1 (latest)
~~You can call exe_or_lib.addRPath(...) inside build.zig: https://github.com/ziglang/zig/blob/master/lib/std/Build/CompileStep.zig#L954-L956~~
Oh, I'm sorry, I read your question backwards!
zig cc --help shows a few things related to rpath but I'm not sure if one of them is equivalent to the clang flag
These flags are all automatically generated and look exactly the same as the output of clang --help. I just ran clang --help and don't see -rpath. From man ld it looks like a linker flag, not sure exactly how it decides which flags to pass to the linker
Maybe this is what you need
-z <arg> Pass -z <arg> to the linker
Oh that makes sense that it’s a linker flag, so it needs special handling. I’ll try that, thanks!!
Hm darn, zig cc complains about "error: unsupported linker extension flag: -z -rpath"
Man, I'm trying to follow the path of how command line flags are processed in src/main.zig... my head is spinning
If you use IRC you would probably get a quick answer on #zig on libera.chat
does -Wl,-rpath,/does/not/exist not work?
Looking through the source I did notice the -Wl thing but was confused and wasn’t sure it was related. Is that the normal way?
yep