Hi there, Recently I've found that in Nim devel branch there have been added 
support for zig compiler.

So i decided to give it another try. On Nim IRC I found that one of the users 
was able to compile to arm with

./nim_1_1_1/bin/nim --cpu:arm -d:danger --cc:zig --passC:"-target 
arm-linux-musleabi" \--passL:"-target arm-linux-musleabi" c ./hi.nim

It also works for me, but then i tried to use different target:

./nim_1_1_1/bin/nim --cpu:amd64 -d:danger --cc:zig --passC:"-target 
x86_64-linux-musl" \--passL:"-target x86_64-linux-musl" c ./hi.nim

It gives me huge log which I cut for clarity:

Hint: used config file '/home/seba/Pobrane/nim_1_1_1/config/nim.cfg' [Conf] 
Hint: system [Processing] Hint: widestrs [Processing] Hint: io [Processing] 
Hint: hi [Processing] CC: stdlib_io.nim CC: stdlib_system.nim Compile C Objects 
[1/1] Compile C Objects [1/1] 
/home/seba/.cache/nim/hi_r/stdlib_system.nim.c:431:27: warning: type specifier 
missing, defaults to 'int' [-Wimplicit-int] static N_INLINE(NIM_BOOL, 
nimMulInt)(NI a, NI b, NI* res); 4 warnings and 11 errors generated.

The following command failed:

/tmp/.mount_zig1BPaLC/usr/bin/zig clang -c -nostdinc -fno-spell-checking 
-target x86_64-unknown-linux-musl -isystem 
/tmp/.mount_zig1BPaLC/usr/lib/zig/include -isystem 
/tmp/.mount_zig1BPaLC/usr/lib/zig/libc/include/x86_64-linux-musl -isystem 
/tmp/.mount_zig1BPaLC/usr/lib/zig/libc/include/generic-musl -isystem 
/tmp/.mount_zig1BPaLC/usr/lib/zig/libc/include/x86_64-linux-any -isystem 
/tmp/.mount_zig1BPaLC/usr/lib/zig/libc/include/any-linux-any -Xclang 
-target-cpu -Xclang x86-64 -Xclang -target-feature -Xclang 
-3dnow,-3dnowa,+64bit,-adx,-aes,-avx,-avx2,-avx512bf16,-avx512bitalg,-avx512bw,-avx512cd,-avx512dq,-avx512er,-avx512f,-avx512ifma,-avx512pf,-avx512vbmi,-avx512vbmi2,-avx512vl,-avx512vnni,-avx512vp2intersect,-avx512vpopcntdq,-bmi,-bmi2,-branchfusion,-cldemote,-clflushopt,-clwb,-clzero,+cmov,-cx16,+cx8,-enqcmd,-ermsb,-f16c,-false-deps-lzcnt-tzcnt,-false-deps-popcnt,-fast-11bytenop,-fast-15bytenop,-fast-bextr,-fast-gather,-fast-hops,-fast-lzcnt,-fast-scalar-fsqrt,-fast-scalar-shift-masks,-fast-shld-rotate,-fast-variable-shuffle,-fast-vector-fsqrt,-fast-vector-shift-masks,-fma,-fma4,-fsgsbase,+fxsr,-gfni,-idivl-to-divb,-idivq-to-divl,-invpcid,-lea-sp,-lea-uses-ag,-lwp,-lzcnt,+macrofusion,-merge-to-threeway-branch,+mmx,-movbe,-movdir64b,-movdiri,-mpx,-mwaitx,+nopl,-pad-short-functions,-pclmul,-pconfig,-pku,-popcnt,-prefer-128-bit,-prefer-256-bit,-prefer-mask-registers,-prefetchwt1,-prfchw,-ptwrite,-rdpid,-rdrnd,-rdseed,-retpoline,-retpoline-external-thunk,-retpoline-indirect-branches,-retpoline-indirect-calls,-rtm,-sahf,-sgx,-sha,-shstk,+slow-3ops-lea,+slow-incdec,-slow-lea,-slow-pmaddwd,-slow-pmulld,-slow-shld,-slow-two-mem-ops,-slow-unaligned-mem-16,-slow-unaligned-mem-32,-soft-float,+sse,-sse-unaligned-mem,+sse2,-sse3,-sse4.1,-sse4.2,-sse4a,-ssse3,-tbm,-use-aa,-use-glm-div-sqrt-costs,-vaes,-vpclmulqdq,+vzeroupper,-waitpkg,-wbnoinvd,+x87,-xop,-xsave,-xsavec,-xsaveopt,-xsaves
 -MD -MV -MF zig-cache/tmp/GcPEEjyi4MkR-stdlib_system.nim.o.d 
-fno-omit-frame-pointer -fsanitize=undefined -fsanitize-trap=undefined -D_DEBUG 
-Og -fstack-protector-strong --param ssp-buffer-size=4 -O3 -fno-ident 
-I/home/seba/Pobrane/nim_1_1_1/lib -I/home/seba/Pobrane -o 
zig-cache/tmp/GcPEEjyi4MkR-stdlib_system.nim.o 
/home/seba/.cache/nim/hi_r/stdlib_system.nim.c|   
---|---  
  
Error: execution of an external compiler program 'zig cc -c -target 
x86_64-linux-musl -O3 -fno-ident -I/home/seba/Pobrane/nim_1_3_1/lib 
-I/home/seba/Pobrane -o /home/seba/.cache/nim/hi_r/stdlib_system.nim.c.o 
/home/seba/.cache/nim/hi_r/stdlib_system.nim.c' failed with exit code: 1..

What am I doing wrong? How should I fix it? Thank you 

Reply via email to