Hi,
I am new to this gcc tools for embedded platforms. I have a sample project which I need to build againest gcc-arm-none-eabi-4_7-2012q4 . it is giving error in creating the shared library. Pasting below the build logs..
/usr/local/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc -O2 -I /arch/ARM/ixp42x/include -mthumb -mcpu=cortex-m3 -mtune=xscale --specs=rdimon.specs -lc -lc -lrdimon -mlittle-endian -I. -g -Werror -Wall -fPIC -c -o serial_transport_dummy.o serial_transport_dummy.c
/usr/local/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc -O2 -I /arch/ARM/ixp42x/include -mthumb -mcpu=cortex-m3 -mtune=xscale --specs=rdimon.specs -lc -lc -lrdimon -mlittle-endian -I. -g -Werror -Wall -fPIC -c -o tmr_strerror.o tmr_strerror.c
/usr/local/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc -O2 -I /arch/ARM/ixp42x/include -mthumb -mcpu=cortex-m3 -mtune=xscale --specs=rdimon.specs -lc -lc -lrdimon -mlittle-endian -I. -g -Werror -Wall -fPIC -c -o tmr_param.o tmr_param.c
/usr/local/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc -O2 -I /arch/ARM/ixp42x/include -mthumb -mcpu=cortex-m3 -mtune=xscale --specs=rdimon.specs -lc -lc -lrdimon -mlittle-endian -I. -g -Werror -Wall -fPIC -c -o hex_bytes.o hex_bytes.c
/usr/local/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc -O2 -I /arch/ARM/ixp42x/include -mthumb -mcpu=cortex-m3 -mtune=xscale --specs=rdimon.specs -lc -lc -lrdimon -mlittle-endian -I. -g -Werror -Wall -fPIC -c -o tm_reader.o tm_reader.c
/usr/local/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc -O2 -I /arch/ARM/ixp42x/include -mthumb -mcpu=cortex-m3 -mtune=xscale --specs=rdimon.specs -lc -lc -lrdimon -mlittle-endian -I. -g -Werror -Wall -fPIC -c -o tm_reader_async.o tm_reader_async.c
/usr/local/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc -O2 -I /arch/ARM/ixp42x/include -mthumb -mcpu=cortex-m3 -mtune=xscale --specs=rdimon.specs -lc -lc -lrdimon -mlittle-endian -I. -g -Werror -Wall -fPIC -c -o serial_reader.o serial_reader.c
/usr/local/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc -O2 -I /arch/ARM/ixp42x/include -mthumb -mcpu=cortex-m3 -mtune=xscale --specs=rdimon.specs -lc -lc -lrdimon -mlittle-endian -I. -g -Werror -Wall -fPIC -c -o serial_reader_l3.o serial_reader_l3.c
/usr/local/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc -O2 -I /arch/ARM/ixp42x/include -mthumb -mcpu=cortex-m3 -mtune=xscale --specs=rdimon.specs -lc -lc -lrdimon -mlittle-endian -I. -g -Werror -Wall -fPIC -c -o tmr_utils.o tmr_utils.c
/usr/local/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc -O2 -I /arch/ARM/ixp42x/include -mthumb -mcpu=cortex-m3 -mtune=xscale --specs=rdimon.specs -lc -lc -lrdimon -mlittle-endian -I. -g -Werror -Wall -fPIC -c -o osdep_dummy.o osdep_dummy.c
ar -rc libmercuryapi.a serial_transport_dummy.o tmr_strerror.o tmr_param.o hex_bytes.o tm_reader.o tm_reader_async.o serial_reader.o serial_reader_l3.o tmr_utils.o osdep_dummy.o
/usr/local/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc -O2 -I /arch/ARM/ixp42x/include -mthumb -mcpu=cortex-m3 -mtune=xscale --specs=rdimon.specs -lc -lc -lrdimon -mlittle-endian -I. -g -Werror -Wall -fPIC -shared -Wl,-rpath,/tm/lib,-soname,libmercuryapi.so.1 -o libmercuryapi.so.1 serial_transport_dummy.o tmr_strerror.o tmr_param.o hex_bytes.o tm_reader.o tm_reader_async.o serial_reader.o serial_reader_l3.o tmr_utils.o osdep_dummy.o
/usr/local/gcc-arm-none-eabi-4_7-2012q4/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld: /usr/local/gcc-arm-none-eabi-4_7-2012q4/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/armv7-m/libc.a(lib_a-__call_atexit.o): relocation R_ARM_THM_MOVW_ABS_NC against `free' can not be used when making a shared object; recompile with -fPIC
/usr/local/gcc-arm-none-eabi-4_7-2012q4/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/armv7-m/libc.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [libmercuryapi.so.1] Error 1
Internet suggests that in gcc-arm-none-eabi-4_7-2012q4 , we need to build the code with -fPIC option for the shared library.
My Make file is already doing that. You can see that in build logs above . Not sure why still it is showing the error.....
Any suggestions ?
Thanks
Lingaraj Bal