Cross compiling C output with gcc/ld
Posted: Wed Nov 08, 2023 9:37 pm
I am investigating if it is possible to cross-compile Purebasic C output using a gcc/ld cross compiler (on linux x86_64).
I am using gcc and ld for the target architecture.
First step is extracting/getting the C code:
Gives me a purebasic.c file.
Then compiling the code seem to be working (using the gcc for the target architecture):
Gives me a purebasic.o file.
But using ld to link using *.a and *.o files return returns errors (missing symbols).
Which linker is being used for PureBasic on linux. Is it ld? And if yes, which libraries does it link against?
I am using gcc and ld for the target architecture.
First step is extracting/getting the C code:
Code: Select all
pbcompilerc -c ./main.pb
Then compiling the code seem to be working (using the gcc for the target architecture):
Code: Select all
PBHOME=~/purebasic
PBINCLUDES="$PBHOME/sdk/c/PureLibraries"
gcc -c -I$PBINCLUDES ./purebasic.c
But using ld to link using *.a and *.o files return returns errors (missing symbols).
Which linker is being used for PureBasic on linux. Is it ld? And if yes, which libraries does it link against?