I am trying to compile a C library into a Playdate HelloWorld example. The compilation (using SDK 2.6.2) is segfaulting on pdc Source HelloWorld.pdx. I cannot seem to run lldb against this command to see any more detail. Where can i look to debug this?
The built in HelloWorld example does compile fine.
My example compiles with no errors up to the segfault.
The example also worked on a previous SDK version, I don't remember which, but it was a few months ago.
HEAP_SIZE = 8388208
STACK_SIZE = 61800
PRODUCT = HelloWorld.pdx
# Locate the SDK
SDK = ${PLAYDATE_SDK_PATH}
ifeq ($(SDK),)
SDK = $(shell egrep '^\s*SDKRoot' ~/.Playdate/config | head -n 1 | cut -c9-)
endif
ifeq ($(SDK),)
$(error SDK path not found; set ENV value PLAYDATE_SDK_PATH)
endif
######
# IMPORTANT: You must add your source folders to VPATH for make to find them
# ex: VPATH += src1:src2
######
VPATH += src
# List C source files here
SRC = src/main.c
SRC += $(addprefix /Users/bwhitman/outside/amy/src/, \
amy.c \
algorithms.c \
custom.c \
patches.c \
delay.c \
envelope.c \
filters.c \
oscillators.c \
transfer.c \
sequencer.c \
partials.c \
pcm.c \
log2_exp2.c \
interp_partials.c \
)
# List all user directories here
UINCDIR = /Users/bwhitman/outside/amy/src/
# List user asm files
UASRC =
# List all user C define here, like -D_DEBUG=1
UDEFS = -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wpointer-arith \
-Wno-float-conversion -Wno-missing-declarations -Wno-strict-prototypes -Wno-double-promotion \
-Wno-old-style-declaration
# Define ASM defines here
UADEFS =
# List the user directory to look for the libraries here
ULIBDIR =
# List all user libraries here
ULIBS = --specs=nosys.specs
include $(SDK)/C_API/buildsupport/common.mk
I think i've figured this out, but i don't understand why. If your project folder doesn't have an existing Source folder in it, the build step will cp build/pdex.dylib Source, which of course will just create a copy of pdex.dylib called Source, not a folder called Source. And then i get pdc will die trying to read the contents of a directory that's actually a file. I don't see this in the docs anywhere so maybe something to point out for others getting started.