Open cove opened 5 months ago
Hi, you should be able to try again using the latest changes to PlaydateKit and PlaydateKitTemplate as well as the latest Swift toolchain. There are a few compiler bugs that I've worked around and everything seems to build now.
That fixed that crash for me!
However I'm getting the "stdlib.h
not found error" now:
cove@pico MyGame2 % swift package pdc
[cut]
In file included from /Users/cove/Developer/PlaydateSDK/C_API/buildsupport/setup.c:2:
/Users/cove/Developer/PlaydateSDK/C_API/pd_api.h:13:10: fatal error: 'stdlib.h' file not found
13 | #include <stdlib.h>
| ^~~~~~~~~~
1 error generated.
error: clangFailed(exitCode: 1)
I'm not seeing stdlib.h
in the included paths in Package.swift
, and when I do force include a path with stdlib.h
in it swift seg faults.
e.g. Seems to be in one of these dirs:
cove@pico MyGame2 % find /usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major|grep stdlib.h
/usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major/arm-none-eabi/include/ssp/stdlib.h
/usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major/arm-none-eabi/include/c++/9.2.1/stdlib.h
/usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major/arm-none-eabi/include/c++/9.2.1/tr1/stdlib.h
/usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major/arm-none-eabi/include/stdlib.h
/usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major/arm-none-eabi/include/machine/stdlib.h
Trying an obvious dir to include:
"-Xfrontend", "-disable-objc-interop",
"-Xfrontend", "-disable-stack-protector",
"-Xfrontend", "-function-sections",
"-Xfrontend", "-gline-tables-only",
"-Xcc", "-DTARGET_EXTENSION",
"-Xcc", "-I", "-Xcc", "\(gccIncludePrefix)/include",
"-Xcc", "-I", "-Xcc", "\(gccIncludePrefix)/include-fixed",
"-Xcc", "-I", "-Xcc", "\(gccIncludePrefix)/../../../../arm-none-eabi/include",
+ "-I", "/usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major/arm-none-eabi/include"
"-I", "\(playdateSDKPath)/C_API",
Crashes:
cove@pico MyGame2 % swift package pdc
zsh: segmentation fault swift package pdc
Update: Oh wait I see the path is included already with /../../../../arm-none-eabi/include
, so I wonder why it can't find the header file?
Just going through the setup docs and on the swift package pdc command I get errors about mismatched arch (I'm on an M1 Mac FWIW), and then it crashes.
I have TOOLCHAINS set:
It appears to be discoverable:
Here's the abbreviated output: