Yet another person trying to port newlib
Posted: Thu Sep 06, 2007 1:05 am
I've compiled newlib and created libc.a and I've written my glue functions and placed them into libperception.a.
However when I link my test program using the following: (I've pasted the relevant parts from my build shell script).
Yet when I run the shell script I receive a whole load of errors complaining my glue functions are undefined (I've only pasted one as an example):
I think the problem is because my glue code is in libperception.a while the code trying to call it is in libc.a. I know libperception.a is working, because I can access my glue code fine from within my test program, just not from within newlib.
Here's an example function (my isatty from above) as a reference to what I'm doing:
That is stored in isatty.cpp, which gets compiled to isatty.o and placed in libperception.a.
Maybe the error is due to my glue code being C++ instead of C?
However when I link my test program using the following: (I've pasted the relevant parts from my build shell script).
Code: Select all
...
OUTFILE='AnnoyMe.prog'
...
LIBLOADER=$LIB'/loader.ao' # basically my complex cr0
LIBBIN=$LIB'/lib/libperception.a '$LIB'/lib/libc.a'
LIBLINK=$LIB'/link.ld'
...
LD='i586-elf-ld'
...
$LD -T $LIBLINK -o $OUTFILE $LIBLOADER *.o $LIBBIN
...
Code: Select all
../Library/lib/libc.a(lib_a-makebuf.o): In function `__smakebuf':
/cygdrive/c/perception/Users/Superuser/Source/Library/i586-elf/newlib/libc/stdio
/../../../.././newlib/libc/stdio/makebuf.c:102: undefined reference to `isatty'
Here's an example function (my isatty from above) as a reference to what I'm doing:
Code: Select all
int isatty(int file)
{
return 1;
}
Maybe the error is due to my glue code being C++ instead of C?