samdze / playdate-nim

Nim bindings with extra features for the Playdate SDK
66 stars 3 forks source link

arm-none-eabi-gcc: fatal error: cannot read spec file 'nosys.specs': No such file or directory #41

Closed sdwfrost closed 10 months ago

sdwfrost commented 10 months ago

I get the above error when compiling the example on an M1 Mac, with Nim installed from source. Details below - any help would be greatly appreciated!

% nim -v
Nim Compiler Version 1.6.18 [MacOSX: arm64]
Compiled at 2024-01-11
Copyright (c) 2006-2023 by Andreas Rumpf
% nimble -v
nimble v0.13.1 compiled at 2024-01-11 20:22:03
git hash: d13f3b8ce288b4dc8c34c219a4e050aaeaf43fc9
% arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/opt/homebrew/Cellar/arm-none-eabi-gcc/13.2.0/libexec/gcc/arm-none-eabi/13.2.0/lto-wrapper
Target: arm-none-eabi
Configured with: ../configure --target=arm-none-eabi --prefix=/opt/homebrew/Cellar/arm-none-eabi-gcc/13.2.0 --infodir=/opt/homebrew/Cellar/arm-none-eabi-gcc/13.2.0/share/info/arm-none-eabi --disable-nls --without-isl --without-headers --with-as=/opt/homebrew/opt/arm-none-eabi-binutils/bin/arm-none-eabi-as --with-ld=/opt/homebrew/opt/arm-none-eabi-binutils/bin/arm-none-eabi-ld --enable-languages=c,c++
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 13.2.0 (GCC)

Error message:

% nimble device
  Executing task device in /Users/sdwfrost/Projects/playdate/playdate-nim/playdate_example/playdate_example.nimble
  Verifying dependencies for playdate_example@0.8.0
    Reading official package list
   Checking for playdate@any version
      Info: Dependency on playdate@any version already satisfied
  Verifying dependencies for playdate@0.12.0
   Building playdate_example/playdate_example using c backend
  Executing /Users/sdwfrost/Programs/Nim-1.6.18/bin/nim c --colors:on --noNimblePath -d:device -d:release -d:NimblePkgVersion=0.8.0 --path:/Users/sdwfrost/.nimble/pkgs/playdate-0.12.0 -o:/Users/sdwfrost/Projects/playdate/playdate-nim/playdate_example/playdate_example /Users/sdwfrost/Projects/playdate/playdate-nim/playdate_example/src/playdate_example.nim
Hint: used config file '/Users/sdwfrost/Programs/Nim-1.6.18/config/nim.cfg' [Conf]
Hint: used config file '/Users/sdwfrost/Programs/Nim-1.6.18/config/config.nims' [Conf]
Hint: used config file '/Users/sdwfrost/Projects/playdate/playdate-nim/playdate_example/config.nims' [Conf]
..........................................................................................................
CC: setup
CC: ../../../../../Programs/Nim-1.6.18/lib/std/private/digitsutils.nim
CC: ../../../../../Programs/Nim-1.6.18/lib/system/formatfloat.nim
CC: ../../../../../Programs/Nim-1.6.18/lib/system/dollars.nim
CC: ../../../../../Programs/Nim-1.6.18/lib/system/repr_v2.nim
CC: ../../../../../Programs/Nim-1.6.18/lib/system.nim
CC: ../../../../../.nimble/pkgs/playdate-0.12.0/playdate/bindings/utils.nim
CC: ../../../../../.nimble/pkgs/playdate-0.12.0/playdate/bindings/graphics.nim
CC: ../../../../../.nimble/pkgs/playdate-0.12.0/playdate/bindings/system.nim
CC: ../../../../../.nimble/pkgs/playdate-0.12.0/playdate/bindings/file.nim
arm-none-eabi-gcc: fatal error: cannot read spec file 'nosys.specs': No such file or directory
compilation terminated.
samdze commented 10 months ago

At a glance it seems you're not using the arm toolchain that ships with the Playdate SDK. Maybe your Homebrew installation is shadowing the SDK's arm-none-eabi-gcc.

Try using the SDK installed toolchain (should be located in /usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major/bin/)

sdwfrost commented 10 months ago

Thanks! This fix works - perhaps you could add something in the README?

samdze commented 10 months ago

Yes I'll add a notice!