I've found a clue to this puzzle, but still can't find a solution. When I 
compile with my cross-compile arguments on the command line, I get a different 
result than if I compile with the cross-compiler .exe as the only command line 
argument and the remaining cross-compile args in the `nim.cfg`.

With cross-compile args on the command line, the cross-compiler is called 
properly on `system.nim`, but things go haywire on the second call to the 
cross-compiler:
    
    
    D:\code\nim\arm_sandbox> nim c --cpu:arm --os:any --cc:gcc 
--arm.any.gcc.exe=arm-none-eabi-gcc .\src\main_4.nim
    Hint: used config file 'D:\code\nim-1.6.10\config\nim.cfg' [Conf]
    Hint: used config file 'D:\code\nim-1.6.10\config\config.nims' [Conf]
    Hint: used config file 'D:\code\nim\arm_sandbox\nim.cfg' [Conf]
    ........................................................
    CC: ../../../nim-1.6.10/lib/system.nim
    arm-none-eabi-gcc.exe -c -w -fmax-errors=4 -mthumb   
-ID:\code\nim-1.6.10\lib -ID:\code\nim\arm_sandbox\src -o 
D:\code\nim\arm_sandbox\build\nimcache\@m..@s..@s..@snim-1.6.10@s...@ssystem.nim.c.o
 
D:\code\nim\arm_sandbox\build\nimcache\@m..@s..@s..@snim-1.6.10@s...@ssystem.nim.c
    CC: main_4.nim
    arm-none-eabi-gcc.exe -c -w -fmax-errors=4 -mthumb   
-ID:\code\nim-1.6.10\lib -ID:\code\nim\arm_sandbox\src -o 
D:\code\nim\arm_sandbox\build\nimcache\@mmain_4.nim.c.o 
D:\code\nim\arm_sandbox\build\nimcache\@mmain_4.nim.c
    arm-none-eabi-gcc.exe: fatal error: cannot execute 'cc1': CreateProcess: No 
such file or directory
    compilation terminated.
    Error: execution of an external compiler program 'arm-none-eabi-gcc.exe -c 
-w -fmax-errors=4 -mthumb   -ID:\code\nim-1.6.1  lib -IDarm-none-eabi-gcc.exe::
    mnr\ pj avfatal error: tn nicannot execute 'm\a m_cc1sa db': CreateProcess: 
No such file or directory
    coompxil\astrci -oo nD: \gtrmen\rprmj\iavntna\ntime\adrm._s
    andbox\build\nimcache\@m..@s..@s..@snim-1.6.10@s...@ssystem.nim.c.o 
D:\code\nim\arm_sandbox\build\nimcache\@m..@s..@s..@snim-1.6.10@s...@ssystem.nim.c'
 failed with exit code: 1
    
    
    Run

Whereas with the cross-compile args in `nim.cfg`, the cross-compiler is 
mistakenly called with the path to the desktop gcc prefixed to the given 
cross-compiler .exe:
    
    
    D:\code\nim\arm_sandbox> nim c --arm.any.gcc.exe=arm-none-eabi-gcc 
.\src\main_4.nim
    Hint: used config file 'D:\code\nim-1.6.10\config\nim.cfg' [Conf]
    Hint: used config file 'D:\code\nim-1.6.10\config\config.nims' [Conf]
    Hint: used config file 'D:\code\nim\arm_sandbox\nim.cfg' [Conf]
    ........................................................
    CC: ../../../nim-1.6.10/lib/system.nim
    D:\code\nim-1.6.10\dist\mingw64\bin\arm-none-eabi-gcc.exe -c -w 
-fmax-errors=3 -mno-ms-bitfields -w -fmax-errors=4 -mthumb   
-ID:\code\nim-1.6.10\lib -ID:\code\nim\arm_sandbox\src -o 
D:\code\nim\arm_sandbox\build\nimcache\@m..@s..@s..@snim-1.6.10@s...@ssystem.nim.c.o
 
D:\code\nim\arm_sandbox\build\nimcache\@m..@s..@s..@snim-1.6.10@s...@ssystem.nim.c
    Error: invocation of external compiler program failed. The system cannot 
find the file specified.
    Additional info: Requested command not found: 
'D:\code\nim-1.6.10\dist\mingw64\bin\arm-none-eabi-gcc.exe -c -w -fmax-errors=3 
-mno-ms-bitfields -w -fmax-errors=4 -mthumb   -ID:\code\nim-1.6.10\lib 
-ID:\code\nim\arm_sandbox\src -o 
D:\code\nim\arm_sandbox\build\nimcache\@m..@s..@s..@snim-1.6.10@s...@ssystem.nim.c.o
 
D:\code\nim\arm_sandbox\build\nimcache\@m..@s..@s..@snim-1.6.10@s...@ssystem.nim.c'.
 OS error: 2
    
    
    Run

Reply via email to