2014年3月12日 星期三

Step 4 build "libc"

進入到第四步驟 ,編譯 libc , 這部份要特別注意 , 因為 libc 是在MSP430 上使用 , 所以要用的是 cross compiler 來編譯.

基本上如果之前的 msp430-gcc 沒有編譯錯誤 , 這部份應該就沒有大問題了. 要注意PATH的是設定 , 不然會沒有辦法執行 msp430-gcc .

這部份順利 , 沒有需要 patch 的部份 , 編譯最後訊息如下:

msp430-gcc -c -mcpu=430x -mmpy=16 -I./../include -I. -Wall -Os -gdwarf-2 ./libm/fixunssfsi.c -o Build/mcpu-430x/mmpy-16/fixunssfsi.o
msp430-gcc -c -mcpu=430x -mmpy=16 -I./../include -I. -Wall -Os -gdwarf-2 ./libm/gesf.c -o Build/mcpu-430x/mmpy-16/gesf.o
msp430-gcc -c -mcpu=430x -mmpy=16 -I./../include -I. -Wall -Os -gdwarf-2 ./libm/ltsf.c -o Build/mcpu-430x/mmpy-16/ltsf.o
msp430-gcc -c -mcpu=430x -mmpy=16 -I./../include -I. -Wall -Os -gdwarf-2 ./libm/subsf.c -o Build/mcpu-430x/mmpy-16/subsf.o
msp430-gcc -c -mcpu=430x -mmpy=16 -I./../include -I. -Wall -Os -gdwarf-2 ./libm/nesf.c -o Build/mcpu-430x/mmpy-16/nesf.o
msp430-gcc -x assembler-with-cpp -c -mcpu=430x -mmpy=16 -I./../include -I. ./libm/fpmulparts.S -o Build/mcpu-430x/mmpy-16/fpmulparts.o
msp430-ar rc Build/mcpu-430x/mmpy-16/libfp.a Build/mcpu-430x/mmpy-16/divsf.o Build/mcpu-430x/mmpy-16/fixsfsi.o Build/mcpu-430x/mmpy-16/floatdisf.o Build/mcpu-430x/mmpy-16/gtsf.o Build/mcpu-430x/mmpy-16/mulsf.o Build/mcpu-430x/mmpy-16/addsf.o Build/mcpu-430x/mmpy-16/eqsf.o Build/mcpu-430x/mmpy-16/fixunssfdi.o Build/mcpu-430x/mmpy-16/floatsisf.o Build/mcpu-430x/mmpy-16/lesf.o Build/mcpu-430x/mmpy-16/negsf.o Build/mcpu-430x/mmpy-16/cmpsf.o Build/mcpu-430x/mmpy-16/fixsfdi.o Build/mcpu-430x/mmpy-16/fixunssfsi.o Build/mcpu-430x/mmpy-16/gesf.o Build/mcpu-430x/mmpy-16/ltsf.o Build/mcpu-430x/mmpy-16/subsf.o Build/mcpu-430x/mmpy-16/nesf.o Build/mcpu-430x/mmpy-16/fpmulparts.o
make[3]: Leaving directory `/home/jeff/msp430-toolchain/msp430libc/msp430-libc-20120224/src'
make[2]: Leaving directory `/home/jeff/msp430-toolchain/msp430libc/msp430-libc-20120224/src'
make[2]: Entering directory `/home/jeff/msp430-toolchain/msp430libc/msp430-libc-20120224/src'
install -c -m644 ../include/byteswap.h ../include/ctype.h ../include/debug.h ../include/endian.h ../include/errno.h ../include/inttypes.h ../include/isr_compat.h ../include/legacymsp430.h ../include/limits.h ../include/math.h ../include/msp430libc.h ../include/setjmp.h ../include/signal.h ../include/stdint.h ../include/stdio.h ../include/stdlib.h ../include/string.h /home/jeff/msp430-toolchain/out/msp430/include/
install -c -m644 ../include/sys/_ansi.h ../include/sys/cdefs.h ../include/sys/config.h ../include/sys/crtld.h ../include/sys/fdlibm.h ../include/sys/ieeefp.h ../include/sys/inttypes.h ../include/sys/reent.h ../include/sys/_types.h ../include/sys/types.h /home/jeff/msp430-toolchain/out/msp430/include/sys/
install -c -m644 ../include/bits/byteswap.h /home/jeff/msp430-toolchain/out/msp430/include/bits/
for i in `msp430-gcc --print-multi-lib 2>/dev/null`; do \
      dir=`echo $i | sed -e 's/;.*$//'` ; \
      mkdir -p /home/jeff/msp430-toolchain/out/msp430/lib/$dir; \
      make -w "MULTILIB_DIR=$dir" install-libc install-libm ; \
    done;
make[3]: Entering directory `/home/jeff/msp430-toolchain/msp430libc/msp430-libc-20120224/src'
install -c -m644 Build/./libc.a /home/jeff/msp430-toolchain/out/msp430/lib/./
install -c -m644 Build/./libm.a Build/./libfp.a /home/jeff/msp430-toolchain/out/msp430/lib/./
make[3]: Leaving directory `/home/jeff/msp430-toolchain/msp430libc/msp430-libc-20120224/src'
make[3]: Entering directory `/home/jeff/msp430-toolchain/msp430libc/msp430-libc-20120224/src'
install -c -m644 Build/mcpu-430x/libc.a /home/jeff/msp430-toolchain/out/msp430/lib/mcpu-430x/
install -c -m644 Build/mcpu-430x/libm.a Build/mcpu-430x/libfp.a /home/jeff/msp430-toolchain/out/msp430/lib/mcpu-430x/
make[3]: Leaving directory `/home/jeff/msp430-toolchain/msp430libc/msp430-libc-20120224/src'
make[3]: Entering directory `/home/jeff/msp430-toolchain/msp430libc/msp430-libc-20120224/src'
install -c -m644 Build/mmpy-16/libc.a /home/jeff/msp430-toolchain/out/msp430/lib/mmpy-16/
install -c -m644 Build/mmpy-16/libm.a Build/mmpy-16/libfp.a /home/jeff/msp430-toolchain/out/msp430/lib/mmpy-16/
make[3]: Leaving directory `/home/jeff/msp430-toolchain/msp430libc/msp430-libc-20120224/src'
make[3]: Entering directory `/home/jeff/msp430-toolchain/msp430libc/msp430-libc-20120224/src'
install -c -m644 Build/mcpu-430x/mmpy-16/libc.a /home/jeff/msp430-toolchain/out/msp430/lib/mcpu-430x/mmpy-16/
install -c -m644 Build/mcpu-430x/mmpy-16/libm.a Build/mcpu-430x/mmpy-16/libfp.a /home/jeff/msp430-toolchain/out/msp430/lib/mcpu-430x/mmpy-16/
make[3]: Leaving directory `/home/jeff/msp430-toolchain/msp430libc/msp430-libc-20120224/src'
make[2]: Leaving directory `/home/jeff/msp430-toolchain/msp430libc/msp430-libc-20120224/src'
make[1]: Leaving directory `/home/jeff/msp430-toolchain/msp430libc'


=> Elapsed time = 0m 48s



我們來看看 install 的東西吧, 發現 libc.a 和 libm.a 等, 這邊應該沒有 .so file , 因為MSP430的程式不會大到使用 so lib 的方式來進行動態連結吧 ?!


[jeff@localhost lib]$ pwd
/home/jeff/msp430-toolchain/out/msp430/lib
[jeff@localhost lib]$ ll
total 588
drwxr-xr-x 388 jeff jeff  16384 Apr  6  2012 ldscripts
-rw-r--r--   1 jeff jeff 188374 Mar 12 02:56 libc.a
-rw-r--r--   1 jeff jeff  40340 Mar 12 02:56 libfp.a
-rw-r--r--   1 jeff jeff 280698 Mar 12 02:56 libm.a
drwxrwxr-x   3 jeff jeff   4096 Mar 12 02:56 mcpu-430x
drwxrwxr-x   2 jeff jeff   4096 Mar 12 02:56 mmpy-16
-rw-r--r--   1 jeff jeff  63267 Apr  6  2012 msp430mcu.spec
[jeff@localhost lib]$

沒有留言:

張貼留言