0 Members and 2 Guests are viewing this topic.
#include <tigcclib.h>
I haven't a clue what syscalls.c is. It came with Ndless.
There has to be some way to have it not include the unused functions. I am almost sure TIGCC/GCC4TI dose it.
when I tried it on Trapped, it complained of undefined references to memset and memcpy)!!
Danny@DANNYCOMPUTER /c/users/danny/documents/ti-nspire/development/trapped$ make clean;makenspire-gcc -Os -Wall -W -fpic -fno-merge-constants -D NON_CAS -c main.cnspire-gcc -Os -Wall -W -fpic -fno-merge-constants -D NON_CAS -c utils.cnspire-ld main.o utils.o -nostdlib -o Trapped.elfutils.o: In function `setlevel':utils.c:(.text+0x28): undefined reference to `memset'utils.c:(.text+0x1f8): undefined reference to `memset'utils.o: In function `setladder':utils.c:(.text+0x504): undefined reference to `memset'utils.c:(.text+0x540): undefined reference to `memset'utils.o: In function `drawlevel':utils.c:(.text+0x8f0): undefined reference to `memcpy'utils.c:(.text+0x904): undefined reference to `memcpy'utils.c:(.text+0x918): undefined reference to `memcpy'utils.c:(.text+0x92c): undefined reference to `memcpy'utils.c:(.text+0x944): undefined reference to `memcpy'utils.o:utils.c:(.text+0x95c): more undefined references to `memcpy' followcollect2: ld returned 1 exit statusmake: *** [Trapped.tns] Error 1Danny@DANNYCOMPUTER /c/users/danny/documents/ti-nspire/development/trapped$
Yes, the .c file includeds <os.h>Even stranger, I went to test this by renaming all instances of memset and memcpy to _memset and _memcpy, respectively, and went into <os.h> and renamed memset and memcpy (the ti-os ones) to _memset and _memcpy, respectively, and it still complained memset and memcpy were undefined, despite the fact that they are not even used by the program at all.What is confusing me even more is that it is complaining that these two functions are not defiend in a function that does not even use these functions at all. Here is the error I am getting:Code: [Select]Danny@DANNYCOMPUTER /c/users/danny/documents/ti-nspire/development/trapped$ make clean;makenspire-gcc -Os -Wall -W -fpic -fno-merge-constants -D NON_CAS -c main.cnspire-gcc -Os -Wall -W -fpic -fno-merge-constants -D NON_CAS -c utils.cnspire-ld main.o utils.o -nostdlib -o Trapped.elfutils.o: In function `setlevel':utils.c:(.text+0x28): undefined reference to `memset'utils.c:(.text+0x1f8): undefined reference to `memset'utils.o: In function `setladder':utils.c:(.text+0x504): undefined reference to `memset'utils.c:(.text+0x540): undefined reference to `memset'utils.o: In function `drawlevel':utils.c:(.text+0x8f0): undefined reference to `memcpy'utils.c:(.text+0x904): undefined reference to `memcpy'utils.c:(.text+0x918): undefined reference to `memcpy'utils.c:(.text+0x92c): undefined reference to `memcpy'utils.c:(.text+0x944): undefined reference to `memcpy'utils.o:utils.c:(.text+0x95c): more undefined references to `memcpy' followcollect2: ld returned 1 exit statusmake: *** [Trapped.tns] Error 1Danny@DANNYCOMPUTER /c/users/danny/documents/ti-nspire/development/trapped$The function "setlevel" does not call these functions at all; drawlevel only calls them in the form of the sprite function and to clear a buffer.
gcc will sometimes emit calls to memset or memcpy functions if you initialize or assign large structures. Having them as macros won't help. I think we need to have real memset and memcpy functions in the library (even if all they do is call the OS functions).