We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zig cc
mips(64)-linux-gnu
-fno-PIC
TargetRequiresPIC
0.12.0-dev.163+6780a6bbf
hello.c
int main() { return 0; }
mips-linux-gnu
mips64-...
$ zig cc --target=mips-linux-gnu -c -v -mabi=64 -fno-PIC -mno-abicalls hello.c
-v
error: unable to create compilation: TargetRequiresPIC
By comparison, running clang with the same inputs succeeds:
clang
$ clang --target=mips-linux-gnu -c -mabi=64 -fno-PIC -mno-abicalls -v hello.c clang version 11.1.0 Target: mips64-unknown-linux-gnuabi64 Thread model: posix InstalledDir: /nix/store/2myg6jq41n774bc2pqva8rwv5jd6kzw2-clang-11.1.0/bin clang-11: warning: argument unused during compilation: '-mmacos-version-min=10.12' [-Wunused-command-line-argument] clang-11: warning: argument unused during compilation: '-arch x86_64' [-Wunused-command-line-argument] (in-process) "/nix/store/2myg6jq41n774bc2pqva8rwv5jd6kzw2-clang-11.1.0/bin/clang-11" -cc1 -triple mips64-unknown-linux-gnuabi64 -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name hello.c -mrelocation-model static -mframe-pointer=none -fmath-errno -fno-rounding-math -mconstructor-aliases -target-cpu mips64r2 -target-feature +noabicalls -target-abi n64 -mfloat-abi hard -mllvm -mgpopt -fno-split-dwarf-inlining -debugger-tuning=gdb -target-linker-version 609 -v -nostdsysteminc -resource-dir /nix/store/78yj291bzmwpqww4cgr4vm5mgax86jpy-clang-wrapper-11.1.0/resource-root -idirafter /nix/store/sq9w5y029sl08x2v7f42qldz5yvjarap-Libsystem-1238.60.2/include -isystem /nix/store/naxm44wzljym43ykf1zrg40cdlf1zqp4-gnumake-4.2.1/include -isystem /nix/store/c1031bk1zp7mfm9sfci705sb7rsqa456-mips-linux-gnu-binutils-2.37/include -isystem /nix/store/m4xswnlzvn2q65gmgjqjlnlicbgs29f0-libcxx-11.1.0-dev/include -isystem /nix/store/9fnxklyylz4a46dnpjzv7zb2r07bs2ab-libcxxabi-11.1.0-dev/include -isystem /nix/store/9p7g1yznh1hwkxx402yb3hnmcc3ai7cw-compiler-rt-libc-11.1.0-dev/include -iframework /nix/store/9knjxrwxclz7brjxx823kzriz56kls71-swift-corefoundation-unstable-2018-09-14/Library/Frameworks -isystem /nix/store/naxm44wzljym43ykf1zrg40cdlf1zqp4-gnumake-4.2.1/include -isystem /nix/store/c1031bk1zp7mfm9sfci705sb7rsqa456-mips-linux-gnu-binutils-2.37/include -isystem /nix/store/m4xswnlzvn2q65gmgjqjlnlicbgs29f0-libcxx-11.1.0-dev/include -isystem /nix/store/9fnxklyylz4a46dnpjzv7zb2r07bs2ab-libcxxabi-11.1.0-dev/include -isystem /nix/store/9p7g1yznh1hwkxx402yb3hnmcc3ai7cw-compiler-rt-libc-11.1.0-dev/include -iframework /nix/store/9knjxrwxclz7brjxx823kzriz56kls71-swift-corefoundation-unstable-2018-09-14/Library/Frameworks -U _FORTIFY_SOURCE -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -internal-isystem /nix/store/78yj291bzmwpqww4cgr4vm5mgax86jpy-clang-wrapper-11.1.0/resource-root/include -O2 -Wformat -Wformat-security -Werror=format-security -fdebug-compilation-dir /Users/beckerawqatty/Repos/sm64 -ferror-limit 19 -fwrapv -stack-protector 2 -stack-protector-buffer-size 4 -fgnuc-version=4.2.1 -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -o hello.o -x c hello.c clang -cc1 version 11.1.0 based upon LLVM 11.1.0 default target x86_64-apple-darwin22.5.0 ignoring duplicate directory "/nix/store/naxm44wzljym43ykf1zrg40cdlf1zqp4-gnumake-4.2.1/include" ignoring duplicate directory "/nix/store/c1031bk1zp7mfm9sfci705sb7rsqa456-mips-linux-gnu-binutils-2.37/include" ignoring duplicate directory "/nix/store/m4xswnlzvn2q65gmgjqjlnlicbgs29f0-libcxx-11.1.0-dev/include" ignoring duplicate directory "/nix/store/9fnxklyylz4a46dnpjzv7zb2r07bs2ab-libcxxabi-11.1.0-dev/include" ignoring duplicate directory "/nix/store/9p7g1yznh1hwkxx402yb3hnmcc3ai7cw-compiler-rt-libc-11.1.0-dev/include" ignoring duplicate directory "/nix/store/9knjxrwxclz7brjxx823kzriz56kls71-swift-corefoundation-unstable-2018-09-14/Library/Frameworks" #include "..." search starts here: #include <...> search starts here: /nix/store/naxm44wzljym43ykf1zrg40cdlf1zqp4-gnumake-4.2.1/include /nix/store/c1031bk1zp7mfm9sfci705sb7rsqa456-mips-linux-gnu-binutils-2.37/include /nix/store/m4xswnlzvn2q65gmgjqjlnlicbgs29f0-libcxx-11.1.0-dev/include /nix/store/9fnxklyylz4a46dnpjzv7zb2r07bs2ab-libcxxabi-11.1.0-dev/include /nix/store/9p7g1yznh1hwkxx402yb3hnmcc3ai7cw-compiler-rt-libc-11.1.0-dev/include /nix/store/9knjxrwxclz7brjxx823kzriz56kls71-swift-corefoundation-unstable-2018-09-14/Library/Frameworks (framework directory) /nix/store/78yj291bzmwpqww4cgr4vm5mgax86jpy-clang-wrapper-11.1.0/resource-root/include /nix/store/sq9w5y029sl08x2v7f42qldz5yvjarap-Libsystem-1238.60.2/include End of search list.
...and the output file hello.o is parsable with mips-linux-gnu-objdump:
hello.o
mips-linux-gnu-objdump
$ mips-linux-gnu-objdump -d hello.o hello.o: file format elf64-tradbigmips Disassembly of section .text: 0000000000000000 <main>: 0: 03e00008 jr ra 4: 64020000 daddiu v0,zero,0
The text was updated successfully, but these errors were encountered:
removed some failing flags for zig cc cross compilation
4109598
current error: ``` error: unable to create compilation: TargetRequiresPIC ``` `ziglang/zig` issue submitted at ziglang/zig#17414
This is effectively a duplicate of #17430. Suggest closing this one since #17430 has more info/discussion.
Sorry, something went wrong.
No branches or pull requests
Zig Version
0.12.0-dev.163+6780a6bbf
Steps to Reproduce and Observed Behavior
hello.c
:mips-linux-gnu
ormips64-...
, using the-fno-PIC
flag, e.g.:-v
flag doesn't add any additional output information):Expected Behavior
By comparison, running
clang
with the same inputs succeeds:...and the output file
hello.o
is parsable withmips-linux-gnu-objdump
:The text was updated successfully, but these errors were encountered: