nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.55k stars 1.47k forks source link

[regression] nimscript execution failed with nim 32 bit or with --cpu:i386 #14640

Closed jangko closed 4 years ago

jangko commented 4 years ago

It failed with nim 32 bit executable or 64 bit executable with --cpu:i386 It works with nim 1.2.2 and 1.3.1

nim e --cpu:i386 a.nims

Example

# a.nims
exec "nim c b"
# b.nim
import strutils

Current Output

F:\projects\nim-noise\examples\b.nim(1, 8) Warning: imported and not used: 'strutils' [UnusedImport]
CC: stdlib_io.nim
CC: stdlib_system.nim
CC: b.nim
In file included from In file included from In file included from C:\Users\AndriLim\nimcache\b_d\@mb.nim.c:11C:\Users\AndriLim\nimcache\b_d\stdlib_system.nim.c:11                                                                              :
:
                                     f:\projects\nim\lib/nimbase.h:271:35:                                        error: error:                                                                                                                  #define NIM_STATIC_ASSERT(x, msg) static assertion failed: ""
 #define NIM_STATIC_ASSERT(x, msg) static assertion failed: ""
 #define NIM_STATIC_ASSERT(x, msg)               _Static_assert_Static_assert((x), msg)
                                                                                                                                                                                                                                                                                   ^~~~~~~~~~~~~~
                                                                                                                                                                                                                                                f:\projects\nim\lib/nimbase.h:542:1:                                                                           note: note:                              in expansion of macro 'in expansion of macro '                 NIM_STATIC_ASSERTNIM_STATIC_ASSERT'
 '
                                                                                                                         NIM_STATIC_ASSERTNIM_STATIC_ASSERTNIM_STATIC_ASSERT(sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8, "");
 (sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8, "");

^~~~~~~~~~~~~~~~~
Error: execution of an external compiler program 'gcc.exe -c  -w -mno-ms-bitfields   -If:\projects\nim\lib -IF:\projects\nim-noise\examples -o C:\Users\AndriLim\nimcache\b_d\@mb.nim.c.o C:\Users\AndriLim\nimcache\b_d\@mb.nim.c' failed with exit code: 1

stack trace: (most recent call last)
F:\projects\nim-noise\examples\a.nims(1, 6)
f:\projects\nim\lib\system\nimscript.nim(252, 7) exec
f:\projects\nim\lib\system\nimscript.nim(252, 7) Error: unhandled exception: FAILED: nim c b [OSError]
$ nim -v
Nim Compiler Version 1.3.5 [Windows: amd64]
Compiled at 2020-06-10
Copyright (c) 2006-2020 by Andreas Rumpf

git hash: 8bbdb8f43fb0da04d4b75bca011662f690972bfe
active boot switches: -d:release
jangko commented 4 years ago

sorry, it's because of outdated gcc in my path