Issues while build insight-6.8-1 with –target=spare-elf configuration

使用 insight-6.8-1

% ../insight-6.8-1/configure --target=sparc-elf --prefix=$OPT/sparc-elf-4.7.0 --disable-nls --disable-werror

會出現以下 error messages:

...
/GNU/SRC/insight-6.8-1/sim/erc32/float.c:173:2: warning: #warning no fpu trap support for this target [-Wcpp]
gcc -DHAVE_CONFIG_H     -DPROFILE=1 -DWITH_PROFILE=-1          -DDEFAULT_INLINE=0           -DSTAT -DFAST_UART -DIUREV0 -DMECREV0   -I. -I/GNU/SRC/insight-6.8-1/sim/erc32 -I../common -I/GNU/SRC/insight-6.8-1/sim/erc32/../common -I../../include -I/GNU/SRC/insight-6.8-1/sim/erc32/../../include -I../../bfd -I/GNU/SRC/insight-6.8-1/sim/erc32/../../bfd -I../../opcodes -I/GNU/SRC/insight-6.8-1/sim/erc32/../../opcodes  -g -O2 -o sis 
  sis.o exec.o erc32.o func.o help.o float.o  ../../bfd/libbfd.a ../../opcodes/libopcodes.a  ../../libiberty/libiberty.a -lnsl  ../../readline/libreadline.a  -lm 
../../readline/libreadline.a(display.o): In function `cr':
/GNU/SRC/insight-6.8-1/readline/display.c:2205: undefined reference to `tputs'
../../readline/libreadline.a(display.o): In function `_rl_move_cursor_relative':
/GNU/SRC/insight-6.8-1/readline/display.c:1719: undefined reference to `tputs'
/GNU/SRC/insight-6.8-1/readline/display.c:1745: undefined reference to `tputs'
../../readline/libreadline.a(display.o): In function `_rl_move_vert':
/GNU/SRC/insight-6.8-1/readline/display.c:1783: undefined reference to `tputs'
...

查了很久之後,發現是 link erc32 時少了 ncurses 這個 library,也就是少了 -lncurses。
解法:patch insight-6.8-1 source code:
edit ./insight-6.8-1/sim/erc32/Makefile.in

 
Line.25:    SIM_EXTRA_LIBS = $(READLINE_LIB) $(TERMCAP_LIB) -lm -lncurses

重新編譯安裝就OK了!

% ../insight-6.8-1/configure --target=sparc-elf --prefix=$OPT/sparc-elf-4.7.0 --disable-nls --disable-werror
% make
% make install

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *