1. configure,加上 CFLAGS 是避免 gcc 用到 /usr/include。
LDFLAGS="-Wl,-elf2flt=-s65535" \
CFLAGS="-I/sigma/armutils_2.8.0.2/toolchain/include" \
CXXFLAGS="-I/sigma/armutils_2.8.0.2/toolchain/include" \
./configure \
--host=arm-elf \
--prefix=/sigma/nano-x \
--with-x \
--disable-gl \
--disable-shared \
--disable-cygwin \
--x-includes=/usr/include \
--x-libraries=/sigma/nano-x/lib

2. make
Compiling Fl_Help_View.cxx...
Fl_Help_View.cxx: In method `void Fl_Help_View::format()':
Fl_Help_View.cxx:1698: internal error--unrecognizable insn:
(insn 7905 7902 7901 (set (reg:QI 14 lr)
(mem:QI (plus:SI (reg:SI 12 ip)
(const_int -2712 [0xfffff568])) 0)) -1 (nil)
(nil))
make[1]: *** [Fl_Help_View.o] Error 1

src/Fl_Help_View.cxx
把陣列改小即可,原來為 1024。
buf[512], // Text buffer
attr[512], // Attribute buffer
wattr[512], // Width attribute buffer
hattr[512], // Height attribute buffer
linkdest[512]; // Link destination

3. make again
Fl_GIF_Image.cxx: In method `Fl_GIF_Image::Fl_GIF_Image(const char *)':
Fl_GIF_Image.cxx:379: internal error--unrecognizable insn:
(insn 2921 2918 2917 (set (reg:QI 5 r5)
(mem:QI (plus:SI (reg:SI 2 r2)
(const_int -1916 [0xfffff884])) 0)) -1 (nil)
(nil))
make[1]: *** [Fl_GIF_Image.o] Error 1

src/Fl_GIF_Image.cxx
把下面的 code 移到函數外加上 static
// tables used by LZW decompresser:
short int Prefix[4096];
uchar Suffix[4096];

4. make again again
Linking fluid...
/sigma/armutils_2.8.0.2/toolchain/arm-elf/bin/ld.real: cannot find -lXext
collect2: ld returned 1 exit status
make[1]: *** [fluid] Error 1
configure 的 link 參數錯誤
LIBS="$LIBS -lXext -lX11 $X_EXTRA_LIBS"
==>
LIBS="$LIBS -lnx11 -lnano-X $X_EXTRA_LIBS"

5. make again again again
Generating fast_slow.fl...
../fluid/fluid: ../fluid/fluid: cannot execute binary file
make[1]: *** [fast_slow.cxx] Error 126
做出來的 fl 是 arm code 不能在 x86 執行是正常的.
把 test/Makefile 相關的 src 拿掉不要即可.

6. make again agian agian agian
OK, success.

7. make install
=== installing fluid ===
Installing FLUID in /sigma/nano-x/bin...
arm-elf-strip: /sigma/nano-x/bin/fluid: File format not recognized
make[1]: *** [install] Error 1
strip 有問題, 拿掉即可.
fluid/Makefile
$(STRIP) $(DESTDIR)$(bindir)/fluid$(EXEEXT)
==>
# $(STRIP) $(DESTDIR)$(bindir)/fluid$(EXEEXT)

8. make install again
OK, success.

台南小新 發表在 痞客邦 PIXNET 留言(0) 人氣()