gcc can't link
Posted: Mon Aug 31, 2015 10:45 pm
hi,
my gcc 5.2.0 hi can link to .o but not .a, why?
i586-peter-elf-gcc a.c workspace/PeterI/library/libpeter/libpeter.o <--- this is ok
But this i586-peter-elf-gcc a.c workspace/PeterI/library/libpeter/libpeter.a gives me these
^
/toolchain/lib/gcc/i586-peter-elf/5.2.0/../../../../i586-peter-elf/lib/libc.a(lib_a-peter_stub.o): In function `_read':
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:12: undefined reference to `vfs_fread'
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:22: undefined reference to `getChar'
/toolchain/lib/gcc/i586-peter-elf/5.2.0/../../../../i586-peter-elf/lib/libc.a(lib_a-peter_stub.o): In function `_write':
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:39: undefined reference to `k_outStringToDisplay_len'
/toolchain/lib/gcc/i586-peter-elf/5.2.0/../../../../i586-peter-elf/lib/libc.a(lib_a-peter_stub.o): In function `_open':
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:52: undefined reference to `vfs_fopen'
/toolchain/lib/gcc/i586-peter-elf/5.2.0/../../../../i586-peter-elf/lib/libc.a(lib_a-peter_stub.o): In function `_lseek':
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:34: undefined reference to `vfs_fseek'
/toolchain/lib/gcc/i586-peter-elf/5.2.0/../../../../i586-peter-elf/lib/libc.a(lib_a-peter_stub.o): In function `_close':
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:59: undefined reference to `vfs_fclose'
/toolchain/lib/gcc/i586-peter-elf/5.2.0/../../../../i586-peter-elf/lib/libc.a(lib_a-peter_stub.o): In function `malloc':
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:163: undefined reference to `kmalloc'
/toolchain/lib/gcc/i586-peter-elf/5.2.0/../../../../i586-peter-elf/lib/libc.a(lib_a-peter_stub.o): In function `_malloc_r':
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:167: undefined reference to `kmalloc'
/toolchain/lib/gcc/i586-peter-elf/5.2.0/../../../../i586-peter-elf/lib/libc.a(lib_a-peter_stub.o): In function `free':
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:171: undefined reference to `kfree'
/toolchain/lib/gcc/i586-peter-elf/5.2.0/../../../../i586-peter-elf/lib/libc.a(lib_a-peter_stub.o): In function `_free_r':
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:175: undefined reference to `kfree'
thanks
from Peter ([email protected])
my gcc 5.2.0 hi can link to .o but not .a, why?
i586-peter-elf-gcc a.c workspace/PeterI/library/libpeter/libpeter.o <--- this is ok
But this i586-peter-elf-gcc a.c workspace/PeterI/library/libpeter/libpeter.a gives me these
^
/toolchain/lib/gcc/i586-peter-elf/5.2.0/../../../../i586-peter-elf/lib/libc.a(lib_a-peter_stub.o): In function `_read':
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:12: undefined reference to `vfs_fread'
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:22: undefined reference to `getChar'
/toolchain/lib/gcc/i586-peter-elf/5.2.0/../../../../i586-peter-elf/lib/libc.a(lib_a-peter_stub.o): In function `_write':
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:39: undefined reference to `k_outStringToDisplay_len'
/toolchain/lib/gcc/i586-peter-elf/5.2.0/../../../../i586-peter-elf/lib/libc.a(lib_a-peter_stub.o): In function `_open':
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:52: undefined reference to `vfs_fopen'
/toolchain/lib/gcc/i586-peter-elf/5.2.0/../../../../i586-peter-elf/lib/libc.a(lib_a-peter_stub.o): In function `_lseek':
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:34: undefined reference to `vfs_fseek'
/toolchain/lib/gcc/i586-peter-elf/5.2.0/../../../../i586-peter-elf/lib/libc.a(lib_a-peter_stub.o): In function `_close':
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:59: undefined reference to `vfs_fclose'
/toolchain/lib/gcc/i586-peter-elf/5.2.0/../../../../i586-peter-elf/lib/libc.a(lib_a-peter_stub.o): In function `malloc':
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:163: undefined reference to `kmalloc'
/toolchain/lib/gcc/i586-peter-elf/5.2.0/../../../../i586-peter-elf/lib/libc.a(lib_a-peter_stub.o): In function `_malloc_r':
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:167: undefined reference to `kmalloc'
/toolchain/lib/gcc/i586-peter-elf/5.2.0/../../../../i586-peter-elf/lib/libc.a(lib_a-peter_stub.o): In function `free':
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:171: undefined reference to `kfree'
/toolchain/lib/gcc/i586-peter-elf/5.2.0/../../../../i586-peter-elf/lib/libc.a(lib_a-peter_stub.o): In function `_free_r':
/Users/peter/workspace/PeterI/toolchain/build-newlib/i586-peter-elf/newlib/libc/sys/peter/../../../../../../newlib-2.1.0/newlib/libc/sys/peter/peter_stub.c:175: undefined reference to `kfree'
thanks
from Peter ([email protected])