Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

Linux 交叉編譯 tslib-1.4 錯誤排除:autoreconf 缺失與 rpl_malloc 未定義完整解決

編輯:Linux 教學

交叉編譯環境:Host x86_64 → Target ARM (arm-linux)

錯誤一:autoreconf not found

./autogen.sh: 4: autoreconf: not found

解決: 安裝 GNU Autotools 完整套件:

sudo apt-get install autoconf automake libtool

錯誤二:undefined reference to `rpl_malloc` 連結失敗

ts_test.o: undefined reference to `rpl_malloc'
fbutils.o: undefined reference to `rpl_malloc'
collect2: ld returned 1 exit status

原因: configure 未正確偵測目標平台 malloc 行為,導致引用 GNU 替代函式 rpl_malloc 但未連結對應物件。

解決: 重新執行 configure 並明確指定 ac_cv_func_malloc_0_nonnull=yes:

./configure --prefix=/usr/local/tslib/ --host=arm-linux ac_cv_func_malloc_0_nonnull=yes

完整編譯安裝流程

  1. tar xzvf tslib-1.4.tar.gz && cd tslib-1.4
  2. ./autogen.sh (產生 configure)
  3. ./configure --prefix=/usr/local/tslib/ --host=arm-linux ac_cv_func_malloc_0_nonnull=yes
  4. make
  5. sudo make install

補充說明

  • --host=arm-linux 指定交叉編譯工具鏈前綴 (需已安裝 arm-linux-gcc 等)。
  • ac_cv_func_malloc_0_nonnull=yes 告訴 configure 目標平台 malloc(0) 回傳非 NULL,避免引用 rpl_malloc。
  • 若仍報錯,檢查 config.log 確認編譯器測試結果,必要時手動編輯 config.h 定義 HAVE_MALLOC 1、取消 HAVE_RPL_MALLOC。
Copyright © Windows教程網 All Rights Reserved