Hello there, im trying to teach myself porting applications to nintendo switch. The project i've chosen to port is OpenDune. I'm having some problems which I no doubt stem from my inexperience with porting in general. I'm using devkitproA64 with libnx and the (from what understand) the necessary portlibs.
The code is compiling but I'm getting the following linker error:
I'm using the following flags while building the app
My guess is that i should be linking against some library, or that the toolchain or system does not support these undefined methods.
I have been googling what library i need to link against to get these undefined implementations to no success. There is probably some very basic knowledge I'm missing. I would be very grateful if someone could point me in the right direction or point me to a resource that can broaden my basic understanding.
The code is compiling but I'm getting the following linker error:
Code:
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/10.2.0/../../../../aarch64-none-elf/bin/ld: timer.o: in function `SleepAndProcessBackgroundTasks':
timer.c:(.text.SleepAndProcessBackgroundTasks+0x18): undefined reference to `pause'
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/10.2.0/../../../../aarch64-none-elf/bin/ld: timer.o: in function `Timer_Init':
timer.c:(.text.Timer_Init+0x30): undefined reference to `sigaction'
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/10.2.0/../../../../aarch64-none-elf/bin/ld: timer.c:(.text.Timer_Init+0x4c): undefined reference to `setitimer'
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/10.2.0/../../../../aarch64-none-elf/bin/ld: timer.o: in function `Timer_Uninit':
timer.c:(.text.Timer_Uninit+0x1c): undefined reference to `setitimer'
I'm using the following flags while building the app
Code:
CFLAGS = -O2 -pthread -fomit-frame-pointer -Wno-variadic-macros -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIC -ftls-model=local-exec -O2 -ffunction-sections -fdata-sections -fno-common -Wall -Wsign-compare -Wundef -Wwrite-strings -Wpointer-arith -W -Wredundant-decls -Wformat=2 -Wformat-security -Wno-format-nonliteral -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-but-set-parameter -Winit-self -fno-strict-aliasing -Wcast-qual -fno-strict-overflow -Wno-free-nonheap-object -DUNIX -I/home/jons/projects/OpenDUNE/include -D_FORTIFY_SOURCE=2 -DWITH_SDL2 -I/opt/devkitpro/portlibs/switch/include/SDL2 -D__SWITCH__ $(INCLUDE) `sdl2-config --cflags` -march=armv8-a -mtune=cortex-a57 -mtp=soft -ftls-model=local-exec -isystem /opt/devkitpro/libnx/include -I/opt/devkitpro/portlibs/switch/include -DSDL_FORCE_INLINE='static __inline' -DWITHOUT_SDLIMAGE -DNDEBUG
CFLAGS_BUILD = -pthread -fno-common -Wall -Wsign-compare -Wundef -Wwrite-strings -Wpointer-arith -W -Wredundant-decls -Wformat=2 -Wformat-security -Wno-format-nonliteral -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-but-set-parameter -Winit-self -fno-strict-aliasing -Wcast-qual -fno-strict-overflow -Wno-free-nonheap-object -D_FORTIFY_SOURCE=2 -O1 -DNDEBUG
ASFLAGS =
LIBS = -L/opt/devkitpro/portlibs/switch/lib `sdl2-config --libs` -lSDL2 -march=armv8-a -fPIE -L/opt/devkitpro/libnx/lib -lstdc++ -lm -lEGL -lGLESv2 -lglapi -ldrm_nouveau -lnx
LDFLAGS = -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIC -ftls-model=local-exec -L/opt/devkitpro/portlibs/switch/lib -L/opt/devkitpro/libnx/lib -specs=$(DEVKITPRO)/libnx/switch.specs -static
My guess is that i should be linking against some library, or that the toolchain or system does not support these undefined methods.
I have been googling what library i need to link against to get these undefined implementations to no success. There is probably some very basic knowledge I'm missing. I would be very grateful if someone could point me in the right direction or point me to a resource that can broaden my basic understanding.