New issue
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
Compile/link broken for nim (64-bit only) on Windows #12536
Comments
I'm happy to troubleshoot further if needed and directed. Thanks for the attention. |
Please retry with -f or delete |
Thanks for the quick response. I had previously seen the cache directory and tried removing both the I just tried using the |
Hmm... I looked back through the compile and looked again at the local configuration file. It had a But, I would have thought |
You get such error when Nim compiler trying to build a executable file for 32bit CPU with backend C compiler for 64bit CPU. Nim Compiler User Guide says:
But when I set cpu=i386 in nim.cfg and run nim with I tested following code on 64bit Linux without gcc for i386 CPU. nim.cfg:
test.nim: echo"test" Output: user@linux /tmp/tmp $ nim c --cpu:amd64 test.nim
Hint: used config file '/etc/nim/nim.cfg' [Conf]
Hint: used config file '/home/user/.config/nim/nim.cfg' [Conf]
Hint: used config file '/tmp/tmp/nim.cfg' [Conf]
Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
Hint: test [Processing]
CC: stdlib_io.nim
CC: stdlib_system.nim
CC: test.nim
Error: execution of an external compiler program 'gcc -c -w -I/usr/lib/nim -I/tmp/tmp -o /tmp/nimcache/d/test/@mtest.nim.c.o
/tmp/nimcache/d/test/@mtest.nim.c' failed with exit code: 1
In file included from /tmp/nimcache/d/test/@mtest.nim.c:9:
/usr/lib/nim/nimbase.h:457:13: error: size of array ‘Nim_and_C_compiler_disagree_on_target_architecture’ is negative
typedef int Nim_and_C_compiler_disagree_on_target_architecture[sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8 ? 1
: -1];
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ user@linux /tmp/tmp $ nim -v
Nim Compiler Version 1.0.2 [Linux: amd64]
Compiled at 2019-10-28
Copyright (c) 2006-2019 by Andreas Rumpf
active boot switches: -d:release When I set |
Thanks for the fix. |
(cherry picked from commit 4e0f120)
nim
(64-bit version) compiles fail when usinggcc
(64-bit version), disagreeing on target architecture. Failures occur even when specifying cpu. The included defaultnim
configuration is used.gcc
otherwise works fully/correctly on the same machine.Notably, using
nim
(32-bit) withgcc
(32-bit) works just fine (although obviously unable to compile to a 64-bit target).64-bit output
32-bit output
The text was updated successfully, but these errors were encountered: