nimraylib_now icon indicating copy to clipboard operation
nimraylib_now copied to clipboard

Crash when compiling with Arraymancer

Open XDEmer0r-L0rd-360-G0d-SlayerXD opened this issue 4 years ago • 1 comments

I'm writing a program, and it runs fine until I import nimraylib_now, to which it then crashes. I'm not using anything from raylib, but just importing is causes the error.

C:\Users\Nicholas\nimcache\Engine0_2_d\@mC@c@sUsers@[email protected]@[email protected]@sarraymancer@slaser@scpuinfo_x86.nim.c: In function 'cpuidX86__eyvyT5w2JfkohhKOIohiAg':
C:\Users\Nicholas\nimcache\Engine0_2_d\@mC@c@sUsers@[email protected]@[email protected]@sarraymancer@slaser@scpuinfo_x86.nim.c:192:21: error: expected ')' before ':' token
  asm("      cpuid\n"
                     ^
                     )
       :"=a"(eaxr), "=b"(ebxr), "=c"(ecxr), "=d"(edxr)
       ~
Error: execution of an external compiler program 'gcc.exe -c  -w -fmax-errors=3 -mno-ms-bitfields -DWIN32_LEAN_AND_MEAN -Wall -D_DEFAULT_SOURCE -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing -std=c99 -s -O1 -Werror=implicit-function-declaration -IC:\Users\Nicholas\.nimble\pkgs\nimraylib_now-0.13.1\csources\raylib_mangled -IC:\Users\Nicholas\.nimble\pkgs\nimraylib_now-0.13.1\csources\raylib_mangled\external\glfw\include -IC:\Users\Nicholas\.nimble\pkgs\nimraylib_now-0.13.1\csources\raylib_mangled\external\glfw\deps\mingw -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -DPHYSAC_IMPLEMENTATION -DPHYSAC_NO_THREADS -DRAYGUI_IMPLEMENTATION   -IC:\Users\Nicholas\.choosenim\toolchains\nim-1.4.4\lib -IE:\dump\Git\Hydris -o C:\Users\Nicholas\nimcache\Engine0_2_d\@mC@c@sUsers@[email protected]@[email protected]@sarraymancer@slaser@scpuinfo_x86.nim.c.o C:\Users\Nicholas\nimcache\Engine0_2_d\@mC@c@sUsers@[email protected]@[email protected]@sarraymancer@slaser@scpuinfo_x86.nim.c' failed with exit code: 1

I can try to provide a little more information if needed

It could be connected to that importing nimraylib_now requires these flags: https://github.com/greenfork/nimraylib_now/blob/920240c776777b125080aa71e01e6472f4899cf7/src/nimraylib_now/raylib_build_static.nim#L75-L78

And somehow it messes up asm instructions in arraymancer. I don't really have a good context on what happens in arraymancer and since the error in that library's file maybe it's better to ask the author of arraymancer to give some context. There are more flags passed to C, for all builds we also pass https://github.com/greenfork/nimraylib_now/blob/920240c776777b125080aa71e01e6472f4899cf7/src/nimraylib_now/raylib_build_static.nim#L24

and

https://github.com/greenfork/nimraylib_now/blob/920240c776777b125080aa71e01e6472f4899cf7/src/nimraylib_now/raylib_build_static.nim#L30-L32

greenfork avatar Jul 17 '21 06:07 greenfork