1. 程式人生 > 實用技巧 >crosstool-ng詳解【轉】

crosstool-ng詳解【轉】

轉自:https://www.crifan.com/files/doc/docbook/crosstool_ng/release/html/crosstool_ng.html

crosstool-ng詳解

版本:v2.0

CrifanLi

摘要

本文主要介紹了什麼是crosstool-ng,crosstool-ng的名字的寫法的含義,為何要有crosstool-ng,crosstool-ng的各種特點,crosstool-ng的使用的基本邏輯;

下載crosstool-ng,安裝crosstool-ng到當前系統環境中;

接著介紹了crosstool-ng的常見資料夾的結構組織,關於crosstool-ng本身的一些背景知識和邏輯,比如用ct-ng help檢視所擁有的功能,用ct-ng list-steps檢視本身的build過程分成哪幾步,用ct-ng list-samples檢視當前已包含哪些預設的示例配置,用ct-ng show-tuple檢視當前配置的是什麼交叉編譯器,用ct-ng version檢視當前crosstool-ng的版本,然後介紹了crosstool-ng本身的配置的使用的基本邏輯,包含使用已有的crosstool-ng的示例配置和根據需要去修改你的crosstool-ng的配置

然後極其詳細的解釋了crosstool-ng中的各種配置引數含義和用法,主要包含幾個方面:crosstool-ng工具相關的配置引數,比如多執行緒編譯以節省時間,從之前錯誤的那一步恢復繼續編譯,出錯時不立刻退出等,再介紹crosstool-ng核心配置詳解,包括crosstool-ng本身相關的重要引數,比如原始碼包下載儲存路徑,工作路徑,目標安裝路徑,和交叉編譯相關的核心引數,包括舉例說明Architecture level, Emit assembly for CPU, Tune for CPU如何去配置,以及其他重要引數,比如MMU,大小端Endianness,浮點處理單元FPU,CFLAGS引數,Linux核心版本,binutils版本,gcc版本,C庫的選擇,執行緒模型的選擇等。

接著介紹用ct-ng build編譯crosstool-ng的過程,然後總結了crosstool-ng常見問題及解決辦法,包括幾方面:安裝crosstool-ng工具本身的,crosstool-ng在配置階段的,crosstool-ng在編譯階段的

最後介紹了與crosstool-ng相關的一些事項,比如crosstool-ng的作者的主頁,linaro對crosstool-ng的支援,Buildroot支援crosstool-ng。

本文提供多種格式供:
線上閱讀 HTML HTMLs PDF CHM TXT RTF WEBHELP
下載(7zip壓縮包) HTML
HTMLs PDF CHM TXT RTF WEBHELP

HTML版本的線上地址為:

http://www.crifan.com/files/doc/docbook/crosstool_ng/release/html/crosstool_ng.html

有任何意見,建議,提交bug等,都歡迎去討論組發帖討論:

http://www.crifan.com/bbs/categories/crosstool_ng/

2013-09-04

修訂歷史
修訂 2.0 2013-09-04 crl
  1. 將帖子內容整理過來
  2. 添加了關於配置的詳細解釋
  3. 添加了關於常見錯誤的總結

本文章遵從:署名-非商業性使用 2.5 中國大陸(CC BY-NC 2.5)


目錄

前言
1. 本文目的
2. 待完成
1. crosstool-ng簡介
1.1. 什麼是crosstool-ng
1.2. crosstool-ng的名字的寫法
1.3. 為何要有crosstool-ng
1.4. crosstool-ng的特點
1.4.1. 支援(類似於Linux核心配置的那個)menuconfig
1.4.2. 支援足夠多,且越來越多的架構(architecture)
1.4.3. 支援工具鏈中可選多種不同的C庫等模組
1.4.4. 支援不同目標OS平臺
1.4.5. 補丁倉庫
1.4.6. 支援不同的執行緒模型
1.4.7. 支援軟浮點和硬體浮點
1.4.8. 支援multlib的工具鏈(暫處於試驗階段)
1.4.9. 支援眾多除錯相關的內容
1.4.10. 提供示例配置
1.4.11. 支援多種主機編譯環境:各種Linux發行版,Cygwin等
1.5. crosstool-ng的使用的基本邏輯
2. 下載和安裝crosstool-ng
2.1. 下載crosstool-ng
2.2. 安裝crosstool-ng
3. 配置crosstool-ng:ct-ng menuconfig
3.1. 關於crosstool-ng本身的一些背景知識和邏輯
3.1.1. 用ct-ng help檢視所擁有的功能
3.1.2. 用ct-ng list-steps檢視本身的build過程分成哪幾步
3.1.3. 用ct-ng list-samples檢視當前已包含哪些預設的示例配置
3.1.4. 用ct-ng show-tuple檢視當前配置的是什麼交叉編譯器
3.1.5. 用ct-ng version檢視當前crosstool-ng的版本
3.2. crosstool-ng本身的配置的使用的基本邏輯
3.2.1. 使用已有的crosstool-ng的示例配置
3.2.2. 根據需要去修改你的crosstool-ng的配置
3.3. crosstool-ng的配置引數詳解
3.3.1. crosstool-ng工具相關的配置引數
3.3.1.1. 多執行緒編譯以節省時間
3.3.1.2. 從之前錯誤的那一步恢復繼續編譯
3.3.1.3. 出錯時不立刻退出
3.3.2. crosstool-ng核心配置詳解
3.3.2.1. crosstool-ng本身相關的重要引數
3.3.2.1.1. 原始碼包下載儲存路徑
3.3.2.1.2. 工作路徑
3.3.2.1.3. 目標安裝路徑
3.3.2.2. 交叉編譯相關的核心引數
3.3.2.2.1. crosstool-ng中的配置引數:Architecture level, Emit assembly for CPU, Tune for CPU
3.3.2.2.2. crosstool-ng中的配置引數:MMU
3.3.2.2.3. crosstool-ng中的配置引數:大小端Endianness
3.3.2.2.4. crosstool-ng中的配置引數:浮點處理單元FPU
3.3.2.2.5. crosstool-ng中的配置引數:CFLAGS引數
3.3.2.2.6. crosstool-ng中的配置引數:Linux核心版本
3.3.2.2.7. crosstool-ng中的配置引數:binutils版本
3.3.2.2.8. crosstool-ng中的配置引數:gcc版本
3.3.2.2.9. crosstool-ng中的配置引數:C庫的選擇
3.3.2.2.10. crosstool-ng中的配置引數:執行緒模型的選擇
4. 編譯crosstool-ng:ct-ng build
5. crosstool-ng常見問題及解決辦法
5.1. 安裝crosstool-ng工具本身的階段常見問題及解決辦法
5.1.1. 缺少一些開發相關的工具
5.1.1.1. configure: error: missing required tool: bison
5.1.1.2. configure: error: missing required tool: flex
5.1.1.3. configure: error: missing required tool: gperf
5.1.1.4. configure: error: missing required tool: makeinfo
5.1.1.5. configure: error: could not find GNU awk
5.1.1.6. configure: error: could not find GNU libtool >= 1.5.26
5.1.1.7. configure: error: could not find GNU automake >= 1.10
5.1.1.8. configure: error: could not find curses header, required for the kconfig frontends
5.1.2. 在Cygwin下出現的一些問題
5.1.2.1. zconf.tab.o:zconf.tab.c:(.text+0x162a): undefined reference to ‘_libintl_gettext'
5.1.2.2. lxdialog/menubox.o:menubox.c:(.text+0x7d): undefined reference to `_wattrset'
5.1.2.3. nconf.c:1521:2: error: lvalue required as left operand of assignment
5.1.2.4. bash: ct-ng: command not found
5.1.2.5. Win7下無法編輯儲存Cygwin中的檔案
5.2. crosstool-ng在編譯階段常見問題及解決辦法
5.2.1. 不論何種平臺下編譯crosstool-ng常見錯誤及解決辦法
5.2.1.1. scripts/unifdef.c:209:25: error: conflicting types for ‘getline'
5.2.1.2. Build failed in step ‘Extracting and patching toolchain components’,in function ‘CT_DoExecLog’ (line unknown, sorry)
5.2.1.3. [libgcc/./_powisf2.o] Error 1,/tmp/cc7Xh6xp.s:21: Error: selected processor does not support ARM mode `fmsr s14,r0′
5.2.1.4. .build/arm-xscale-linux-gnueabi/buildtools/include/cloog/ppl_backend.h:54: undefined reference to `_ppl_finalize'
5.2.1.5. Makefile:240: *** mixed implicit and normal rules. Stop.
5.2.1.5.1. 手動修改每個Makefile中對應的混合規則->使得3.82的make可以識別
5.2.1.5.2. 把3.82的make換成3.81版本的make
5.2.1.5.2.1. 把你當前的(Linux或Cygwin等)系統環境中的3.82的make換成3.81的make
5.2.1.5.2.2. 用crosstool-ng中提供的3.81的make(而不用更換系統環境中的3.82的make)
5.2.2. Cygwin下編譯crosstool-ng常見錯誤及解決辦法
5.2.2.1. Cygwin下編譯crosstool-ng時導致記憶體洩露
5.2.2.2. Your file system in ‘xxx/targets’ is *not* case-sensitive!
5.2.3. Linux下編譯crosstool-ng常見錯誤及解決辦法
5.2.3.1. gcc-4.2.2/gcc/regrename.c:1646:12: error: ‘IFCVT_ALLOW_MODIFY_TEST_IN_INSN’ undeclared (first use in this function)
6. 與crosstool-ng相關的一些事項
6.1. crosstool-ng的作者的主頁
6.2. crosstool-ng支援Linaro的gcc
6.3. Buildroot支援crosstool-ng
參考書目

範例清單

3.1.從出錯的那一步恢復重新繼續編譯
3.2.如何在編譯失敗後,修復錯誤,然後繼續接著編譯
3.3.舉例說明Architecture level, Emit assembly for CPU, Tune for CPU如何去配置
4.1.正常輸出的log資訊

前言

目錄

1. 本文目的
2. 待完成

1.本文目的

本文目的在於,介紹關於crosstool-ng的各種方面,包括如何下載安裝和使用,如何配置和編譯等等。

使得對於crosstool-ng不熟悉的人,都可以很快上手,可以實現自己用crosstool-ng,編譯出來一個自己的交叉編譯器。

2.待完成

第1章crosstool-ng簡介

目錄

1.1. 什麼是crosstool-ng
1.2. crosstool-ng的名字的寫法
1.3. 為何要有crosstool-ng
1.4. crosstool-ng的特點
1.4.1. 支援(類似於Linux核心配置的那個)menuconfig
1.4.2. 支援足夠多,且越來越多的架構(architecture)
1.4.3. 支援工具鏈中可選多種不同的C庫等模組
1.4.4. 支援不同目標OS平臺
1.4.5. 補丁倉庫
1.4.6. 支援不同的執行緒模型
1.4.7. 支援軟浮點和硬體浮點
1.4.8. 支援multlib的工具鏈(暫處於試驗階段)
1.4.9. 支援眾多除錯相關的內容
1.4.10. 提供示例配置
1.4.11. 支援多種主機編譯環境:各種Linux發行版,Cygwin等
1.5. crosstool-ng的使用的基本邏輯

1.1.什麼是crosstool-ng

crosstool-ng,全稱是crosstool Next Generation,即下一代crosstool,即crosstool的升級版

可能有人會問,什麼是crosstool?

crosstool,是個交叉編譯器的製作工具。

可能又有人問,什麼是交叉編譯器,什麼又是交叉編譯器的製作工具?

那你可以去看我的教程:

交叉編譯詳解

中的詳細解釋:

藉助別人的工具去製作交叉編譯器

另外,關於crosstool的詳細解釋,可參見:

crosstool

知道了crosstool-ng是個交叉編譯器的製作工具後,再來解釋,crosstool-ng的由來:

crosstool-ng的官網是:

crosstool-ng

crosstool-ng是作者Yann E. MORIN,在Dan Kegel寫的crosstool的基礎上,做了全新的升級。

目標在於,在製作交叉編譯器方面,更加容易使用。

1.2.crosstool-ng的名字的寫法

其實,crosstool-ng的官網中,都已經專門強調和解釋了,關於crosstool-ng,這個名字的,在不同情況下的寫法:

Refering to crosstool-NG

下面簡要翻譯一下為:

crosstool-ng名稱的寫法和含義.

  • crosstool-NG

    此專案的標準名稱,全名,長名稱。

    crosstool和NG之間用短橫線連線

    crosstool小寫

    NG大寫

  • CT-NG

    全部大寫

    是全稱crosstool-NG的縮寫

    CT和NG之間用短橫線連線

  • ct-ng

    全稱縮寫後的小寫版本,全部小寫

    一般是在前端,即使用此crosstool-NG這個工具的時候,其工具名

    後面你會在第2章下載和安裝crosstool-ng中看到,安裝完畢crosstool-NG後

    接著去使用此crosstool-NG,都是用的是ct-ng,比如

    ct-ng help
    ct-ng menuconfig
    ct-ng build
                    

    等等

一般來說,建議用長名稱crosstool-NG,而不要用短名CT-NG在郵件主題中(為了使標題不要太長),可以使用短名CT-NG

crosstool-ng版本的寫法和含義.

  • crosstool-NG X.Y.Z

    長名稱

    crosstool-NG和版本號X.Y.Z之間有空格

  • crosstool-ng-X.Y.Z

    長名稱的小寫版

    名稱和版本之間用短橫線連線

    一般用於釋出tar包的時候

  • crosstool-ng-X.Y.Z+hg_id

    長名稱的小寫版本,加上短橫線,加上版本號,加上加號,再加上Hg的ID(其可以通過ct-ng version而得到)

    用於區分發行版(releases)和快照版(snapshots)

下文中,如無特殊說明,為了省事,都還是採用crosstool-ng的寫法。

1.3.為何要有crosstool-ng

簡言之就是:

之前的crosstool,做的不是足夠好,所以才有人(Yann E. MORIN)弄出了個更好這個:crosstool-ng

再詳細解釋一下就是:

crosstool,對於之前製作交叉編譯器來說,算數屬於首選的工具,已經很不錯了。

但是隨著時間的發展,其相對來說,還是沒有足夠好,足夠好用。

加上,後者缺乏足夠的維護。

所以後來Yann E. MORIN就去弄了個next generation的crosstool,叫做crosstool-ng。

其宗旨就是:讓交叉編譯器的製作,更加簡單,讓製作交叉編譯器的工具,更加好用。

至於,如何變得簡單好用了,就是後面要去介紹的:第1.4節 “crosstool-ng的特點”了。

1.4.crosstool-ng的特點

下面,根據我的瞭解,整理一下,crosstool-ng,作為一個交叉編譯器的製作工具,所具有的優點:

1.4.1.支援(類似於Linux核心配置的那個)menuconfig

menuconfig,用的最為廣泛,支援度最好,最好用。

menuconfig可以稱為:即簡單,又好用。

用過的都知道。

關於make menuconfig,不熟悉的可以參考:

【整理】make config,make menuconfig,make oldconfig,make xconfig,make defconfig,make gconfig

1.4.2.支援足夠多,且越來越多的架構(architecture)

目前已經支援眾多了架構了:

Alpha, ARM, AVR32 (EXP), Blackfin (EXP), MIPS, OpenRISC/or32(+), PowerPC, s390, SPARC (EXP), SuperH (EXP), x86

且以後會支援越來越多。

相比較而言,之前的交叉編譯器製作工具,支援的架構,比crosstool-ng更多,好像沒幾個。

1.4.3.支援工具鏈中可選多種不同的C庫等模組

支援基於uClibc, glibc或eglibc的工具鏈

支援其他型別的,也很容易新增

詳見:第3.3.2.2.9節 “crosstool-ng中的配置引數:C庫的選擇”

1.4.4.支援不同目標OS平臺

支援2種目標執行環境:

Linux

bare metal

詳見:交叉編譯器名字中的kernel部分

1.4.5.補丁倉庫

為許多種現存的,已知bug的,需要打包的各種模組,提供了一個補丁倉庫。

如此可以實現:可以自動去幫你打上,已知的,需要打補丁的各種模組

從而,避免了各種編譯的錯誤,製作出來的交叉編譯器的各種問題

極大程度上的節省了你的精力和時間,和降低了製作交叉編譯器的難度

1.4.6.支援不同的執行緒模型

支援2種執行緒模型:

NPTL

linuxthreads

詳見:第3.3.2.2.10節 “crosstool-ng中的配置引數:執行緒模型的選擇”

1.4.7.支援軟浮點和硬體浮點

詳見:第3.3.2.2.4節 “crosstool-ng中的配置引數:浮點處理單元FPU”

1.4.8.支援multlib的工具鏈(暫處於試驗階段)

1.4.9.支援眾多除錯相關的內容

支援很多用來除錯(debug)的工具:

本地的和跨平臺的gdb,gdbserver

除錯庫:dmalloc, duma

以及一些其他功能,比如從編譯失敗的那一步,恢復重新編譯,從而節省你的大量的時間和精力

詳見:第3.3.1節 “crosstool-ng工具相關的配置引數”中的:

第3.3.1.1節 “多執行緒編譯以節省時間”

第3.3.1.2節 “從之前錯誤的那一步恢復繼續編譯”

1.4.10.提供示例配置

背景是:對於交叉編譯器的配置,涉及到各個模組的各個版本,自己配置不好的話,很容易出現各種問題,比如版本不相容

而此處提供了,很多個,已經經過驗證的配置,針對各個架構(CPU)的各種預設配置

如此,你就可以利用已有的配置,從而簡化你的配置的複雜度,極大的降低了你製作交叉工具鏈的難度,時間,精力。

詳見:第3.1.3節 “用ct-ng list-samples檢視當前已包含哪些預設的示例配置”

1.4.11.支援多種主機編譯環境:各種Linux發行版,Cygwin等

crosstool-ng,不僅支援,普通的各種Linux發行版,比如常見的Ubuntu

還支援Cygwin

這意味著,在純的Windows環境下

(用Cygwin模擬Linux環境,在Cygwin下製作交叉編譯器等等,在Cygwin下用交叉編譯器去編譯uboot,kernel等等)

也可以去折騰嵌入式開發了

1.5.crosstool-ng的使用的基本邏輯

在詳細介紹,然後下載和安裝crosstool-ng,如何配置,如何編譯crosstool-ng之前,需要先解釋一下,crosstool-ng,這個工具,的使用的基本邏輯。

其實,這部分的內容,作者在主頁:

crosstool-NG: Download and usage

中,已經解釋過了,只是相對比較言簡意賅,不是足夠詳細。

此處,就來詳細的解釋一下:

在使用crosstool-ng之前,實際上,要明白,有兩個概念,不要混淆了:

  1. 下載,編譯,安裝crosstool-ng工具本身(到當前的Linux,Cygwin等系統中,供後續使用)

    crosstool-ng,作為一個工具,尤其是在Linux領域裡

    很明顯,也有對應的原始碼包,即:也需要,通過下載對應的原始碼,去編譯原始碼,然後再安裝到當前的系統中

    其整體的邏輯,和下載,編譯,安裝,別的,Linux下的軟體包,沒有啥特殊區別。

    Linux下安裝第三方工具的基本邏輯

    Linux的世界中,使用某個工具軟體,和Windows下,不太一樣

    更多的時候,是自己從原始碼中編譯並安裝

    所以,需要自己找到自己要的原始碼包,即下載,然後去配置,再去編譯和安裝。

    即:下載,配置,編譯,安裝

    對於這方面的邏輯,不是很熟悉的話,可參考我總結的:

    軟體開發基礎之linux下安裝某個軟體的邏輯和過程

  2. 用crosstool-ng這個工具(即ct-ng)去製作(配置和編譯)所需要的交叉編譯器

    在安裝了crosstool-ng這個工具後,就可以去使用ct-ng了。

    然後才是去,配置,和編譯,以便製作出對應的相應的交叉編譯器

    即,用crosstool-ng這個,製作交叉編譯器的工具,去製作交叉編譯器,的基本步驟,包括:

    1. 配置

      即,為了你要製作的交叉編譯器,去配置各種引數

      比如CPU是arm還是mips還是其他,執行目標平臺是Linux還是bare metal,所用的C庫是elibc,還是glibc,還是uclibc等,等等的配置。

      選用合適的配置,一般的做法,主要有兩種:

      • 直接利用已有的配置

        crosstool-ng,本身已經支援很多種體系結構的配置

        很多時候,你可以直接使用已有的配置,而基本無需更改了。

        對應的命令一般是:

        ct-ng some_default_config
      • 利用已有的,最接近你的需求的配置,再手動去改改

        有時候,你所需要編譯的交叉編譯器,和已有的各種配置中,都沒有合適的,沒有滿足你的需求的

        那麼就要你,去找一個,和你的需求最接近的一個配置

        利用該配置,然後再去修改一些引數,達到最終你想要的效果

        對應的命令一般是:

        ct-ng some_default_config
        ct-ng menuconfig
                                    
    2. 編譯

      等所有的配置都完畢後,就可以去編譯,生成你所需要的交叉編譯器了。

      對應的命令一般是:

      ct-ng build

    當然,在配置和編譯之前和過程中,你需要搞懂很多東西,比如:

    你自己的處理器是什麼,所要使用的目標系統是什麼,要用什麼C庫等

    並且還要,根據這些已有資訊,搞清楚如何去配置crosstool-ng等等。

    這也就是,此文接下來要解釋的內容。

第2章下載和安裝crosstool-ng

目錄

2.1. 下載crosstool-ng
2.2. 安裝crosstool-ng

在使用crosstool-ng,為我們製作交叉編譯器之前,需要下載crosstool-ng的原始碼,並且編譯安裝crosstool-ng,到我們的當前的(Linux或Cygwin等)系統中。

2.1.下載crosstool-ng

去crosstool-ng的下載頁面:

http://crosstool-ng.org/download/crosstool-ng/

中,下載最新版的crosstool-ng。

截至本文此刻,最新版本是:

crosstool-ng-1.18.0.tar.bz2

crosstool-ng的最新版本不是下載頁面最下面的那個crosstool-ng-1.9.3的版本

之前自己第一次開始去折騰crosstool-ng的時候,從主頁

http://crosstool-ng.org/

中找到了:

crosstool-ng的下載頁面

然後,按照正常的邏輯,頁面一直下拉到最低端,然後去下載那個:

crosstool-ng-1.9.3.tar.bz2

以為,理所當然的是最新的版本了,然後接著去折騰:

【記錄】在Cygwin下編譯gcc-3.4.5-glibc-2.3.6的arm-xscale-linux-gnu交叉編譯器

結果弄到後來,很多錯誤:

【未解決】crosstool-ng編譯出錯:Installing C library headers中的make[3]: xxx/sys-root/usr/include/sys/uio.h] Error 1

然後最後實在不行了,然後無意間發現,原先最新的版本,不是之前的,crosstool-ng-1.9.3,而是:crosstool-ng-1.18.0

對應的,也是在上述所說的下載頁面中,下載地址是:

crosstool-ng-1.18.0.tar.bz2

然後後來才是用此,真正最新的版本,去折騰的:

【記錄】重試使用最新版本1.18.0的crosstool-ng去配置和編譯xscale的交叉編譯器

然後,本來都想去報告作者的,其此下載頁面,搞得檔案排序,和一般的,不太一樣啊,

一般的下載頁面,都是保證最下面或最上面是最新版本,方便使用者下載的。

對應的,檔案排序,是要按照數字大小排序,而不是此處的按照ascii字元排序。

然後後來發現,作者貌似自己已經意識到此問題了,所以,在下載頁面,又多了個空檔案,放在下載頁面最開始,名字就叫做:

00-LATEST-is-1.18.0

以此,來通知來下載的人,不要搞錯了。

而實際上,誤把crosstool-ng-1.9.3當做最新版本的人,我之前也在網路上看到有過的。

所以,即使是如此的,小問題,實際上,也是需要作者,處理的更好,以更方便使用者使用的。

否則,就容易出現這類的問題了。

在此,實際上,還是建議作者,如果可以,還是去修改伺服器,保證檔案排序是可以通過先ascii字元排序,對於檔案中的數字部分,即各個版本號,按照數字的值去排序

注:Total Commander中,是支援此種排序的。感興趣的去看:

【已解決】total commander裡面的檔名是中文加數字而無法正常排序

2.2.安裝crosstool-ng

在介紹將crosstool-ng安裝到當前系統之前,先要說一下:

目前crosstool-ng,除了支援普通的Linux發行版,比如Ubuntu之外,還支援Cygwin環境的。

而我們此處的目標是:把crosstool-ng安裝到當前(Linux或Cygwin等)系統中。

所以,接下來的步驟,相對其實很簡單,還是常見的:

./configure --prefix=/opt/crosstool-ng
make
make install
    

步驟而已。

詳細過程,可參考:

詳見:【記錄】在Ubuntu下用crosstool-ng編譯xscale的交叉工具鏈

詳見:【記錄】重試使用最新版本1.18.0的crosstool-ng去配置和編譯xscale的交叉編譯器

雖然,安裝crosstool-ng本身,這個過程中,相對很簡單。

但是:

  • Ubuntu

    由於在Ubuntu下,預設系統沒有安裝很多開發工具,導致也還是會遇到一對缺少某工具的情況

    詳見:第5.1.1節 “缺少一些開發相關的工具”

  • Cygwin

    雖然Cygwin只是針對Linux系統的模擬,而不是真正的Linux

    但是,由於我之前安裝了所有的開發工具,所以,此處對於Ubuntu下出現的缺少某工具的問題

    倒真的還是很少出現的。

在上述配置,編譯,安裝crosstool-ng之後,還要做一個事情,那就是:

要把對應的crosstool-ng,這個工具,對應的可執行檔案:ct-ng所在的路徑,加入到你的環境變數中去。

我一般所用的步驟是:修改當前使用者的.bashrc然後將最後一行的PATH變數中,加上此處對應的路徑/opt/crosstool-ng/bin,即可。

修改後的.bashrc中最後一行,帶PATH的值,類似於這樣:

PATH=$PATH:/opt/crosstool-ng/bin

具體過程,詳見:

【記錄】在Ubuntu下用crosstool-ng編譯xscale的交叉工具鏈

【記錄】在Cygwin下編譯gcc-3.4.5-glibc-2.3.6的arm-xscale-linux-gnu交叉編譯器

當安裝crosstool-ng期間出問題

當安裝crosstool-ng期間出問題

就先去看看,後面所總結的,常見的錯誤總結:

第5.1節 “安裝crosstool-ng工具本身的階段常見問題及解決辦法”

第3章配置crosstool-ng:ct-ng menuconfig

目錄

3.1. 關於crosstool-ng本身的一些背景知識和邏輯
3.1.1. 用ct-ng help檢視所擁有的功能
3.1.2. 用ct-ng list-steps檢視本身的build過程分成哪幾步
3.1.3. 用ct-ng list-samples檢視當前已包含哪些預設的示例配置
3.1.4. 用ct-ng show-tuple檢視當前配置的是什麼交叉編譯器
3.1.5. 用ct-ng version檢視當前crosstool-ng的版本
3.2. crosstool-ng本身的配置的使用的基本邏輯
3.2.1. 使用已有的crosstool-ng的示例配置
3.2.2. 根據需要去修改你的crosstool-ng的配置
3.3. crosstool-ng的配置引數詳解
3.3.1. crosstool-ng工具相關的配置引數
3.3.1.1. 多執行緒編譯以節省時間
3.3.1.2. 從之前錯誤的那一步恢復繼續編譯
3.3.1.3. 出錯時不立刻退出
3.3.2. crosstool-ng核心配置詳解
3.3.2.1. crosstool-ng本身相關的重要引數
3.3.2.1.1. 原始碼包下載儲存路徑
3.3.2.1.2. 工作路徑
3.3.2.1.3. 目標安裝路徑
3.3.2.2. 交叉編譯相關的核心引數
3.3.2.2.1. crosstool-ng中的配置引數:Architecture level, Emit assembly for CPU, Tune for CPU
3.3.2.2.2. crosstool-ng中的配置引數:MMU
3.3.2.2.3. crosstool-ng中的配置引數:大小端Endianness
3.3.2.2.4. crosstool-ng中的配置引數:浮點處理單元FPU
3.3.2.2.5. crosstool-ng中的配置引數:CFLAGS引數
3.3.2.2.6. crosstool-ng中的配置引數:Linux核心版本
3.3.2.2.7. crosstool-ng中的配置引數:binutils版本
3.3.2.2.8. crosstool-ng中的配置引數:gcc版本
3.3.2.2.9. crosstool-ng中的配置引數:C庫的選擇
3.3.2.2.10. crosstool-ng中的配置引數:執行緒模型的選擇

相關舊帖:【總結】crosstool-ng使用心得和注意事項

crosstool-ng中關於配置,此處,主要介紹兩個大的方面:

  1. crosstool-ng本身的配置的使用的基本邏輯

    關於crosstool-ng的配置本身,其實也有一定的使用邏輯和技巧。

    這些邏輯和技巧,實際上,作者在其主頁:

    Using a released version

    中已經解釋過了,此處,是加上自己實際折騰的經驗的基礎上

    再次整理出來,解釋清楚:第3.2節 “crosstool-ng本身的配置的使用的基本邏輯”

  2. crosstool-ng的配置期間,各種配置引數的含義,如何去配置

    很明顯,由於配置引數極多,並且,不同版本中,也可能發生細微的變化,所以不可能面面俱到的解釋所有的配置引數的詳細的含義。

    但是,又很明顯,一些常見的引數,核心的引數,重要的引數,則至始至終,都不會改變的,而且也是必須要搞懂的。

    所以,此處,主要介紹crosstool-ng中,常見的,核心的那些引數。

    而這些常見的,核心的引數,根據其相關性,又主要分兩方面:

使用ct-ng之前的一些說明

在開始使用crosstool-ng這個工具之前,即使用ct-ng之前,有個事情要提醒一下:

最好,或者說,一般常見的做法是:

單獨為後續使用crosstool-ng製作交叉編譯去,而建立一個單獨的資料夾

即,執行後續的ct-ng menuconfigct-ng build等命令,所處在的路徑

比如:我之前,除了,解壓crosstool所得的資料夾crosstool-ng-1.18.0之外,去建立了一個對應的資料夾:crosstool-ng-1.18.0_build

同時,為了後續crosstool-ng下載對應的各個包,也建立了對應的srcx-tools兩個資料夾。

然後,此刻的目錄結構就是:

crosstool-ng-1.18.0
crosstool-ng-1.18.0_build
src
x-tools
crosstool-ng-1.18.0.tar.bz2
        

crosstool-ng的原始碼包:,解壓後的資料夾

包含了crosstool-ng的相關原始碼

專門為後期使用crosstool-ng去建立交叉編譯器,的編譯(build),而專門建立的資料夾

對應的,後續的ct-ng menuconfigct-ng build等命令,都是在此資料夾下執行的。

為crosstool-ng中,後續需要下載各種軟體的原始碼包,而準備的,

crosstool-ng中,在開始執行build之後,會去下載對應的原始碼包,都會存放到這個資料夾下

這個資料夾,是,用crosstool-ng所生成的交叉編譯器,所在的路徑。

對應的配置中,會有,類似於:

(${HOME}/develop/crosstool-ng/x-tools/${CT_TARGET}) Prefix directory

的配置,用來指定生成的交叉編譯器,存放在何處。

此時,就是去設定為此處對應的路徑即可。

很明顯,這個就是之前我在折騰crosstool-ng-1.18.0時,去下載的原始碼包了。

對應的上面的,就是此原始碼包解壓後的路徑。

如此,後續的編譯,才顯得,相對更加有組織,不至於顯得結構太混亂。

3.1.關於crosstool-ng本身的一些背景知識和邏輯

在去使用和crosstool-ng之前,需要了解一些,和crosstool-ng本身的一些邏輯和背景知識。

然後才能對於後面的配置和編譯,如何使用crosstool-ng,有個真正的理解。

3.1.1.用ct-ng help檢視所擁有的功能

正如Linux世界中的常見邏輯,crosstool-ng中,也可以通過help,檢視到,其本身具有哪些功能:

CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng help
This is crosstool-NG version 1.18.0

Copyright (C) 2008  Yann E. MORIN <[email protected]>
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

See below for a list of available actions, listed by category:

Configuration actions:
  menuconfig         - Update current config using a menu based program
  oldconfig          - Update current config using a provided .config as base
  extractconfig      - Extract to stdout the configuration items from a
                       build.log file piped to stdin
  defconfig          - Save current config as a mini-defconfig to ${CONFIG}
  olddefconfig       - Update config from a mini-defconfig ${CONFIG}
                       (default: ${CONFIG}=./defconfig)
  saveconfig         - Save current config as a preconfigured target
  show-tuple         - Print the tuple of the currently configured toolchain

Preconfigured toolchains (#: force number of // jobs):
  list-samples       - prints the list of all samples (for scripting)
  show-<sample>      - show a brief overview of <sample> (list with list-samples)
  <sample>           - preconfigure crosstool-NG with <sample> (list with list-samples)
  build-all[.#]      - Build *all* samples (list with list-samples) and install in
                       ${CT_PREFIX} (which you must set)

Build actions (#: force number of // jobs):
  build[.#]          - Build the currently configured toolchain
  list-steps         - List all build steps

Clean actions:
  clean              - Remove generated files
  distclean          - Remove generated files, configuration and build directories

Distribution actions:
  wiki-samples       - Print a DokuWiki table of samples
  updatetools        - Update the config tools
  tarball            - Build a tarball of the configured toolchain

Environment variables (see /opt/crosstool-ng/share/doc/crosstool-ng/ct-ng.1.18.0/0 - Table of content.txt):
  STOP=step          - Stop the build just after this step (list with list-steps)
  RESTART=step       - Restart the build just before this step (list with list-steps)
  CT_PREFIX=dir      - install samples in dir (see action "build-all", above).
  V=0|1|2            - 0 => show only human-readable messages (default)
                       1 => show only the commands being executed
                       2 => show both

Use action "menuconfig" to configure your toolchain
Use action "build" to build your toolchain
Use action "version" to see the version
See "man 1 ct-ng" for some help as well

        

正如此,看了help之後,才有後面的,各種功能的用法。比如:

檢視當前有哪些(預設的)示例配置,可以用:

ct-ng list-samples

檢視單個的某個示例配置的核心引數,用:

ct-ng show-<sample>

直接借用(使用,呼叫)該預設配置,用:

ct-ng <sample>

等等。

關於其他的更多用法,後續會詳細解釋的。

3.1.2.用ct-ng list-steps檢視本身的build過程分成哪幾步

如上所述,用list-steps,可以檢視到,當前,用crosstool-ng去build,去製作交叉編譯器,具體分成哪些步驟:

CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng list-steps
Available build steps, in order:
  - libc_check_config
  - companion_libs_for_build
  - binutils_for_build
  - companion_libs_for_host
  - binutils_for_host
  - cc_core_pass_1
  - kernel_headers
  - libc_start_files
  - cc_core_pass_2
  - libc
  - cc_for_build
  - cc_for_host
  - libelf_for_target
  - binutils_for_target
  - debug
  - test_suite
  - finish
Use "<step>" as action to execute only that step.
Use "+<step>" as action to execute up to that step.
Use "<step>+" as action to execute from that step onward.

        

知道了,此處分了多少步驟,具體有哪些步驟之後

後面才有可能去實現,從之前出錯的哪一步,恢復,繼續編譯。

3.1.3.用ct-ng list-samples檢視當前已包含哪些預設的示例配置

第3.1.1節 “用ct-ng help檢視所擁有的功能”中所述,我們可以通過

ct-ng list-samples

檢視到,當前crosstool-ng中,已經有了哪些預設的,幫我們配置好的哪些配置:

CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.18.0
$ ct-ng list-samples
Status  Sample name
  MKDIR config.gen
  IN    config.gen/arch.in
  IN    config.gen/kernel.in
  IN    config.gen/cc.in
  IN    config.gen/binutils.in
  IN    config.gen/libc.in
  IN    config.gen/debug.in
[L.X]   alphaev56-unknown-linux-gnu
[L.X]   alphaev67-unknown-linux-gnu
[L.X]   arm-bare_newlib_cortex_m3_nommu-eabi
[L.X]   arm-cortex_a15-linux-gnueabi
[L..]   arm-cortex_a8-linux-gnueabi
[L..]   arm-davinci-linux-gnueabi
[L..]   armeb-unknown-eabi
[L.X]   armeb-unknown-linux-gnueabi
[L.X]   armeb-unknown-linux-uclibcgnueabi
[L..]   arm-unknown-eabi
[L..]   arm-unknown-linux-gnueabi
[L.X]   arm-unknown-linux-uclibcgnueabi
[L.X]   armv6-rpi-linux-gnueabi
[L.X]   avr32-unknown-none
[L..]   bfin-unknown-linux-uclibc
[L..]   i586-geode-linux-uclibc
[L.X]   i586-mingw32msvc,i686-none-linux-gnu
[L.X]   i686-nptl-linux-gnu
[L.X]   i686-unknown-mingw32
[L.X]   m68k-unknown-elf
[L.X]   m68k-unknown-uclinux-uclibc
[L.X]   mips64el-n32-linux-uclibc
[L.X]   mips64el-n64-linux-uclibc
[L.X]   mips-ar2315-linux-gnu
[L..]   mipsel-sde-elf
[L..]   mipsel-unknown-linux-gnu
[L.X]   mips-malta-linux-gnu
[L..]   mips-unknown-elf
[L.X]   mips-unknown-linux-uclibc
[L..]   powerpc-405-linux-gnu
[L.X]   powerpc64-unknown-linux-gnu
[L..]   powerpc-860-linux-gnu
[L.X]   powerpc-e300c3-linux-gnu
[L.X]   powerpc-e500v2-linux-gnuspe
[L..]   powerpc-unknown_nofpu-linux-gnu
[L..]   powerpc-unknown-linux-gnu
[L..]   powerpc-unknown-linux-uclibc
[L.X]   s390-ibm-linux-gnu
[L.X]   s390x-ibm-linux-gnu
[L..]   sh4-unknown-linux-gnu
[L..]   x86_64-unknown-linux-gnu
[L..]   x86_64-unknown-linux-uclibc
[L.X]   x86_64-unknown-mingw32
 L (Local)       : sample was found in current directory
 G (Global)      : sample was installed with crosstool-NG
 X (EXPERIMENTAL): sample may use EXPERIMENTAL features
 B (BROKEN)      : sample is currently broken

        

如此,後續就可以去使用這些預設配置了。

3.1.4.用ct-ng show-tuple檢視當前配置的是什麼交叉編譯器

在後續的配置(和編譯)之後,可以通過show-tuple,去檢視到當前配置的交叉編譯器是啥樣的:

比如,我之前在折騰:

【記錄】重試使用最新版本1.18.0的crosstool-ng去配置和編譯xscale的交叉編譯器

後,對應的結果是:

CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng show-tuple
arm-xscale-linux-gnueabi

        

就知道當前,配置的交叉編譯器,是:arm-xscale-linux-gnueabi

3.1.5.用ct-ng version檢視當前crosstool-ng的版本

類似的,可以通過version檢視當前的crosstool-ng工具本身的版本:

CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng version
This is crosstool-NG version 1.18.0

Copyright (C) 2008  Yann E. MORIN <[email protected]>
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

        

即,此處的crosstool-ng的版本是:1.18.0

3.2.crosstool-ng本身的配置的使用的基本邏輯

從之前介紹的第3.1.3節 “用ct-ng list-samples檢視當前已包含哪些預設的示例配置”,我們可以看出

對於常見的架構,比如arm,mips,powerpc等等,都有了很多的,已經幫我驗證過,可以正常編譯的示例配置了

所以,我們接下來,主要就是:

搞懂自己借用哪個配置,然後呼叫預設配置,然後再確認一下配置,根據自己的情況去改一改,就差不多,就配置好了。

下面介紹,如何去配置crosstool-ng的主要的兩種情況:

  • 如果已有同樣(類似的)配置,那麼直接拿過來用即可
  • 如果沒有需要的配置,則找到一個最為接近的配置,借用後,再去修改為自己所要的配置

下面就來詳細闡述其含義:

3.2.1.使用已有的crosstool-ng的示例配置

很多時候,我們用crosstool-ng去編譯我們要的交叉編譯器的時候,所針對的CPU,目標執行環境,想要用的C庫等等,

很可能,和之前上面看到的某個配置,是一樣的。

此時,我們所要做的事情,其實就是直接拿來用即可。

比如,我們想要針對cortex-a8這款CPU,去編譯一個交叉編譯器,那麼你就會發現,其實預設已有此配置了:

arm-cortex_a8-linux-gnueabi

在使用之前,也是可以先去看看,該配置的主要引數是哪些:

CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng show-arm-cortex_a8-linux-gnueabi
[G..]   arm-cortex_a8-linux-gnueabi
    OS             : linux-3.7.3
    Companion libs : gmp-4.3.2 mpfr-2.4.2 ppl-0.10.2 cloog-ppl-0.15.9 libelf-0.8.13
    binutils       : binutils-2.20.1a
    C compiler     : gcc-4.4.6 (C,C++)
    C library      : glibc-2.9 (threads: nptl)
    Tools          : dmalloc-5.5.2 duma-2_5_15 gdb-6.8a ltrace-0.5.3 strace-4.5.19

        

然後,你就可以直接去呼叫此配置了:

ct-ng arm-cortex_a8-linux-gnueabi

實際輸出,是類似於這樣的:

CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng arm-cortex_a8-linux-gnueabi
  LN    config
  MKDIR config.gen
  IN    config.gen/arch.in
  IN    config.gen/kernel.in
  IN    config.gen/cc.in
  IN    config.gen/binutils.in
  IN    config.gen/libc.in
  IN    config.gen/debug.in
  CONF  config/config.in
#
# configuration saved
#
 
***********************************************************
 
Initially reported by: Yann E. MORIN
URL: http://ymorin.is-a-geek.org/
 
***********************************************************
 
Now configured for "arm-cortex_a8-linux-gnueabi"

        

一些實際折騰的過程,可參考:

【記錄】重試使用最新版本1.18.0的crosstool-ng去配置和編譯xscale的交叉編譯器

接下來,你就可以去進入配置:

ct-ng menuconfig

去確認一下,是否是完全符合你的要求。

如果有什麼個別的配置不滿意,再去修改為你自己想要的即可。

3.2.2.根據需要去修改你的crosstool-ng的配置

很多時候,已經的哪些示例配置,未必完全符合你的需要,這時候,你就只能是:

找個和你的情況最接近的一個示例配置,然後再去基於此配置,去修改成你所要的。

比如,我之前折騰,為TQ2440的S3C2440的CPU,其是arm920t的核

去配置crosstool-ng的時候,就發現,預設的配置中,沒有完全合適的。

然後就一點點去調查,而最後搞清楚了,在已有的,arm相關的配置中,davinci,是相對來說,比較接近此處的arm920t的了。

所以,就去呼叫davinci的預設配置:

ct-ng arm-davinci-linux-gnueabi

然後再按照自己的需求,進入:

ct-ng menuconfig

後,去根據自己的需要,再去確認配置,和修改配置,為自己所需要的。

詳細過程參見:

【記錄】Cygwin下為arm920t配置crosstool-ng

3.3.crosstool-ng的配置引數詳解

如上,借用已有的配置後,接下來就是去:

ct-ng menuconfig

然後針對裡面的配置選項,去根據自己的需要,去修改了。

由於crosstool-ng的功能太多,配置選項太多,

所以,此處,也不太可能,針對每個引數都詳細解釋其含義。

不過,對於一些核心引數,是我們必須要了解清楚的,

所以,下面就針對,一些核心引數,比較有用的引數,來詳細解釋解釋:

3.3.1.crosstool-ng工具相關的配置引數

crosstool-ng中,有不少有用的引數,是和,crosstool-ng這個工具本身,有關的

其目的在於,在為你使用此工具時,提供使用上的便利

比如設定多執行緒,以加快編譯速度,節省編譯時間,

之前編譯在某步出錯,然後重新重頭編譯又需要耗費大量的無謂的時間,而提供了從之前錯誤的某步中恢復,繼續編譯,從而節省你的時間

在編譯出錯時,不退出,而提供機會給你修復錯誤,修復後,然後可以繼續編譯

如此等等的引數,目的就一個:

讓製作交叉編譯器,這個費事費力的活,變得儘可能的省時省力

下面,就來介紹一下這些引數,如何配置,以及詳細的含義和用法。

3.3.1.1.多執行緒編譯以節省時間

直接給出示例配置:

Paths and misc options
    (4) Number of parallel jobs

            

其help的說明為:

  ┌────────────────────────── Number of parallel jobs ───────────────────────────┐
  │ CT_PARALLEL_JOBS:                                                            │
  │                                                                              │
  │ Number of jobs make will be allowed to run concurently.                      │
  │ Set this higher than the number of processors you have, but not too high.    │
  │ A good rule of thumb is twice the number of processors you have.             │
  │                                                                              │
  │ Enter 1 to have only one job at a time.                                      │
  │                                                                              │
  │ Enter 0 to set automatically based on how many processors the host has.      │
  │                                                                              │
  │ Symbol: PARALLEL_JOBS [=4]                                                   │
  │ Type  : integer                                                              │
  │ Prompt: Number of parallel jobs                                              │
  │   Defined at config/global/build-behave.in:8                                 │
  │   Depends on: !BACKEND [=n]                                                  │
  │   Location:                                                                  │
  │     -> Paths and misc options                                                │

            

此處,設定為4,意思是:

同時執行4個程序(去執行crosstool-ng的編譯過程)

很明顯,多執行緒去編譯的話,會大大縮短整個的編譯時間。

此數字的設定,當然,不能隨便胡亂設定。

比較常見的做法是:

CPU核心數 x 2

比如,你的是Intel的雙核的CPU,那麼此值就是:

2 x 2 =4

了。

不用去ct-ng build.N

此處,設定好此引數後,後續直接去build:

ct-ng build

即可自動以對應的多執行緒去編譯了。

無需後續手動再在build上引數,即無需:

ct-ng build.4
內部是用make -jN去實現的

此處的多執行緒的引數

內部,是把對應的數字,傳遞給make,即實現:

make -j4

的效果,然後make就會以對應的4個執行緒去執行了。

關於make的-j引數,不瞭解的可參考:

【整理】Linux下的make命令使用心得

3.3.1.2.從之前錯誤的那一步恢復繼續編譯

示例配置:

Paths and misc options
    [*] Debug crosstool-NG
    [*]   Save intermediate steps

            

Save intermediate steps的help的說明為:

  ┌────────────────────────── Save intermediate steps ───────────────────────────┐
  │ CT_DEBUG_CT_SAVE_STEPS:                                                      │
  │                                                                              │
  │ If you say 'y' here, then you will be able to restart crosstool-NG at        │
  │ any step.                                                                    │
  │                                                                              │
  │ It is not currently possible to restart at any of the debug facilities.      │
  │ They are treated as a whole.                                                 │
  │                                                                              │
  │ To get the full list os steps, run: ct-ng list-steps                         │
  │                                                                              │
  │ Symbol: DEBUG_CT_SAVE_STEPS [=y]                                             │
  │ Type  : boolean                                                              │
  │ Prompt: Save intermediate steps                                              │
  │   Defined at config/global/ct-behave.in:79                                   │
  │   Depends on: DEBUG_CT [=y]                                                  │
  │   Location:                                                                  │
  │     -> Paths and misc options                                                │
  │       -> Debug crosstool-NG (DEBUG_CT [=y])                                  │

            

此處,先要選上:Debug crosstool-NG

表示,使用crosstoo-ng的除錯方面的功能

再去選上:Save intermediate steps

意思是:

編譯完畢每一步之後,都會儲存對應的狀態

如此,就可以實現對應的,從之前出錯的步驟恢復而繼續編譯的效果了。

當然,實現此效果的前提是,你參考之前的第3.1.2節 “用ct-ng list-steps檢視本身的build過程分成哪幾步”,而搞清楚了,crosstool-ng的編譯,其本身分了哪些步驟。

然後直到自己是在哪一步出的錯,然後才可以實現回覆出錯的步驟,而繼續編譯。

總的邏輯是:

找到之前編譯,最後成功的那一步(last successful step)。

然後去執行:

ct-ng last_successful_step+

就可以繼續恢復繼續編譯了。

例3.1.從出錯的那一步恢復重新繼續編譯

比如,我之前折騰:

【已解決】crosstool-ng在Installing C library headers & start files期間出錯:Makefile:240: *** mixed implicit and normal rules. Stop.

期間,當時出錯的輸出資訊是:

=================================================================
[INFO ]  Installing MPC for host
[EXTRA]    Configuring MPC
[EXTRA]    Building MPC
[EXTRA]    Installing MPC
[INFO ]  Installing MPC for host: done in 182.22s (at 27:10)
[EXTRA]  Saving state to restart at step 'binutils_for_host'...
[INFO ]  =================================================================
[INFO ]  Installing binutils for host
[EXTRA]    Configuring binutils
[ERROR]    configure: error: cannot create configure.lineno; rerun with a POSIX shell
[ERROR]
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing binutils for host'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR]  >>        called from: do_binutils_backend[scripts/build/binutils/binutils.sh@205]
[ERROR]  >>        called from: do_binutils_for_host[scripts/build/binutils/binutils.sh@92]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@632]
 
 
Current command:
  'CFLAGS=-O2 -g -pipe ' 'CXXFLAGS=-O2 -g -pipe ' 'LDFLAGS= ' '/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/binutils-2.22/configure' '--build=i686-build_pc-cygwin' '--host=i686-build_pc-cygwin' '--target=arm-xscale-linux-gnueabi' '--prefix=/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi' '--disable-werror' '--enable-ld=yes' '--enable-gold=no' '--with-pkgversion=crosstool-NG 1.18.0' '--disable-multilib' '--disable-nls' '--with-float=softfp' '--with-sysroot=/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/sysroot'
exited with error code: 1
Please fix it up and finish by exiting the shell with one of these values:
    1  fixed, continue with next build command
    2  repeat this build command
    3  abort build
 
ct-ng:~/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/build/build-binutils-host-i686-build_pc-cygwin>

                

此處,我們能看到的是,在當前的:

[INFO ]  Installing binutils for host

而出錯了,而對應的,在此之前的,最後一個正確編譯的階段,是對應著有輸出:

[EXTRA]  Saving state to restart at step 'binutils_for_host'...

的那一步,即:

binutils_for_host

此時,你就可以用:

ct-ng binutils_for_host+

而實現:

(給定,之前最後正常執行的那一步(last successful step),往後,)從上述出錯的那一步,繼續正常編譯的效果了。

即,所謂的:restore from fail step

此處不是ct-ng last_fail_step+

此處,之前不熟悉此功能的用法,結果去用:

ct-ng last_fail_step+

的方法,即用:

ct-ng cc_core_pass_1+

想要回復錯誤,繼續執行,結果就出現:

[ERROR]  The previous build did not reach the point where it could be restarted at xxx

之類的錯誤了。

詳見:

【已解決】crosstool-ng在Installing C library headers & start files期間出錯:Makefile:240: *** mixed implicit and normal rules. Stop.

RESTART=step的引數估計也可以實現同樣的從錯誤那步恢復繼續編譯的效果

從之前的第3.1.1節 “用ct-ng help檢視所擁有的功能”中可以看出

估計在build的時候,指定對應的RESTART=step

ct-ng build RESTART=last_successful_step

應該也可以實現類似的效果的。

有空的話,可以去試試。

3.3.1.3.出錯時不立刻退出

說實話,對於上面的那個:第3.3.1.2節 “從之前錯誤的那一步恢復繼續編譯”的功能,已經很強大了

而crosstool-ng,工具做的就是好。

因為,除此之外,又進一步的支援這個,出錯時不立刻退出,的功能。

配置如下:

Paths and misc options
    [*] Debug crosstool-NG
    [*]   Interactive shell on failed commands

            

Interactive shell on failed commands的help的說明為:

  ┌─────────────────── Interactive shell on failed commands ────────────────────┐
  │ CT_DEBUG_INTERACTIVE:                                                       │
  │                                                                             │
  │ If you say 'y' here, then an interactive shell will be spawned for          │
  │ each failed command.                                                        │
  │                                                                             │
  │ This shell will have the same environment that the failed command           │
  │ was run with, and the working directory will be set to the directory        │
  │ the failed command was run in.                                              │
  │                                                                             │
  │ After you fix the issue, you can exit the interactive shell with any        │
  │ of these exit codes:                                                        │
  │   1  the issue was fixed, continue the build with the next command          │
  │   2  the issue was fixed, re-run the failed command                         │
  │   3  abort the build                                                        │
  │                                                                             │
  │ Note: '2' is only possible for commands run via CT_DoExecLog, though.       │
  │                                                                             │
  │ Symbol: DEBUG_INTERACTIVE [=y]                                              │
  │ Type  : boolean                                                             │
  │ Prompt: Interactive shell on failed commands                                │
  │   Defined at config/global/ct-behave.in:121                                 │
  │   Depends on: DEBUG_CT [=y]                                                 │
  │   Location:                                                                 │
  │     -> Paths and misc options                                               │
  │       -> Debug crosstool-NG (DEBUG_CT [=y])                                 │

            

此處,引數Interactive shell on failed commands的含義是:

直譯為:當編譯(命令)出錯時,提供互動式的shell

其具體實際效果是:

正常情況下,當編譯出錯,會直接退出crosstool-ng的編譯環境,回到當前的命令列。

而設定了此引數後,當編譯失敗時,不是直接退出編譯

而是提供一個互動式的shell

然後你可以(另開一個終端)去修復你的問題

然後修復問題後,再通過

exit N

實現對應的返回N的值,達到對應的效果:

  • 1

    (不重新執行,之前錯誤的那個命令)

    而接著直接繼續編譯

  • 2

    重新執行之前錯誤的那個命令

    然後接著繼續執行

    常用於:

    當某個.c檔案編譯出錯了,然後你另起一個終端,去修改了該.c檔案,解決了錯誤。

    然後就可以通過

    exit 2

    而使得,重新執行命令,重新編譯該.c檔案,而使得可以正常編譯,繼續編譯。

  • 3

    直接退出編譯

    相當於,直接按Ctrl+C,而中斷編譯

例3.2.如何在編譯失敗後,修復錯誤,然後繼續接著編譯

比如,我之前折騰

【記錄】crosstool為xscale編譯(ct-ng build)過程

時,遇到編譯出錯後,就回到當前命令行了:

=================================================================
[INFO ]  Installing static core C compiler
[EXTRA]    Configuring static core C compiler
[EXTRA]    Building static core C compiler
[EXTRA]    Installing static core C compiler
[INFO ]  Installing static core C compiler: done in 1282.54s (at 67:22)
[EXTRA]  Saving state to restart at step 'libc_headers'...
[INFO ]  
=================================================================
[INFO ]  Installing C library headers
[EXTRA]    Configuring C library
[EXTRA]    Installing C library headers
[ERROR]    make[3]: *** [/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi//sys-root/usr/include/sys/uio.h] Error 1
[ERROR]    make[2]: *** [misc/install-headers] Error 2
[ERROR]    make[1]: *** [install-headers] Error 2
[ERROR]    Build failed in step 'Installing C library headers'
[ERROR]    Error happened in '/opt/crosstool-ng/lib/ct-ng-1.9.3/scripts/functions' in function 'CT_DoExecLog' (line unknown, sorry)
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.9.3/scripts/build/libc/glibc.sh' at line # 175 in function 'do_libc_headers'
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.9.3/scripts/crosstool-NG.sh' at line # 597 in function 'main'
[ERROR]    Look at '/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/build.log' for more info on this error.
[ERROR]  (elapsed: 76:07.10)
[76:12] / /opt/crosstool-ng/bin/ct-ng:143: recipe for target `build' failed
make: *** [build] Error 2

CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.9.3_build
$

                

沒有給你機會去修復錯誤,然後繼續編譯。

而你能做的,做節省時間的方式,也最多隻是,參考:第3.3.1.2節 “從之前錯誤的那一步恢復繼續編譯”去,在解決了問題之後,去:

ct-ng libc_headers+

從而達到,從出錯的步驟,恢復後繼續編譯的效果,不再重複之前的已經成功編譯的那些步驟。

但是,即便是這樣,對於編譯最開始的部分:

CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.9.3_build
$ ct-ng build
[INFO ]  Performing some trivial sanity checks
[INFO ]  Build started 20130724.093552
[INFO ]  Building environment variables
[EXTRA]  Preparing working directories

                

等步驟,還是需要花點時間的,還是有點重複浪費的感覺。

所以,此處,選中了上面所說的那個"Interactive shell on failed commands"選項後,

當編譯出錯後,會出現類似於:

【已解決】Ubuntu中crosstool-ng編譯出錯:scripts/unifdef.c:209:25: error: conflicting types for ‘getline’

中的這樣的效果:

[INFO ]  =================================================================
[INFO ]  Installing kernel headers
[EXTRA]    Installing kernel headers
[ERROR]    /home/crifan/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/linux-custom/scripts/unifdef.c:209:25: error: conflicting types for 'getline'
[ERROR]    make[3]: *** [scripts/unifdef] Error 1
[ERROR]    make[2]: *** [headers_install] Error 2
[ERROR]    make[1]: *** [headers_install] Error 2
[ERROR]   
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing kernel headers'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR]  >>        called from: do_kernel_install[scripts/build/kernel/linux.sh@112]
[ERROR]  >>        called from: do_kernel_headers[scripts/build/kernel/linux.sh@91]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@632]
           
 
Current command:
  'make' '-C' '/home/crifan/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/linux-custom' 'O=/home/crifan/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/build/build-kernel-headers' 'ARCH=arm' 'INSTALL_HDR_PATH=/home/crifan/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/sysroot/usr' 'V=0' 'headers_install'
exited with error code: 2
Please fix it up and finish by exiting the shell with one of these values:
    1  fixed, continue with next build command
    2  repeat this build command
    3  abort build
 
ct-ng:~/develop/crosstool-ng/crosstool-ng-1.18.0_build>

                

即,有對應的

Please fix it up and finish by exiting the shell with one of these values

那些資訊。

然後,當你去解決了對應的問題後:

此處,只是去修改對應的.build/src/linux-custom/scripts/unifdef.c,即可。

然後,就可以通過輸入:

exit 2

就可以實現:

重新執行此處剛才出錯的命令,然後繼續重新去編譯剛才出錯的那個.build/src/linux-custom/scripts/unifdef.c檔案,

從而實現:

當編譯出錯時,也不立刻退出crosstool-ng的編譯,

允許你去修復對應的問題,然後修復完畢後,可以接著繼續編譯。

因而實現了:

避免重複的,之前的各個步驟,包括最開始的環境檢查等等的時間

真正的,徹底的,最大程度上的,節省你的時間和精力。


注意是exit加上數字,不是直接輸入數字

此處,由於是,互動式shell(interactive shell)

所以,當你在修復問題後,想要,繼續編譯,

則是需要,退出當前互動式shell,回去繼續編譯的。

而退出shell的話,就需要用到對應的:

exit N

表示退出,且返回值是N

而不是:直接輸入N

3.3.2.crosstool-ng核心配置詳解

crosstool-ng中有很多配置引數。

其中一些核心引數,是交叉編碼方面,比如搞清楚,和配置正確的引數。

下面就來詳細解釋這些引數的含義和說明如何配置。

3.3.2.1.crosstool-ng本身相關的重要引數

此處介紹,和crosstool-ng,為了交叉編譯,作為工具本身方面的一些常見的,重要的引數的配置。

3.3.2.1.1.原始碼包下載儲存路徑

常見配置如下:

Paths and misc options
    (${HOME}/develop/crosstool-ng/src) Local tarballs directory

                

Local tarballs directory的help的說明為:

  ┌───────────────────────── Local tarballs directory ──────────────────────────┐
  │ CT_LOCAL_TARBALLS_DIR:                                                      │
  │                                                                             │
  │ If you have previously downloaded the tarballs, enter the PATH where        │
  │ you stored them here.                                                       │
  │                                                                             │
  │ Symbol: LOCAL_TARBALLS_DIR [=${HOME}/develop/crosstool-ng/src]              │
  │ Type  : string                                                              │
  │ Prompt: Local tarballs directory                                            │
  │   Defined at config/global/paths.in:5                                       │
  │   Depends on: !BACKEND [=n]                                                 │
  │   Location:                                                                 │
  │     -> Paths and misc options                                               │

                

即,你之前配置好的各種模組,包括C庫,GCC,binutils等等所有的東西,下載下來,都放在此資料夾中。

對應的路徑配置,可以參考前面介紹的:

3.3.2.1.2.工作路徑

所有的東西,都放在其下,包括:

  • 編譯時所生成的arm-xscale-linux-gnueabi資料夾
  • 所有模組解壓的原始碼在其下的src路徑下

一般使用預設配置,如下:

Paths and misc options
    (${CT_TOP_DIR}/.build) Working directory

                

Working directory的help的說明為:

  ┌───────────────────────────── Working directory ─────────────────────────────┐
  │ CT_WORK_DIR:                                                                │
  │                                                                             │
  │ Set this to the directory where all build actions will be done.             │
  │                                                                             │
  │ The default is "${CT_TOP_DIR}/.build", and leaving this option              │
  │ empty will also use the default.                                            │
  │                                                                             │
  │ You should not need to change that, except in one very peculiar             │
  │ setup:                                                                      │
  │  - your crosstool-NG source directory is on the network                     │
  │  - you configured crosstool-NG with --local                                 │
  │ This kind of setup is a pain, as any action involving source file           │
  │ access would have to go through the wire. In this case, you should          │
  │ set CT_WORK_DIR to point to a path local to your machine, to avoid          │
  │ any network overhead.                                                       │
  │                                                                             │
  │ Do *NOT* change it if you don't know better.                                │
  │                                                                             │
  │ Symbol: WORK_DIR [=${CT_TOP_DIR}/.build]                                    │
  │ Type  : string                                                              │
  │ Prompt: Working directory                                                   │
  │   Defined at config/global/paths.in:31                                      │
  │   Depends on: !BACKEND [=n]                                                 │
  │   Location:                                                                 │
  │     -> Paths and misc options                                               │

                
3.3.2.1.3.目標安裝路徑

改為你自己的,對應的x-tools/${CT_TARGET}的路徑:

Paths and misc options
    (${HOME}/develop/crosstool-ng/x-tools/${CT_TARGET}) Prefix directory

                

Prefix directory的help的說明為:

  ┌────────────────────────────── Prefix directory ──────────────────────────────┐
  │ CT_PREFIX_DIR:                                                               │
  │                                                                              │
  │ This is the path the toolchain will run from.                                │
  │                                                                              │
  │ Symbol: PREFIX_DIR [=${HOME}/develop/crosstool-ng/x-tools/${CT_TARGET}]      │
  │ Type  : string                                                               │
  │ Prompt: Prefix directory                                                     │
  │   Defined at config/global/paths.in:52                                       │
  │   Depends on: !BACKEND [=n]                                                  │
  │   Location:                                                                  │
  │     -> Paths and misc options                                                │

                

此處對應的x-tools路徑,可參考之前的解釋:

3.3.2.2.交叉編譯相關的核心引數

3.3.2.2.1.crosstool-ng中的配置引數:Architecture level, Emit assembly for CPU, Tune for CPU

crosstool-ng中的Architecture level, Emit assembly for CPU, Tune for CPU,分別對應的是gcc中的-march=xxx, -mcpu=xxx, -mtune=xxx

而這幾個引數,是相對最最核心的,最最重要的配置了。

例3.3.舉例說明Architecture level, Emit assembly for CPU, Tune for CPU如何去配置

比如,我之前的折騰:

【記錄】為arm的xscale配置crosstool-ng

中的:

【整理】crosstool中的Architecture level(CT_ARCH_ARCH),Emit assembly for CPU(CT_ARCH_CPU),Tune for CPU(CT_ARCH_TUNE)的值,對於arm的xscale應該是填寫什麼

以及後來的折騰:

【整理】crosstool-ng中的Architecture level,Emit assembly for CPU,Tune for CPU對於TQ2440的S3C2440的ARM920T填寫何值

而搞清楚了自己的xscale的CPU所對應的配置是:

  • Architecture level=CT_ARCH_ARCH=-march=armv5te
  • Emit assembly for CPU=CT_ARCH_CPU=-mcpu=xscale
  • Tune for CPU=CT_ARCH_TUNE=-mtune=strongarm110

以及,後來的折騰:

【記錄】Cygwin下為arm920t配置crosstool-ng

中的:

【整理】crosstool-ng中的Architecture level,Emit assembly for CPU,Tune for CPU對於TQ2440的S3C2440的ARM920T填寫何值

去搞懂了,S3C2440的對應的配置是:

  • Architecture level=CT_ARCH_ARCH=-march=armv4t
  • Emit assembly for CPU=CT_ARCH_CPU=-mcpu=arm9tdmi
  • Tune for CPU=CT_ARCH_TUNE=-mtune=arm920t


交叉編譯時的核心引數

其實,如上所說的這幾個引數

對應的,都是gcc中的引數,

即對應的-march=xxx,-mcpu=xxx,-mtune=xxx

是屬於,在交叉編譯領域,差不多都會遇到的,相對比較通用的,配置引數。

所以,針對這幾個引數的詳細講解,專門放在了另外一個關於交叉編譯的教程裡面,做了極其詳盡的解釋。

先要搞懂這幾個引數的詳細含義,可參考對應的內容:

crosstool-ng中交叉編譯字首的命名規則

3.3.2.2.2.crosstool-ng中的配置引數:MMU

crosstool-ng中,對於MMU的配置,此處如下:

Target options
    [*] Use the MMU

                

Use the MMU的help的說明為:

  ┌──────────────────────────────── Use the MMU ─────────────────────────────────┐
  │ CT_ARCH_USE_MMU:                                                             │
  │                                                                              │
  │ If your architecture has an MMU and you want to use it,                      │
  │ say 'Y' here.                                                                │
  │                                                                              │
  │ OTOH, if you don't want to use the MMU, or your arch                         │
  │ lacks an MMU, say 'N' here.                                                  │
  │                                                                              │
  │ Note that some architectures (eg. ARM) has variants that                     │
  │ lacks an MMU (eg. ARM Cortex-M3), while other variants                       │
  │ have one (eg. ARM Cortex-A8).                                                │
  │                                                                              │
  │ Symbol: ARCH_USE_MMU [=y]                                                    │
  │ Type  : boolean                                                              │
  │ Prompt: Use the MMU                                                          │
  │   Defined at config/target.in:87                                             │
  │   Depends on: ARCH_SUPPORTS_BOTH_MMU [=y]                                    │
  │   Location:                                                                  │
  │     -> Target options                                                        │
  │   Selected by: ARCH_alpha [=n] && GEN_CHOICE_ARCH [=y] && \                  │
  │ ARCH_alpha_AVAILABLE [=y] || ARCH_s390 [=n] && GEN_CHOICE_ARCH [=y] && \     │
  │ ARCH_s390_AVAILABLE [=y] || ARCH_powerpc [=n] && GEN_CHOICE_ARCH [=y] && \   │
  │ ARCH_powerpc_AVAILABLE [=y] || ARCH_sparc [=n] && GEN_CHOICE_ARCH [=y] && \  │
  │ ARCH_sparc_AVAILABLE [=y] || ARCH_mips [=n] && GEN_CHOICE_ARCH [=y] && \     │
  │ ARCH_mips_AVAILABLE [=y] || ARCH_avr32 [=n] && GEN_CHOICE_ARCH [=y] && \     │
  │ ARCH_avr32_AVAILABLE [=y] || ARCH_sh [=n] && GEN_CHOICE_ARCH [=y] && \       │
  │ ARCH_sh_AVAILABLE [=y] || ARCH_x86 [=n] && GEN_CHOICE_ARCH [=y] && \         │
  │ ARCH_x86_AVAILABLE [=y]                                                      │

                

此處,已經選上了MMU,是因為之前對於CPU部分,是在:

【記錄】為arm的xscale配置crosstool-ng

設定為xscale的,而xscale的CPU,全都是有MMU的。

所以,此處,crosstool-ng(根據內部已經實現好的依賴關係),已經自動幫你選上MMU了。

需要了解的是,現在多數的CPU,都是已經支援MMU的。

只有之前的很老的CPU,有的才不支援MMU。

3.3.2.2.3.crosstool-ng中的配置引數:大小端Endianness

crosstool-ng中,對於MMU的配置,此處如下:

Target options
    Endianness: (Little endian)  --->

                

Endianness的help的說明為:

  ┌──────────────────────────────── Endianness: ─────────────────────────────────┐
  │ There is no help available for this option.                                  │
  │ Prompt: Endianness:                                                          │
  │   Defined at config/target.in:112                                            │
  │   Depends on: ARCH_SUPPORTS_BOTH_ENDIAN [=y]                                 │
  │   Location:                                                                  │
  │     -> Target options                                                        │
  │   Selected by: ARCH_SUPPORTS_BOTH_ENDIAN [=y] && m                           │

                

此處,將Endianness設定為小端(Little endian)

一般,多數情況下,都是小端。

不論設定大端(Big Endian)還是小端(Little endian)

都要確保本身CPU是支援此種模式的。

比如,之前,也是經過確認,才知道,xscale,本身是,既支援大端,也支援小端的:

【記錄】為arm的xscale配置crosstool-ng

所以,此處設定小端,也才是確保,CPU本身是支援的。

關於大端和小端的區別的,不熟悉的可參考:

大端(Big Endian)與小端(Little Endian)詳解

3.3.2.2.4.crosstool-ng中的配置引數:浮點處理單元FPU

crosstool-ng中的配置中,同樣會涉及到,當前的CPU,是否有FPU,浮點處理單元。

一般來說,多數CPU都是沒有的。

比如,我之前的折騰:

【記錄】Cygwin下為arm920t配置crosstool-ng

就發現,當然的S3C2440dearm920t的話,是不支援FPU的。

所以,此處,就設定為對應的,軟體浮點了:

Target options
    ()  Use specific FPU
        Floating point: (softfp (FPU))  --->

                

Use specific FPU的help的說明為:

  ┌────────────────────────────── Use specific FPU ──────────────────────────────┐
  │ CT_ARCH_FPU:                                                                 │
  │                                                                              │
  │ On some targets (eg. ARM), you can specify the kind of FPU to emit           │
  │ code for.                                                                    │
  │                                                                              │
  │ This is the configuration flag --with-fpu=XXX, and the runtime flag          │
  │ -mfpu=XXX.                                                                   │
  │                                                                              │
  │ See below wether to actually emit FP opcodes, or to emulate them.            │
  │                                                                              │
  │ Pick a value from the gcc manual for your choosen gcc version and your       │
  │ target CPU.                                                                  │
  │                                                                              │
  │ Leave blank if you don't know, or if your target architecture does not       │
  │ offer this option.                                                           │
  │                                                                              │
  │ Symbol: ARCH_FPU [=]                                                         │
  │ Type  : string                                                               │
  │ Prompt: Use specific FPU                                                     │
  │   Defined at config/target.in:274                                            │
  │   Depends on: ARCH_SUPPORTS_WITH_FPU [=y]                                    │
  │   Location:                                                                  │
  │     -> Target options                                                        │

                

Floating point的help的說明為:

  ┌────────────────────────────── Floating point: ───────────────────────────────┐
  │ There is no help available for this option.                                  │
  │ Prompt: Floating point:                                                      │
  │   Defined at config/target.in:294                                            │
  │   Depends on: ARCH_SUPPORTS_WITH_FLOAT [=y]                                  │
  │   Location:                                                                  │
  │     -> Target options                                                        │
  │   Selected by: ARCH_SUPPORTS_WITH_FLOAT [=y] && m                            │

                

可見,此處的FPU,就是對應著gcc中的引數:-mfpu=XXX

對應的,如果是你:

crosstool-NG in Linaro

中所舉例的Cortex-A9 with NEON的CPU的話,那麼此處的設定就是:

Target options
    (neon) Use specific FPU
        Floating point: (hardware (FPU))  --->

                

了,而此時,你也可以看到,配置選擇中,又多了個,關於字尾hf的選項,你也可以選擇該項:

Target options
    [*]   append 'hf' to the tuple (EXPERIMENTAL)

                

append 'hf' to the tuple的help的說明為:

  ┌───────────────── append 'hf' to the tuple (EXPERIMENTAL) ─────────────────┐
  │ CT_ARCH_ARM_TUPLE_USE_EABIHF:                                             │
  │                                                                           │
  │ Is you say 'y' here, then the tuple for the toolchain will end            │
  │ up with *eabihf, instead of the usual *eabi.                              │
  │                                                                           │
  │ *eabihf is used to denote that the toolchain *is* using the               │
  │ hard-float ABI, while *eabi is just an indication of using the            │
  │ soft-float ABI.                                                           │
  │                                                                           │
  │ Ie. all one can say is:  *eabihf   hard-float ABI                         │
  │                                                                           │
  │ Saying 'n' here does *not* impact the ability of the toolchain to         │
  │ generate hard-float instructions with the hard-float ABI. It is a         │
  │ purely cosmetic thing, used by distros to differentiate their             │
  │ hard-float-ABI-using ports from their soft-float-ABI-using ports.         │
  │ (eg. Debian Wheezy and above).                                            │
  │                                                                           │
  │ This is an option, as not all versions of gcc/binutils do support         │
  │ such tuple, and fail to build with *eabihf. Stock gcc version up          │
  │ to, and including 4.7.2 have an issue or another with *eabihf.            │
  │                                                                           │
  │ This option is here for the future.                                       │
  │                                                                           │
  │ Say 'n', unless you are trying to fix gcc to properly recognise           │
  │ the *eabihf tuples.                                                       │
  │                                                                           │
  │ Symbol: ARCH_ARM_TUPLE_USE_EABIHF [=y]                                    │
  │ Type  : boolean                                                           │
  │ Prompt: append 'hf' to the tuple (EXPERIMENTAL)                           │
  │   Defined at config/arch/arm.in.2:64                                      │
  │   Depends on: ARCH_arm [=y] && ARCH_FLOAT_HW [=y] && ARCH_ARM_EABI [=y]\  │
  │  && EXPERIMENTAL [=y]                                                     │
  │   Location:                                                               │
  │     -> Target options                                                     │
  │       -> Use EABI (ARCH_ARM_EABI [=y])                                    │

                

3.3.2.2.5.crosstool-ng中的配置引數:CFLAGS引數

crosstool-ng中,支援設定對應的CFLAGS引數,以傳遞給底層的gcc的。

經過之前的調查:

【整理】crosstool中Target CFLAGS引數的含義和如何設定

結論是:

一般設定為-O,即可。

Target options
    (-O) Target CFLAGS

                

Target CFLAGS的help的說明為:

  ┌────────────────────────────── Target CFLAGS ──────────────────────────────┐
  │ CT_TARGET_CFLAGS:                                                         │
  │                                                                           │
  │ Used to add specific options when compiling libraries of the toolchain,   │
  │ that will run on the target (eg. libc.so).                                │
  │                                                                           │
  │ Note that the options above for ARCH, ABI, CPU, TUNE and FPU will be      │
  │ automatically used. You don't need to specify them here.                  │
  │                                                                           │
  │ Leave blank if you don't know better.                                     │
  │                                                                           │
  │ Symbol: TARGET_CFLAGS [=-O]                                               │
  │ Type  : string                                                            │
  │ Prompt: Target CFLAGS                                                     │
  │   Defined at config/target.in:341                                         │
  │   Location:                                                               │
  │     -> Target options                                                     │

                

3.3.2.2.6.crosstool-ng中的配置引數:Linux核心版本

目前我的理解是:

對於你進行嵌入式開發時,所選擇的對應的Linux版本,應該和此處交叉編譯器配置的Linux核心版本要一致。

比如,我之前折騰:

【記錄】重試使用最新版本1.18.0的crosstool-ng去配置和編譯xscale的交叉編譯器

時,去選擇了,自定義版本的Linux核心:linux-2.6.19.1.tar.bz2

所以,此處,就先去把對應的,自己的linux-2.6.19.1.tar.bz2,放到對應的路徑下:

Cygwin下面的:

/home/CLi/develop/crosstool-ng/src/linux-2.6.19.1.tar.bz2

而當前自己的HOME路徑是:

/home/CLi

所以就可以去設定為:

Operating System
    Linux kernel version (custom tarball or directory)  --->
        custom tarball or directory
    (${HOME}/develop/crosstool-ng/src/linux-2.6.19.1.tar.bz2) Path to custom source, tarball or directory

                

Path to custom source, tarball or directory的help的說明為:

  ┌─────────────────────────── Path to custom source, tarball or directory ───────────────────────────┐
  │ CT_KERNEL_LINUX_CUSTOM_LOCATION:                                                                  │
  │                                                                                                   │
  │ Enter here the path to the tarball of your full kernel tree or                                    │
  │ kernel directory                                                                                  │
  │                                                                                                   │
  │ Symbol: KERNEL_LINUX_CUSTOM_LOCATION [=${HOME}/develop/crosstool-ng/src/linux-2.6.19.1.tar.bz2]   │
  │ Type  : string                                                                                    │
  │ Prompt: Path to custom source, tarball or directory                                               │
  │   Defined at config/kernel/linux.in:148                                                           │
  │   Depends on: <choice> && KERNEL_LINUX_CUSTOM [=y]                                                │
  │   Location:                                                                                       │
  │     -> Operating System                                                                           │
  │       -> Linux kernel version (<choice> [=y])                                                     │
  │         -> custom tarball or directory (KERNEL_LINUX_CUSTOM [=y])                                 │

                

如此,之後編譯的時候,就可以找到你自己設定的Linux核心,並解壓,去載入對應的標頭檔案等內容了。

3.3.2.2.7.crosstool-ng中的配置引數:binutils版本

binutils,是編譯交叉編譯器時,一個比較重要的元件。

對應的版本的選擇,一般還是按照之前使用示例配置時,選擇的為準。

如果後期編譯出錯,實在解決不了的時候,再考慮換個其他的版本試試。

我目前的配置,供參考:

Binary utilities
    binutils version (2.22)  --->

                

binutils version的help的說明為:

  ┌─────────────────────── binutils version ────────────────────────┐
  │ There is no help available for this option.                     │
  │ Prompt: binutils version                                        │
  │   Defined at config/binutils/binutils.in:5                      │
  │   Depends on: BINUTILS_binutils [=y]                            │
  │   Location:                                                     │
  │     -> Binary utilities                                         │
  │   Selected by: BINUTILS_binutils [=y] && m                      │

                

3.3.2.2.8.crosstool-ng中的配置引數:gcc版本

crosstool-ng中的gcc的版本選擇,也是屬於極其重要的引數。

此處我的gcc版本的選擇,還是按照之前的邏輯,選用示例配置中的gcc的版本的,此處是4.6.0版本的:

並且,對應著,此處,如果沒有特殊需求,則只是選擇C++的,即可。

即,剩餘那些語言:Fortran,Java,ADA,Objective-C,Objective-C++等,都無需選擇。

我此處的配置如下,供參考:

C compiler
    C compiler (gcc)  --->
    gcc version (4.6.0)  --->
    [*] C++
    [ ] Fortran
    [ ] Java
    [ ] ADA (EXPERIMENTAL)
    [ ] Objective-C (EXPERIMENTAL)
    [ ] Objective-C++ (EXPERIMENTAL)
    ()  Other languages (EXPERIMENTAL)

                

Linaro版本的gcc

Linaro版本的gcc,crosstool-ng現在也支援了。

所以,對應的可以看到,在之前選上:

Paths and misc options
    [*] Try features marked as EXPERIMENTAL

                    

之後,此處的gcc中,就可以去選上:

C compiler
    [*] Show Linaro versions

                    

然後就可以去"gcc version"中,找到有多個Linaro版本的gcc了:

│ │                    ( ) linaro-4.7-2013.01                      │ │
│ │                    ( ) 4.7.2                                   │ │
│ │                    ( ) 4.7.1                                   │ │
│ │                    ( ) 4.7.0                                   │ │
│ │                    ( ) linaro-4.6-2013.01                      │ │
│ │                    ( ) 4.6.3                                   │ │
│ │                    ( ) 4.6.2                                   │ │
│ │                    ( ) 4.6.1                                   │ │
│ │                    (X) 4.6.0                                   │ │
│ │                    ( ) linaro-4.5-2012.03                      │ │
│ │                    ( ) 4.5.3                                   │ │
│ │                    ( ) 4.5.2                                   │ │
│ │                    ( ) 4.5.1                                   │ │
│ │                    ( ) 4.5.0                                   │ │
│ │                    ( ) linaro-4.4-2011.02-0                    │ │
│ │                    ( ) 4.4.7                                   │ │
│ │                    ( ) 4.4.6                                   │ │
│ │                    ( ) 4.4.5                                   │ │
│ │                    ( ) 4.4.4                                   │ │
│ │                    ( ) 4.4.3                                   │ │
│ │                    ( ) 4.4.2                                   │ │
│ │                    ( ) 4.4.1                                   │ │
│ │                    ( ) 4.4.0                                   │ │
│ │                    ( ) 4.3.6                                   │ │
│ │                    ( ) 4.3.5                                   │ │
│ │                    ( ) 4.3.4                                   │ │
│ │                    ( ) 4.3.3                                   │ │
│ │                    ( ) 4.3.2                                   │ │
│ │                    ( ) 4.3.1                                   │ │
│ │                    ( ) 4.2.4                                   │ │

                    

然後,如果需要的話,可以去選上某個Linaro版本的gcc,比如:

C compiler
    gcc version (linaro-4.7-2013.01)  --->

                    

關於Linaro不熟悉的,可參考:

【整理】Linaro簡介

3.3.2.2.9.crosstool-ng中的配置引數:C庫的選擇

crosstool-ng中,關於C庫的選擇,也是個重要的問題。

常見的有三種C庫:glibc,eglibc,uclibc

不瞭解的,可參考:【整理】uclibc,eglibc,glibc之間的區別和聯絡

一般選擇glibc或者是eglibc。

我此處,選擇的是glibc,對應的版本選擇,也是使用之前示例配置中的2.9

配置如下:

C-library
    C library (glibc)  --->
    glibc version (2.9)  --->

                

3.3.2.2.10.crosstool-ng中的配置引數:執行緒模型的選擇

執行緒模型主要分兩種:linuxThreads和nptl

相關區別,可參考這個帖子:Linux 執行緒模型的比較:LinuxThreads 和 NPTL

現在多數都選擇,預設的nptl

配置如下:

C-library
    Threading implementation to use: (nptl)  --->

                

第4章編譯crosstool-ng:ct-ng build

相關舊帖:【總結】crosstool-ng使用心得和注意事項

在之前配置完畢crosstool-ng後,就可以去編譯了。

ct-ng build

然後,如果順利的話,過一定的時間,你就可以編譯完成,得到對應的交叉編譯器了。

ct-ng build總共所耗時間

此處crosstool-ng的編譯總體花費時間,取決於你的總體配置,機器效能等因素。

比較老的一些電腦,估計會在3,4個小時,甚至更多的時間。

目前多數電腦的效能,平均在1到2個小時前後。

比如,我之前的一次編譯:

【記錄】在Ubuntu下用crosstool-ng編譯xscale的交叉工具鏈

就花費了72分鐘。

當ct-ng build期間出問題

當然,編譯期間,一般來說,多少都會出現一些問題。

對於一些常見的問題,可以去參考後面所總結的:

第5.2節 “crosstool-ng在編譯階段常見問題及解決辦法”

例4.1.正常輸出的log資訊

此處,貼上,我之前:

【記錄】在Ubuntu下用crosstool-ng編譯xscale的交叉工具鏈

的成功編譯的輸出的內容(去除之前錯誤,合併正常的輸出後的結果):

crifan@ubuntu:~/develop/crosstool-ng/crosstool-ng-1.18.0_build$ ct-ng build
[INFO ]  Performing some trivial sanity checks
[INFO ]  Build started 20130807.235739
[INFO ]  Building environment variables
[EXTRA]  Preparing working directories
[EXTRA]  Installing user-supplied crosstool-NG configuration
[EXTRA]  =================================================================
[EXTRA]  Dumping internal crosstool-NG configuration
[EXTRA]    Building a toolchain for:
[EXTRA]      build  = i686-pc-linux-gnu
[EXTRA]      host   = i686-pc-linux-gnu
[EXTRA]      target = arm-xscale-linux-gnueabi
[EXTRA]  Dumping internal crosstool-NG configuration: done in 0.09s (at 00:02)
[INFO ]  =================================================================
[INFO ]  Retrieving needed toolchain components' tarballs
[EXTRA]    Using 'linux-custom' from custom location
[INFO ]  Retrieving needed toolchain components' tarballs: done in 0.30s (at 00:02)
[INFO ]  =================================================================
[INFO ]  Extracting and patching toolchain components
[EXTRA]    Extracting 'linux-custom'
[EXTRA]    Extracting 'gmp-5.0.2'
[EXTRA]    Patching 'gmp-5.0.2'
[EXTRA]    Extracting 'mpfr-3.1.0'
[EXTRA]    Patching 'mpfr-3.1.0'
[EXTRA]    Extracting 'mpc-0.9'
[EXTRA]    Patching 'mpc-0.9'
[EXTRA]    Extracting 'libelf-0.8.13'
[EXTRA]    Patching 'libelf-0.8.13'
[EXTRA]    Extracting 'binutils-2.22'
[EXTRA]    Patching 'binutils-2.22'
[EXTRA]    Extracting 'gcc-4.6.0'
[EXTRA]    Patching 'gcc-4.6.0'
[EXTRA]    Extracting 'glibc-2.9'
[EXTRA]    Patching 'glibc-2.9'
[EXTRA]    Extracting 'glibc-ports-2.9'
[EXTRA]    Patching 'glibc-ports-2.9'
[EXTRA]    Extracting 'dmalloc-5.5.2'
[EXTRA]    Patching 'dmalloc-5.5.2'
[EXTRA]    Extracting 'gdb-6.8a'
[EXTRA]    Patching 'gdb-6.8a'
[EXTRA]    Extracting 'ncurses-5.9'
[EXTRA]    Patching 'ncurses-5.9'
[EXTRA]    Extracting 'expat-2.1.0'
[EXTRA]    Patching 'expat-2.1.0'
[EXTRA]    Extracting 'ltrace-0.5.3'
[EXTRA]    Patching 'ltrace-0.5.3'
[EXTRA]    Extracting 'strace-4.5.19'
[EXTRA]    Patching 'strace-4.5.19'
[INFO ]  Extracting and patching toolchain components: done in 89.30s (at 01:32)
[EXTRA]  Saving state to restart at step 'libc_check_config'...
[EXTRA]  Saving state to restart at step 'companion_libs_for_build'...
[EXTRA]  Saving state to restart at step 'binutils_for_build'...
[EXTRA]  Saving state to restart at step 'companion_libs_for_host'...
[INFO ]  =================================================================
[INFO ]  Installing GMP for host
[EXTRA]    Configuring GMP
[EXTRA]    Building GMP
[EXTRA]    Installing GMP
[INFO ]  Installing GMP for host: done in 50.61s (at 02:23)
[INFO ]  =================================================================
[INFO ]  Installing MPFR for host
[EXTRA]    Configuring MPFR
[EXTRA]    Building MPFR
[EXTRA]    Installing MPFR
[INFO ]  Installing MPFR for host: done in 21.73s (at 02:45)
[INFO ]  =================================================================
[INFO ]  Installing MPC for host
[EXTRA]    Configuring MPC
[EXTRA]    Building MPC
[EXTRA]    Installing MPC
[INFO ]  Installing MPC for host: done in 8.38s (at 02:53)
[EXTRA]  Saving state to restart at step 'binutils_for_host'...
[INFO ]  =================================================================
[INFO ]  Installing binutils for host
[EXTRA]    Configuring binutils
[EXTRA]    Building binutils
[EXTRA]    Installing binutils
[INFO ]  Installing binutils for host: done in 71.16s (at 04:05)
[EXTRA]  Saving state to restart at step 'cc_core_pass_1'...
[INFO ]  =================================================================
[INFO ]  Installing pass-1 core C compiler
[EXTRA]    Configuring gcc
[EXTRA]    Building gcc
...
[INFO ]  =================================================================
[INFO ]  Installing kernel headers
[EXTRA]    Installing kernel headers
...
[INFO ]  Installing kernel headers: done in 972.34s (at 39:34)
[EXTRA]  Saving state to restart at step 'libc_start_files'...
[INFO ]  =================================================================
[INFO ]  Installing C library headers & start files
[EXTRA]    Configuring C library
[EXTRA]    Installing C library headers
[EXTRA]    Installing C library start files
[INFO ]  Installing C library headers & start files: done in 23.14s (at 40:02)
[EXTRA]  Saving state to restart at step 'cc_core_pass_2'...
[INFO ]  =================================================================
[INFO ]  Installing pass-2 core C compiler
[EXTRA]    Configuring gcc
[EXTRA]    Building gcc
[EXTRA]    Installing gcc
[INFO ]  Installing pass-2 core C compiler: done in 297.35s (at 45:04)
[EXTRA]  Saving state to restart at step 'libc'...
[INFO ]  =================================================================
[INFO ]  Installing C library
[EXTRA]    Configuring C library
[EXTRA]    Building C library
[EXTRA]    Installing C library
[INFO ]  Installing C library: done in 286.37s (at 49:56)
[EXTRA]  Saving state to restart at step 'cc_for_build'...
[EXTRA]  Saving state to restart at step 'cc_for_host'...
[INFO ]  =================================================================
[INFO ]  Installing final compiler
[EXTRA]    Configuring gcc
[EXTRA]    Building gcc
[EXTRA]    Installing gcc
[INFO ]  Installing final compiler: done in 377.10s (at 56:25)
[EXTRA]  Saving state to restart at step 'libelf_for_target'...
[INFO ]  =================================================================
[INFO ]  Installing libelf for the target
[EXTRA]    Configuring libelf
[EXTRA]    Building libelf
[EXTRA]    Installing libelf
[INFO ]  Installing libelf for the target: done in 3.99s (at 56:42)
[EXTRA]  Saving state to restart at step 'binutils_for_target'...
[INFO ]  =================================================================
[INFO ]  Installing binutils for target
[EXTRA]    Configuring binutils for target
[EXTRA]    Building binutils' libraries (libiberty bfd) for target
[EXTRA]    Installing binutils' libraries (libiberty bfd) for target
[INFO ]  Installing binutils for target: done in 44.91s (at 57:40)
[EXTRA]  Saving state to restart at step 'debug'...
[INFO ]  =================================================================
[INFO ]  Installing dmalloc
[EXTRA]    Configuring dmalloc
[EXTRA]    Building dmalloc
[EXTRA]    Installing dmalloc
[INFO ]  Installing dmalloc: done in 6.77s (at 57:59)
[INFO ]  =================================================================
[INFO ]  Installing cross-gdb
[EXTRA]    Configuring cross-gdb
[EXTRA]    Building cross-gdb
...
[INFO ]  Installing cross-gdb: done in 687.38s (at 69:26)
[INFO ]  =================================================================
[INFO ]  Installing native gdb
[EXTRA]    Building static target ncurses
[EXTRA]    Building static target expat
[EXTRA]    Configuring native gdb
[EXTRA]    Building native gdb
[EXTRA]    Installing native gdb
[INFO ]  Installing native gdb: done in 140.70s (at 71:47)
[INFO ]  =================================================================
[INFO ]  Installing gdbserver
[EXTRA]    Configuring gdbserver
[EXTRA]    Building gdbserver
[EXTRA]    Installing gdbserver
[INFO ]  Installing gdbserver: done in 4.65s (at 71:52)
[INFO ]  =================================================================
[INFO ]  Installing ltrace
[EXTRA]    Copying sources to build dir
[EXTRA]    Configuring ltrace
[EXTRA]    Building ltrace
[EXTRA]    Installing ltrace
[INFO ]  Installing ltrace: done in 2.37s (at 71:54)
[INFO ]  =================================================================
[INFO ]  Installing strace
[EXTRA]    Configuring strace
[EXTRA]    Building strace
[EXTRA]    Installing strace
[INFO ]  Installing strace: done in 9.33s (at 72:04)
[EXTRA]  Saving state to restart at step 'test_suite'...
[EXTRA]  Saving state to restart at step 'finish'...
[INFO ]  =================================================================
[INFO ]  Cleaning-up the toolchain's directory
[INFO ]    Stripping all toolchain executables
[EXTRA]    Installing the populate helper
[EXTRA]    Installing a cross-ldd helper
[EXTRA]    Creating toolchain aliases
[EXTRA]    Removing access to the build system tools
[EXTRA]    Removing installed documentation
[INFO ]  Cleaning-up the toolchain's directory: done in 2.03s (at 72:35)
[INFO ]  Build completed at 20130808.011013
[INFO ]  (elapsed: 72:34.05)
[INFO ]  Finishing installation (may take a few seconds)...
[72:35] / crifan@ubuntu:~/develop/crosstool-ng/crosstool-ng-1.18.0_build$

    

想要在編譯的時候輸出所有的資訊

根據之前第3.1.1節 “用ct-ng help檢視所擁有的功能”中的介紹,通過加上V=2引數,可以實現,即輸入,預設就輸出的,人類可讀的資訊,也輸出內部執行的那些命令。

如果有需求的話,為了編譯出錯時,可以直接方便的看到所正在執行的命令,是哪個出錯了。

(就不用去看對應的,當前資料夾下面的build.log了)

那麼可以自己去試試,加上V=2的效果,即:

ct-ng build V=2

的效果。

第5章crosstool-ng常見問題及解決辦法

目錄

5.1. 安裝crosstool-ng工具本身的階段常見問題及解決辦法
5.1.1. 缺少一些開發相關的工具
5.1.1.1. configure: error: missing required tool: bison
5.1.1.2. configure: error: missing required tool: flex
5.1.1.3. configure: error: missing required tool: gperf
5.1.1.4. configure: error: missing required tool: makeinfo
5.1.1.5. configure: error: could not find GNU awk
5.1.1.6. configure: error: could not find GNU libtool >= 1.5.26
5.1.1.7. configure: error: could not find GNU automake >= 1.10
5.1.1.8. configure: error: could not find curses header, required for the kconfig frontends
5.1.2. 在Cygwin下出現的一些問題
5.1.2.1. zconf.tab.o:zconf.tab.c:(.text+0x162a): undefined reference to ‘_libintl_gettext'
5.1.2.2. lxdialog/menubox.o:menubox.c:(.text+0x7d): undefined reference to `_wattrset'
5.1.2.3. nconf.c:1521:2: error: lvalue required as left operand of assignment
5.1.2.4. bash: ct-ng: command not found
5.1.2.5. Win7下無法編輯儲存Cygwin中的檔案
5.2. crosstool-ng在編譯階段常見問題及解決辦法
5.2.1. 不論何種平臺下編譯crosstool-ng常見錯誤及解決辦法
5.2.1.1. scripts/unifdef.c:209:25: error: conflicting types for ‘getline'
5.2.1.2. Build failed in step ‘Extracting and patching toolchain components’,in function ‘CT_DoExecLog’ (line unknown, sorry)
5.2.1.3. [libgcc/./_powisf2.o] Error 1,/tmp/cc7Xh6xp.s:21: Error: selected processor does not support ARM mode `fmsr s14,r0′
5.2.1.4. .build/arm-xscale-linux-gnueabi/buildtools/include/cloog/ppl_backend.h:54: undefined reference to `_ppl_finalize'
5.2.1.5. Makefile:240: *** mixed implicit and normal rules. Stop.
5.2.1.5.1. 手動修改每個Makefile中對應的混合規則->使得3.82的make可以識別
5.2.1.5.2. 把3.82的make換成3.81版本的make
5.2.1.5.2.1. 把你當前的(Linux或Cygwin等)系統環境中的3.82的make換成3.81的make
5.2.1.5.2.2. 用crosstool-ng中提供的3.81的make(而不用更換系統環境中的3.82的make)
5.2.2. Cygwin下編譯crosstool-ng常見錯誤及解決辦法
5.2.2.1. Cygwin下編譯crosstool-ng時導致記憶體洩露
5.2.2.2. Your file system in ‘xxx/targets’ is *not* case-sensitive!
5.2.3. Linux下編譯crosstool-ng常見錯誤及解決辦法
5.2.3.1. gcc-4.2.2/gcc/regrename.c:1646:12: error: ‘IFCVT_ALLOW_MODIFY_TEST_IN_INSN’ undeclared (first use in this function)

相關舊帖:【總結】crosstool-ng使用心得和注意事項

5.1.安裝crosstool-ng工具本身的階段常見問題及解決辦法

安裝crosstool-ng工具本身,也常會遇到一些小問題。

5.1.1.缺少一些開發相關的工具

比如,在configure和make等時候,提示你缺少一些工具,版本等不滿足要求之類的錯誤。

這時候,基本的邏輯都是:

搞清楚當前缺少的是哪個(版本的)工具,然後去安裝上去,即可。

當cygwin下缺失某軟體包時請重新安裝Cygwin且全選整個Develop那組的所有軟體包

注意,如果這些問題,是發生在Cygwin下,那麼,則需要你去安裝對應的軟體包。

其中,比較好的做法是:

在安裝Cygwin的時候,對於Developmen那個分類,全部都安裝。

詳見:

Cygwin詳解

5.1.1.1.configure: error: missing required tool: bison

在Ubuntu下,解決辦法是:

sudo apt-get install bison

詳見:【記錄】在Ubuntu下用crosstool-ng編譯xscale的交叉工具鏈

5.1.1.2.configure: error: missing required tool: flex

在Ubuntu下,解決辦法是:

sudo apt-get install flex

詳見:【記錄】在Ubuntu下用crosstool-ng編譯xscale的交叉工具鏈

5.1.1.3.configure: error: missing required tool: gperf

在Ubuntu下,解決辦法是:

sudo apt-get install gperf

詳見:【記錄】在Ubuntu下用crosstool-ng編譯xscale的交叉工具鏈

5.1.1.4.configure: error: missing required tool: makeinfo

在Ubuntu下,解決辦法是:

sudo apt-get install texinfo

詳見:【已解決】Ubuntu中用sudo apt-get install安裝某軟體,結果出錯:E: Unable to locate package makeinfo

5.1.1.5.configure: error: could not find GNU awk

在Ubuntu下,解決辦法是:

sudo apt-get install gawk

詳見:【記錄】在Ubuntu下用crosstool-ng編譯xscale的交叉工具鏈

5.1.1.6.configure: error: could not find GNU libtool >= 1.5.26

在Ubuntu下,解決辦法是:

sudo apt-get install libtool

詳見:【已解決】Ubuntu下去配置crosstool-ng時出現:configure: error: could not find GNU libtool >= 1.5.26

5.1.1.7.configure: error: could not find GNU automake >= 1.10

在Ubuntu下,解決辦法是:

sudo apt-get install automake

詳見:【記錄】在Ubuntu下用crosstool-ng編譯xscale的交叉工具鏈

5.1.1.8.configure: error: could not find curses header, required for the kconfig frontends

在Ubuntu下,解決辦法是:

sudo apt-get install libncurses5-dev

詳見:【記錄】在Ubuntu下用crosstool-ng編譯xscale的交叉工具鏈

5.1.2.在Cygwin下出現的一些問題

除了上述所說的,在Linux以及Cygwin下都可能會出現的一些問題之外,

在Cygwin環境下,還會出現一些,和Cygwin特定相關的一些問題:

5.1.2.1.zconf.tab.o:zconf.tab.c:(.text+0x162a): undefined reference to ‘_libintl_gettext'

錯誤現象:

cygwin下make編譯crosstool-ng出錯:

CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.18.0
$ make
  SED    'ct-ng'
  SED    'scripts/crosstool-NG.sh'
  SED    'scripts/saveSample.sh'
  SED    'scripts/showTuple.sh'
  GEN    'config/configure.in'
  GEN    'paths.mk'
  GEN    'paths.sh'
  DEP    'nconf.gui.dep'
  DEP    'nconf.dep'
  DEP    'lxdialog/checklist.dep'
  DEP    'lxdialog/inputbox.dep'
  DEP    'lxdialog/util.dep'
  DEP    'lxdialog/textbox.dep'
  DEP    'lxdialog/yesno.dep'
  DEP    'lxdialog/menubox.dep'
  DEP    'mconf.dep'
  DEP    'conf.dep'
  BISON  'zconf.tab.c'
  GPERF  'zconf.hash.c'
  LEX    'lex.zconf.c'
  DEP    'zconf.tab.dep'
  CC     'zconf.tab.o'
  CC     'conf.o'
  LD     'conf'
zconf.tab.o:zconf.tab.c:(.text+0x162a): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0x47fe): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0x56ec): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0x58be): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0xc70b): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0xc719): more undefined references to `_libintl_gettext' follow
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: zconf.tab.o: bad reloc address 0x110 in section `.data'
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: final link failed: Invalid operation
collect2: ld returned 1 exit status
Makefile:108: recipe for target `conf' failed
make[2]: *** [conf] Error 1
Makefile:160: recipe for target `build-lib-kconfig' failed
make[1]: *** [build-lib-kconfig] Error 2
Makefile:120: recipe for target `build' failed
make: *** [build] Error 2

            

原因:

Cygwin下雖然已經安裝了intl庫,但是此處make編譯的時候,沒有連結進去,所以報錯。

解決辦法:

修改對應的Makefile檔案:

crosstool-ng-1.18.0\kconfig\Makefile

            

去新增對應的intl庫,即改為:

# What’s needed to build ‘conf’
conf_SRC = conf.c
conf_OBJ = $(patsubst %.c,%.o,$(conf_SRC))
conf_DEP = $(patsubst %.o,%.dep,$(conf_OBJ))
$(conf_OBJ) $(conf_DEP): CFLAGS += $(INTL_CFLAGS)
conf: LDFLAGS += -lintl

# What’s needed to build ‘mconf’
mconf_SRC = mconf.c
mconf_OBJ = $(patsubst %.c,%.o,$(mconf_SRC))
mconf_DEP = $(patsubst %.c,%.dep,$(mconf_SRC))
$(mconf_OBJ) $(mconf_DEP): CFLAGS += $(NCURSES_CFLAGS) $(INTL_CFLAGS)
#mconf: LDFLAGS += $(NCURSES_LDFLAGS)
mconf: LDFLAGS += -lintl $(NCURSES_LDFLAGS)

# What’s needed to build ‘nconf’
nconf_SRC = nconf.c nconf.gui.c
nconf_OBJ = $(patsubst %.c,%.o,$(nconf_SRC))
nconf_DEP = $(patsubst %.c,%.dep,$(nconf_SRC))
#$(nconf_OBJ) $(nconf_DEP): CFLAGS += $(INTL_CFLAGS) -I/usr/include/ncurses
#nconf: LDFLAGS += -lmenu -lpanel -lncurses
$(nconf_OBJ) $(nconf_DEP): CFLAGS += -I/usr/include/ncurses/ $(INTL_CFLAGS)
nconf: LDFLAGS += -lintl -lmenu -lpanel -lncurses

            
此處也同時添加了ncurses庫,解決了undefined reference to `_wattrset'的問題

此問題的解決,是在折騰:

【已解決】cygwin中編譯crosstool-ng出錯:zconf.tab.o:zconf.tab.c:(.text+0x162a): undefined reference to ‘_libintl_gettext'

時,去參考:

Re: crosstool-NG Cygwin Build Fails

而找到的解決辦法。

可以看出,其中,在新增intl的同時,也同時去添加了對應的ncurses那個庫。

那是因為,後期,同樣會出現類似的錯誤第5.1.2.2節 “lxdialog/menubox.o:menubox.c:(.text+0x7d): undefined reference to `_wattrset'”

所以,此處,也加上對應的ncurses庫,一併解決了類似的問題。

此處不要通過make時加LDFLAGS引數去新增-lintl和-lcurses

其實,上面貼出來的,修改makefile的辦法,的確已經解決了此處的,缺少intl和缺少ncurses的庫的兩個問題了。

只是,後來,在另外一個Cygwin環境下去折騰同樣的make編譯crosstool-ng的時候:

【記錄】Cygwin下配置編譯和安裝crosstool-ng

由於之前解決上面這個問題的時候:

【已解決】Cygwin 1.7.17下make編譯crosstool-ng出錯:zconf.tab.o:zconf.tab.c:(.text+0x162a): undefined reference to `_libintl_gettext'

用的解決辦法是:

不去修改makefile,而直接給make加上LDFLAGS引數加上-lintl:

make LDFLAGS="-lintl"

當時也是可以解決此問題的。

並且,接著去解決了:第5.1.2.2節 “lxdialog/menubox.o:menubox.c:(.text+0x7d): undefined reference to `_wattrset'”

用的方法也是,繼續給make的LDFLAGS新增對應的-lcurses的引數:

make LDFLAGS="-lintl -lcurses"

然後,後來就出現,相對來說,至少到目前為止,沒有完全搞懂的問題:

【已解決】Cygwin下make編譯crosstool-ng出錯:nconf.o:nconf.c:(.text+0×373): undefined reference to `_free_item’

覺得是屬於比較詭異的問題。

而最終的解決辦法是:

不要用make時給定LDFLAGS引數的方式去新增intl和curses的庫

還是用上述的辦法,修改對應的makefile,新增對應的intl的庫,調整對應的

$(INTL_CFLAGS) -I/usr/include/ncurses

                

變成:

-I/usr/include/ncurses/ $(INTL_CFLAGS)

                

即可徹底解決此詭異的問題。

在該詭異問題的根本原因沒有搞清楚之前,別人如果遇到類似的錯誤,還是參照此處,修改makefile去解決類似的問題。

5.1.2.2.lxdialog/menubox.o:menubox.c:(.text+0x7d): undefined reference to `_wattrset'

錯誤現象:

cygwin下make編譯crosstool-ng出錯:

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0
$ make LDFLAGS="-lintl"
  GEN    'config/configure.in'
  GEN    'paths.mk'
  GEN    'paths.sh'
  LD     'conf'
  CC     'lxdialog/menubox.o'
  CC     'lxdialog/yesno.o'
  CC     'lxdialog/textbox.o'
  CC     'lxdialog/util.o'
  CC     'lxdialog/inputbox.o'
  CC     'lxdialog/checklist.o'
  CC     'mconf.o'
  LD     'mconf'
lxdialog/menubox.o:menubox.c:(.text+0x7d): undefined reference to `_wattrset'
lxdialog/menubox.o:menubox.c:(.text+0x97): undefined reference to `_wmove'
......
mconf.o:mconf.c:(.text+0x13de): undefined reference to `_ncwrap_stdscr'
mconf.o:mconf.c:(.text+0x13e6): undefined reference to `_getcurx'
collect2: ld returned 1 exit status
Makefile:100: recipe for target `mconf' failed
make[2]: *** [mconf] Error 1
Makefile:160: recipe for target `build-lib-kconfig' failed
make[1]: *** [build-lib-kconfig] Error 2
Makefile:120: recipe for target `build' failed
make: *** [build] Error 2

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0$

            

原因:

Cygwin下雖然已經安裝了ncurses庫,但是此處make編譯的時候,沒有連結進去,所以報錯。

解決辦法:

參見:第5.1.2.1節 “zconf.tab.o:zconf.tab.c:(.text+0x162a): undefined reference to ‘_libintl_gettext'”中的此處也同時添加了ncurses庫,解決了undefined reference to `_wattrset'的問題,去修改makefile而解決。

注意:參見之前此處不要通過make時加LDFLAGS引數去新增-lintl和-lcurses的解釋,不要通過給make加LDFLAGS的方式去解決此問題,而是如上,使用修改makefile去解決此問題。

5.1.2.3.nconf.c:1521:2: error: lvalue required as left operand of assignment

錯誤現象:

cygwin下make編譯crosstool-ng出錯:

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0
$ make LDFLAGS="-lintl -lcurses"
  GEN    'config/configure.in'
  GEN    'paths.mk'
  GEN    'paths.sh'
  LD     'mconf'
  CC     'nconf.o'
nconf.c: In function 'main':
nconf.c:1521:2: error: lvalue required as left operand of assignment
Makefile:95: recipe for target `nconf.o' failed
make[2]: *** [nconf.o] Error 1
Makefile:160: recipe for target `build-lib-kconfig' failed
make[1]: *** [build-lib-kconfig] Error 2
Makefile:120: recipe for target `build' failed
make: *** [build] Error 2

            

原因:

nconf.c中(不知何故)無法找到對應的巨集ESCDELAY,導致此處的程式碼:

ESCDELAY = 1;

            

變成一個未知的變數的左賦值,所以報此錯誤。

解決辦法:

把對應的出錯的檔案:

crosstool-ng-1.18.0\kconfig\nconf.c

修改為:

//ESCDELAY = 1;
set_escdelay(1);

            

詳見:

【已解決】Cygwin下make編譯crosstool-ng出錯:nconf.c:1521:2: error: lvalue required as left operand of assignment

5.1.2.4.bash: ct-ng: command not found

之前參考別人的教程:

Cygwin下用crosstool-ng 編譯交叉工具鏈

去折騰crosstool-ng的時候,在Cygwin下面,遇到一個問題:

同樣的去執行對應的命令:

echo "PATH=$PATH:/new/added/some/path" >> ~/.bashrc

但是echo.bashrc中的PATH的值,卻是展開的。

從而,導致.bashrc中的內容,太亂,以至於無法正常執行。

所以,經過一番折騰,才發現,原來是,在Cygwin中,echo的值,包含環境變數的話,是需要轉義的,即寫為:

echo "PATH=\$PATH:/new/added/some/path" >> ~/.bashrc

才可以的。

【已解決】Cygwin中安裝完crosstool-ng後,執行ct-ng help出錯:bash: ct-ng: command not found

5.1.2.5.Win7下無法編輯儲存Cygwin中的檔案

實際上,此問題,不屬於此處crosstool-ng方面的問題,只是和cygwin有關。

如果有人遇到類似的問題:

cygwin的檔案,在Win7中(通過資源管理器)開啟後,用編輯器開啟,可以編輯,但是去儲存時,無法儲存。

則可以去參考Cygwin中的專門的解釋:

Cygwin下的檔案可以編輯但是無法儲存

5.2.crosstool-ng在編譯階段常見問題及解決辦法

5.2.1.不論何種平臺下編譯crosstool-ng常見錯誤及解決辦法

不論是在Cygwin還是在Linux類系統中,都常見的錯誤:

5.2.1.1.scripts/unifdef.c:209:25: error: conflicting types for ‘getline'

錯誤現象:

cygwin下ct-ng build去編譯crosstool-ng出現:

CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng build
......
[INFO ]  =================================================================
[INFO ]  Installing kernel headers
[EXTRA]    Installing kernel headers
[ERROR]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/linux-custom/scripts/unifdef.c:209:25: error: conflicting types for 'getline'
[ERROR]    make[3]: *** [scripts/unifdef] Error 1
[ERROR]    make[2]: *** [headers_install] Error 2
[ERROR]    make[1]: *** [headers_install] Error 2
[ERROR]
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing kernel headers'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR]  >>        called from: do_kernel_install[scripts/build/kernel/linux.sh@112]
[ERROR]  >>        called from: do_kernel_headers[scripts/build/kernel/linux.sh@91]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@632]
......

            

原因:

Linux原始碼中的scripts/unifdef.c中的函式:getline,和別處重複定義了。

此問題,算是一個,很普遍遇到的,很早之前就出現的問題了。

解決辦法:

把getline隨便改個別的名字,即可。比如改為get_line

具體做法:

去修改對應的檔案;

crosstool-ng-1.18.0_build\.build\src\linux-custom\scripts\unifdef.c

改為:

static void             flushline(bool);
//static Linetype         getline(void);
static Linetype         get_line(void);
static Linetype         ifeval(const char **);
 
......
 
/*
 * The driver for the state machine.
 */
static void
process(void)
{
    Linetype lineval;
 
    for (;;) {
        linenum++;
        //lineval = getline();
        lineval = get_line();
        trans_table[ifstate[depth]][lineval]();
        debug("process %s -> %s depth %d",
            linetype_name[lineval],
            ifstate_name[ifstate[depth]], depth);
    }
}
 
/*
 * Parse a line and determine its type. We keep the preprocessor line
 * parser state between calls in the global variable linestate, with
 * help from skipcomment().
 */
static Linetype
//getline(void)
get_line(void)
{

            

即可。

詳見:【已解決】crosstool-ng在Installing kernel headers時出錯:[ERROR] /xxx/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/linux-custom/scripts/unifdef.c:209:25: error: conflicting types for ‘getline’

5.2.1.2.Build failed in step ‘Extracting and patching toolchain components’,in function ‘CT_DoExecLog’ (line unknown, sorry)

錯誤現象:

cygwin下ct-ng build去編譯crosstool-ng出現:

[ERROR]    Build failed in step 'Extracting and patching toolchain components'
[ERROR]    Error happened in '/opt/crosstool-ng/lib/ct-ng-1.9.3/scripts/functions' in function 'CT_DoExecLog' (line unknown, sorry)
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.9.3/scripts/functions' at line # 681 in function 'CT_Extract'
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.9.3/scripts/build/debug/300-gdb.sh' at line # 65 in function 'do_debug_gdb_extract'
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.9.3/scripts/build/debug.sh' at line # 28 in function 'do_debug_extract'
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.9.3/scripts/crosstool-NG.sh' at line # 569 in function 'main'
[ERROR]    Look at '/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/build.log' for more info on this error.
[ERROR]  (elapsed: 10:01.80)
[10:06] / /opt/crosstool-ng/bin/ct-ng:143: recipe for target `build' failed
make: *** [build] Error 2

            

原因:

此處遇到此問題的原因,好像是:

由於之前下載過程中,由於某種原因,比如網路不穩定等,而導致下載下來的原始碼包不是完整的

從而導致後續的解壓和打補丁出錯。

解決辦法:

去確定,你當前正在處理,即正在解壓和打包的是哪個軟體包

然後去重新下載一個對應的,完整的無誤的,該版本的軟體包

放到對應的目錄下即可。

比如:此處正在處理的是ncurses的5.7版本的原始碼包

對應的檔案是:ncurses-5.7.tar.gz

所以去:

  1. 刪除

    crosstool-ng\crosstool-ng-1.9.3_build\targets\src

    中的.ncurses-5.7.extractingncurses-5.7.tar.gz

  2. 刪除

    crosstool-ng\crosstool-ng-1.9.3_build\targets\tarballs

    中的ncurses-5.7.tar.gz

  3. 拷貝最新的,你剛下載好的,確保是完整的ncurses-5.7.tar.bz2到:

    crosstool-ng\crosstool-ng-1.9.3_build\targets\src

如果你遇到類似問題,參考上面的步驟,去試試,應該就可以解決此類問題了。

詳見:【已解決】crosstool編譯出錯:Build failed in step ‘Extracting and patching toolchain components’,in function ‘CT_DoExecLog’ (line unknown, sorry),at line # 681 in function ‘CT_Extract’

5.2.1.3.[libgcc/./_powisf2.o] Error 1,/tmp/cc7Xh6xp.s:21: Error: selected processor does not support ARM mode `fmsr s14,r0′

錯誤現象:

cygwin下ct-ng build去編譯crosstool-ng出現:

CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng build
......
[INFO ]  =================================================================
[INFO ]  Installing pass-1 core C compiler
[EXTRA]    Configuring gcc
[EXTRA]    Building gcc
[ERROR]    make[3]: *** [libgcc/./_powisf2.o] Error 1
[ERROR]    make[3]: *** [libgcc/./_powidf2.o] Error 1
[ERROR]    make[2]: *** [stmp-multilib] Error 2
[ERROR]    make[1]: *** [all-gcc] Error 2
......

            

對應build.log中的詳細內容為:

[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/build/build-cc-core-pass-1/./gcc/xgcc -B/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/build/build-cc-core-pass-1/./gcc/ -B/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/arm-xscale-linux-gnueabi/bin/ -B/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/arm-xscale-linux-gnueabi/lib/ -isystem /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/arm-xscale-linux-gnueabi/include -isystem /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/arm-xscale-linux-gnueabi/sys-include -O2  -g -Os -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC  -g   -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -Dinhibit_libc -I. -I. -I/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/gcc-4.2.2/gcc -I/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/gcc-4.2.2/gcc/.  -I/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/gcc-4.2.2/gcc/../include   -I/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/gcc-4.2.2/gcc/../libcpp/include  -I/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/gcc-4.2.2/gcc/../libdecnumber -I../libdecnumber -DL_powixf2 -c /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/gcc-4.2.2/gcc/libgcc2.c -o libgcc/./_powixf2.o
[ALL  ]    /tmp/cc7Xh6xp.s: Assembler messages:
[ALL  ]    /tmp/cc7Xh6xp.s:21: Error: selected processor does not support ARM mode `fmsr s14,r0'
[ALL  ]    /tmp/cc7Xh6xp.s:27: Error: selected processor does not support ARM mode `flds s15,.L16'
[ALL  ]    /tmp/cc7Xh6xp.s:28: Error: selected processor does not support ARM mode `fcpyseq s13,s15'
[ALL  ]    /tmp/cc7Xh6xp.s:29: Error: selected processor does not support ARM mode `fcpysne s13,s14'
[ALL  ]    /tmp/cc7Xh6xp.s:39: Error: selected processor does not support ARM mode `fmuls s14,s14,s14'
[ALL  ]    /tmp/cc7Xh6xp.s:41: Error: selected processor does not support ARM mode `fmulsne s13,s13,s14'
[ALL  ]    /tmp/cc7Xh6xp.s:49: Error: selected processor does not support ARM mode `fldslt s15,.L16'
[ALL  ]    /tmp/cc7Xh6xp.s:50: Error: selected processor does not support ARM mode `fdivslt s13,s15,s13'
[ALL  ]    /tmp/cc7Xh6xp.s:52: Error: selected processor does not support ARM mode `fmrs r0,s13'
[ALL  ]    libgcc.mk:223: recipe for target `libgcc/./_powisf2.o' failed
[ERROR]    make[3]: *** [libgcc/./_powisf2.o] Error 1
[ALL  ]    make[3]: *** Waiting for unfinished jobs....
[ALL  ]    /tmp/ccSq3fkb.s: Assembler messages:
[ALL  ]    /tmp/ccSq3fkb.s:21: Error: selected processor does not support ARM mode `fmdrr d6,r0,r1'
[ALL  ]    /tmp/ccSq3fkb.s:23: Error: selected processor does not support ARM mode `fldd d7,.L16'
[ALL  ]    /tmp/ccSq3fkb.s:29: Error: selected processor does not support ARM mode `fcpydeq d5,d7'
[ALL  ]    /tmp/ccSq3fkb.s:30: Error: selected processor does not support ARM mode `fcpydne d5,d6'
[ALL  ]    /tmp/ccSq3fkb.s:40: Error: selected processor does not support ARM mode `fmuld d6,d6,d6'
[ALL  ]    /tmp/ccSq3fkb.s:42: Error: selected processor does not support ARM mode `fmuldne d5,d5,d6'
[ALL  ]    /tmp/ccSq3fkb.s:50: Error: selected processor does not support ARM mode `flddlt d7,.L16'
[ALL  ]    /tmp/ccSq3fkb.s:51: Error: selected processor does not support ARM mode `fdivdlt d5,d7,d5'
[ALL  ]    /tmp/ccSq3fkb.s:54: Error: selected processor does not support ARM mode `fmrrd r0,r1,d5'
[ALL  ]    libgcc.mk:226: recipe for target `libgcc/./_powidf2.o' failed
[ERROR]    make[3]: *** [libgcc/./_powidf2.o] Error 1
[ALL  ]    make[4]: `crtend.o' is up to date.
[ALL  ]    make[4]: `crtbeginS.o' is up to date.
[ALL  ]    make[4]: `crtendS.o' is up to date.
[ALL  ]    make[4]: `crtbeginT.o' is up to date.
[ALL  ]    make[4]: Leaving directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/build/build-cc-core-pass-1/gcc'
[ALL  ]    make[3]: Leaving directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/build/build-cc-core-pass-1/gcc'
[ALL  ]    Makefile:1540: recipe for target `stmp-multilib' failed
[ERROR]    make[2]: *** [stmp-multilib] Error 2
[ALL  ]    rm gcc.pod
[ALL  ]    make[2]: Leaving directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/build/build-cc-core-pass-1/gcc'
[ALL  ]    Makefile:4314: recipe for target `all-gcc' failed
[ERROR]    make[1]: *** [all-gcc] Error 2
[ALL  ]    make[1]: Leaving directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/build/build-cc-core-pass-1'
[ERROR]  
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing pass-1 core C compiler'
[ERROR]  >>        called in step '(top-level)'

            

原因:

至今未知

感覺好像是版本不相容之類的問題。

解決辦法:

後來是把gcc從當前的4.2.2,換成了4.6.0,就可以避免此問題了。

詳見:

【未解決】crosstool-ng編譯arm的xscale時,編譯gcc-4.2.4時出錯:[libgcc/./_powisf2.o] Error 1,/tmp/cc7Xh6xp.s:21: Error: selected processor does not support ARM mode `fmsr s14,r0′

5.2.1.4..build/arm-xscale-linux-gnueabi/buildtools/include/cloog/ppl_backend.h:54: undefined reference to `_ppl_finalize'

錯誤現象:

cygwin下ct-ng build去編譯crosstool-ng出現:

CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng build
......
[INFO ]  =================================================================
[INFO ]  Installing pass-1 core C compiler
[EXTRA]    Configuring gcc
[EXTRA]    Building gcc
[ERROR]    make[2]: *** [cc1-dummy.exe] Error 1
[ERROR]    make[1]: *** [all-gcc] Error 2
[ERROR]
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing pass-1 core C compiler'
[ERROR]  >>        called in step '(top-level)'
......

            

對應build.log中的詳細內容為:

[ALL  ]    mv tmp-specs specs
[ALL  ]    : > tmp-libgcc.mvars
[ALL  ]    echo LIB1ASMFUNCS = '_udivsi3 _divsi3 _umodsi3 _modsi3 _bb_init_func _call_via_rX _interwork_call_via_rX _lshrdi3 _ashrdi3 _ashldi3 _arm_negdf2 _arm_addsubdf3 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 _arm_negsf2 _arm_addsubsf3 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 _arm_fixsfsi _arm_fixunssfsi _arm_floatdidf _arm_floatdisf _arm_floatundidf _arm_floatundisf _clzsi2 _clzdi2 _aeabi_lcmp _aeabi_ulcmp _aeabi_ldivmod _aeabi_uldivmod _dvmd_lnx' >> tmp-libgcc.mvars
[ALL  ]    echo LIB1ASMSRC = 'arm/lib1funcs.asm' >> tmp-libgcc.mvars
[ALL  ]    echo LIB2FUNCS_ST = '_eprintf __gcc_bcmp' >> tmp-libgcc.mvars
[ALL  ]    libbackend.a(graphite.o): In function `cloog_finalize':
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/include/cloog/ppl_backend.h:54: undefined reference to `_ppl_finalize'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o): In function `cloog_build_ppl_cstr':
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:333: undefined reference to `_ppl_new_Constraint'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:337: undefined reference to `_ppl_new_Constraint'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o): In function `cloog_translate_constraint':
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:365: undefined reference to `_ppl_new_Coefficient'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:366: undefined reference to `_ppl_new_Linear_Expression_with_dimension'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:370: undefined reference to `_ppl_assign_Coefficient_from_mpz_t'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:371: undefined reference to `_ppl_Linear_Expression_add_to_coefficient'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:376: undefined reference to `_ppl_assign_Coefficient_from_mpz_t'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:378: undefined reference to `_ppl_Linear_Expression_add_to_inhomogeneous'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:379: undefined reference to `_ppl_delete_Coefficient'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:385: undefined reference to `_ppl_delete_Linear_Expression'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o): In function `cloog_translate_constraint_matrix':
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:455: undefined reference to `_ppl_new_C_Polyhedron_from_space_dimension'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o): In function `cloog_translate_constraint_matrix_1':
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:444: undefined reference to `_ppl_Polyhedron_add_constraint'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:445: undefined reference to `_ppl_delete_Constraint'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o): In function `cloog_translate_oppose_constraint':
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:407: undefined reference to `_ppl_new_Coefficient'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:408: undefined reference to `_ppl_new_Linear_Expression_with_dimension'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:413: undefined reference to `_ppl_assign_Coefficient_from_mpz_t'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:414: undefined reference to `_ppl_Linear_Expression_add_to_coefficient'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:420: undefined reference to `_ppl_assign_Coefficient_from_mpz_t'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:421: undefined reference to `_ppl_Linear_Expression_add_to_inhomogeneous'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:422: undefined reference to `_ppl_delete_Coefficient'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:430: undefined reference to `_ppl_delete_Linear_Expression'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o): In function `cloog_initialize':
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:112: undefined reference to `_ppl_initialize'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.echo LIB2FUNCS_EXCLUDE = '' >> tmp-libgcc.mvars
[ALL  ]    build/src/cloog-ppl-0.15.11/source/ppl/domain.c:118: undefined reference to `_ppl_restore_pre_PPL_rounding'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:124: undefined reference to `_ppl_set_error_handler'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:130: undefined reference to `_ppl_io_set_variable_output_function'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o): In function `cloog_translate_ppl_polyhedron_1':
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:511: undefined reference to `_ppl_Polyhedron_get_minimized_constraints'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:512: undefined reference to `_ppl_new_Constraint_System_const_iterator'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:513: undefined reference to `_ppl_new_Constraint_System_const_iterator'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:516: undefined reference to `_ppl_Constraint_System_begin'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:517: undefined reference to `_ppl_Constraint_System_end'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:519: undefined reference to `_ppl_Constraint_System_const_iterator_increment'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:518: undefined reference to `_ppl_Constraint_System_const_iterator_equal_test'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:521: undefined reference to `_ppl_Constraint_System_const_iterator_dereference'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:522: undefined reference to `_ppl_Constraint_type'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:525: undefined reference to `_ppl_Polyhedron_space_dimension'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:540: undefined reference to `_ppl_Constraint_System_begin'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:540: undefined reference to `_ppl_Constraint_System_end'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:541: undefined reference to `_ppl_Constraint_System_const_iterator_equal_test'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:548: undefined reference to `_ppl_new_Coefficient'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:549: undefined reference to `_ppl_Constraint_System_const_iterator_dereference'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:551: undefined reference to `_ppl_Constraint_type'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:553: undefined reference to `_ppl_Constraint_type'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:557: undefined reference to `_ppl_Constraint_coefficient'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:558: undefined reference to `_ppl_Coefficient_to_mpz_t'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:566: undefined reference to `_ppl_Constraint_inhomogeneous_term'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:567: undefined reference to `_ppl_Coefficient_to_mpz_t'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:569: undefined reference to `_ppl_delete_Coefficient'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:571: undefined reference to `_ppl_Constraint_type'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:590: undefined reference to `_ppl_Constraint_type'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:542: undefined reference to `_ppl_Constraint_System_const_iterator_increment'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:552: undefined reference to `_ppl_Constraint_type'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:597: undefined reference to `_ppl_delete_Constraint_System_const_iterator'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:598: undefined reference to `_ppl_delete_Constraint_System_const_iterator'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o): In function `cloog_domain_extend':
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1842: undefined reference to `_ppl_Polyhedron_add_space_dimensions_and_embed'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1843: undefined reference to `_ppl_Polyhedron_map_space_dimensions'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1845: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o): In function `cloog_domain_project':
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1787: undefined reference to `_ppl_Polyhedron_remove_space_dimensions'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1789: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o): In function `cloog_domain_polyhedron_compare':
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1250: undefined reference to `_ppl_Polyhedron_is_empty'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1257: undefined reference to `_ppl_Polyhedron_is_empty'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1264: undefined reference to `_ppl_new_C_Polyhedron_from_C_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1265: undefined reference to `_ppl_new_C_Polyhedron_from_C_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1276: undefined reference to `_ppl_new_Coefficient_from_mpz_t'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1277: undefined reference to `_ppl_new_Linear_Expression_with_dimension'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1278: undefined reference to `_ppl_Linear_Expression_add_to_coefficient'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1279: undefined reference to `_ppl_new_Generator'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1280: undefined reference to `_ppl_Polyhedron_add_generator'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1281: undefined reference to `_ppl_Polyhedron_add_generator'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1282: undefined reference to `_ppl_delete_Generator'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1283: undefined reference to `_ppl_delete_Linear_Expression'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1284: undefined reference to `_ppl_delete_Coefficient'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1287: undefined reference to `_ppl_new_C_Polyhedron_from_C_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1288: undefined reference to `_ppl_Polyhedron_intersection_assign'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1289: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1290: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1292: undefined reference to `_ppl_Polyhedron_is_empty'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1300: undefined reference to `_ppl_new_C_Polyhedron_from_C_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1301: undefined reference to `_ppl_new_C_Polyhedron_from_C_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1302: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1303: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1305: undefined reference to `_ppl_Polyhedron_intersection_assign'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1306: undefined reference to `_ppl_Polyhedron_intersection_assign'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1311: undefined reference to `_ppl_new_C_Polyhedron_from_C_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1317: undefined reference to `_ppl_Polyhedron_add_constraint'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1318: undefined reference to `_ppl_delete_Constraint'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1330: undefined reference to `_ppl_Polyhedron_is_empty'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1339: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1340: undefined reference to `_ppl_new_C_Polyhedron_from_C_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1341: undefined reference to `_ppl_new_C_Polyhedron_from_C_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1367: undefined reference to `_ppl_Polyhedron_add_constraint'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1368: undefined reference to `_ppl_delete_Constraint'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1374: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1375: undefined reference to `_ppl_new_C_Polyhedron_from_C_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1401: undefined reference to `_ppl_Polyhedron_add_constraint'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1402: undefined reference to `_ppl_delete_Constraint'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1408: undefined reference to `_ppl_Polyhedron_is_empty'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1419: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1420: undefined reference to `_ppl_new_C_Polyhedron_from_C_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1424: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1425: undefined reference to `_ppl_new_C_Polyhedron_from_C_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1430: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1431: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1432: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1433: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1434: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o):/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1252: more undefined references to `_ppl_delete_Polyhedron' follow
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o): In function `cloog_domain_polyhedron_compare':
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1326: undefined reference to `_ppl_Polyhedron_add_constraint'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1327: undefined reference to `_ppl_delete_Constraint'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1410: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1411: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1412: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1413: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1414: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o):/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1332: more undefined references to `_ppl_delete_Polyhedron' follow
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o): In function `cloog_domain_convex':
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:813: undefined reference to `_ppl_Polyhedron_upper_bound_assign'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:814: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:820: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o): In function `cloog_pol_from_matrix':
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:641: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o): In function `cloog_domain_union':
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1064: undefined reference to `_ppl_Polyhedron_contains_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1070: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1072: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1066: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1072: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1104: undefined reference to `_ppl_Polyhedron_contains_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1110: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1112: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1106: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1112: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o): In function `cloog_domain_intersection':
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1164: undefined reference to `_ppl_Polyhedron_intersection_assign'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1166: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1168: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o): In function `cloog_domain_simplify':
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:903: undefined reference to `_ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:909: undefined reference to `_ppl_Pointset_Powerset_C_Polyhedron_add_disjunct'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:910: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:917: undefined reference to `_ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:923: undefined reference to `_ppl_Pointset_Powerset_C_Polyhedron_add_disjunct'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:924: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:929: undefined reference to `_ppl_Pointset_Powerset_C_Polyhedron_simplify_using_context_assign'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:933: undefined reference to `_ppl_new_Pointset_Powerset_C_Polyhedron_const_iterator'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:935: undefined reference to `_ppl_new_Pointset_Powerset_C_Polyhedron_const_iterator'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:936: undefined reference to `_ppl_Pointset_Powerset_C_Polyhedron_const_iterator_begin'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:937: undefined reference to `_ppl_Pointset_Powerset_C_Polyhedron_const_iterator_end'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:942: undefined reference to `_ppl_Pointset_Powerset_C_Polyhedron_const_iterator_dereference'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:939: undefined reference to `_ppl_Pointset_Powerset_C_Polyhedron_const_iterator_increment'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:938: undefined reference to `_ppl_Pointset_Powerset_C_Polyhedron_const_iterator_equal_test'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:947: undefined reference to `_ppl_delete_Pointset_Powerset_C_Polyhedron_const_iterator'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:948: undefined reference to `_ppl_delete_Pointset_Powerset_C_Polyhedron_const_iterator'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:949: undefined reference to `_ppl_delete_Pointset_Powerset_C_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:950: undefined reference to `_ppl_delete_Pointset_Powerset_C_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/lib/libcloog.a(domain.o): In function `cloog_domain_difference':
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1207: undefined reference to `_ppl_Polyhedron_add_constraint'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1208: undefined reference to `_ppl_delete_Constraint'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1210: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1217: undefined reference to `_ppl_Polyhedron_add_constraint'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1218: undefined reference to `_ppl_delete_Constraint'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/cloog-ppl-0.15.11/source/ppl/domain.c:1220: undefined reference to `_ppl_delete_Polyhedron'
[ALL  ]    collect2: ld returned 1 exit status
[ALL  ]    Makefile:1666: recipe for target `cc1-dummy.exe' failed
[ERROR]    make[2]: *** [cc1-dummy.exe] Error 1
[ALL  ]    make[2]: *** Waiting for unfinished jobs....
[ALL  ]    echo LIBGCOV = '_gcov _gcov_merge_add _gcov_merge_single _gcov_merge_delta  _gcov_fork _gcov_execl _gcov_execlp _gcov_execle  _gcov_execv _gcov_execvp _gcov_execve  _gcov_interval_profiler _gcov_pow2_profiler _gcov_one_value_profiler  _gcov_indirect_call_profiler _gcov_average_profiler _gcov_ior_profiler  _gcov_merge_ior' >> tmp-libgcc.mvars
[ALL  ]    echo LIB2ADD = '$(gcc_srcdir)/config/arm/bpabi.c $(gcc_srcdir)/config/arm/unaligned-funcs.c  $(gcc_objdir)/addsf3.c $(gcc_objdir)/divsf3.c $(gcc_objdir)/eqsf2.c $(gcc_objdir)/gesf2.c $(gcc_objdir)/lesf2.c $(gcc_objdir)/mulsf3.c $(gcc_objdir)/negsf2.c $(gcc_objdir)/subsf3.c $(gcc_objdir)/unordsf2.c $(gcc_objdir)/fixsfsi.c $(gcc_objdir)/floatsisf.c $(gcc_objdir)/floatunsisf.c $(gcc_objdir)/adddf3.c $(gcc_objdir)/divdf3.c $(gcc_objdir)/eqdf2.c $(gcc_objdir)/gedf2.c $(gcc_objdir)/ledf2.c $(gcc_objdir)/muldf3.c $(gcc_objdir)/negdf2.c $(gcc_objdir)/subdf3.c $(gcc_objdir)/unorddf2.c $(gcc_objdir)/fixdfsi.c $(gcc_objdir)/floatsidf.c $(gcc_objdir)/floatunsidf.c $(gcc_objdir)/extendsfdf2.c $(gcc_objdir)/truncdfsf2.c' >> tmp-libgcc.mvars
[ALL  ]    echo LIB2ADD_ST = '$(gcc_srcdir)/config/arm/linux-atomic.c  ' >> tmp-libgcc.mvars
[ALL  ]    echo LIB2ADDEH = '$(gcc_srcdir)/config/arm/unwind-arm.c $(gcc_srcdir)/config/arm/libunwind.S $(gcc_srcdir)/config/arm/pr-support.c $(gcc_srcdir)/unwind-c.c $(gcc_srcdir)/emutls.c  ' >> tmp-libgcc.mvars
[ALL  ]    echo LIB2ADDEHSTATIC = '$(gcc_srcdir)/config/arm/unwind-arm.c $(gcc_srcdir)/config/arm/libunwind.S $(gcc_srcdir)/config/arm/pr-support.c $(gcc_srcdir)/unwind-c.c $(gcc_srcdir)/emutls.c  ' >> tmp-libgcc.mvars
[ALL  ]    echo LIB2ADDEHSHARED = '$(gcc_srcdir)/config/arm/unwind-arm.c $(gcc_srcdir)/config/arm/libunwind.S $(gcc_srcdir)/config/arm/pr-support.c $(gcc_srcdir)/unwind-c.c $(gcc_srcdir)/emutls.c  ' >> tmp-libgcc.mvars
[ALL  ]    echo LIB2_SIDITI_CONV_FUNCS = '' >> tmp-libgcc.mvars
[ALL  ]    echo LIBUNWIND = '  ' >> tmp-libgcc.mvars
[ALL  ]    echo SHLIBUNWIND_LINK = '' >> tmp-libgcc.mvars
[ALL  ]    echo SHLIBUNWIND_INSTALL = '' >> tmp-libgcc.mvars
[ALL  ]    echo FPBIT = '' >> tmp-libgcc.mvars
[ALL  ]    echo FPBIT_FUNCS = '_pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf  _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf  _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf  _sf_to_df _sf_to_tf _thenan_sf _sf_to_usi _usi_to_sf' >> tmp-libgcc.mvars
[ALL  ]    echo LIB2_DIVMOD_FUNCS = '_divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4' >> tmp-libgcc.mvars
[ALL  ]    echo DPBIT = '' >> tmp-libgcc.mvars
[ALL  ]    echo DPBIT_FUNCS = '_pack_df _unpack_df _addsub_df _mul_df _div_df  _fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df  _lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df  _df_to_sf _df_to_tf _thenan_df _df_to_usi _usi_to_df' >> tmp-libgcc.mvars
[ALL  ]    echo TPBIT = '' >> tmp-libgcc.mvars
[ALL  ]    echo TPBIT_FUNCS = '_pack_tf _unpack_tf _addsub_tf _mul_tf _div_tf  _fpcmp_parts_tf _compare_tf _eq_tf _ne_tf _gt_tf _ge_tf  _lt_tf _le_tf _unord_tf _si_to_tf _tf_to_si _negate_tf _make_tf  _tf_to_df _tf_to_sf _thenan_tf _tf_to_usi _usi_to_tf' >> tmp-libgcc.mvars
[ALL  ]    echo DFP_ENABLE = '' >> tmp-libgcc.mvars
[ALL  ]    echo DFP_CFLAGS='' >> tmp-libgcc.mvars
[ALL  ]    echo D32PBIT='' >> tmp-libgcc.mvars
[ALL  ]    echo D32PBIT_FUNCS='_addsub_sd _div_sd _mul_sd _plus_sd _minus_sd  _eq_sd _ne_sd _lt_sd _gt_sd _le_sd _ge_sd  _sd_to_si _sd_to_di _sd_to_usi _sd_to_udi  _si_to_sd _di_to_sd _usi_to_sd _udi_to_sd  _sd_to_sf _sd_to_df _sd_to_xf _sd_to_tf  _sf_to_sd _df_to_sd _xf_to_sd _tf_to_sd  _sd_to_dd _sd_to_td _unord_sd _conv_sd' >> tmp-libgcc.mvars
[ALL  ]    echo D64PBIT='' >> tmp-libgcc.mvars
[ALL  ]    echo D64PBIT_FUNCS='_addsub_dd _div_dd _mul_dd _plus_dd _minus_dd  _eq_dd _ne_dd _lt_dd _gt_dd _le_dd _ge_dd  _dd_to_si _dd_to_di _dd_to_usi _dd_to_udi  _si_to_dd _di_to_dd _usi_to_dd _udi_to_dd  _dd_to_sf _dd_to_df _dd_to_xf _dd_to_tf  _sf_to_dd _df_to_dd _xf_to_dd _tf_to_dd  _dd_to_sd _dd_to_td _unord_dd _conv_dd' >> tmp-libgcc.mvars
[ALL  ]    echo D128PBIT='' >> tmp-libgcc.mvars
[ALL  ]    echo D128PBIT_FUNCS='_addsub_td _div_td _mul_td _plus_td _minus_td  _eq_td _ne_td _lt_td _gt_td _le_td _ge_td  _td_to_si _td_to_di _td_to_usi _td_to_udi  _si_to_td _di_to_td _usi_to_td _udi_to_td  _td_to_sf _td_to_df _td_to_xf _td_to_tf  _sf_to_td _df_to_td _xf_to_td _tf_to_td  _td_to_sd _td_to_dd _unord_td _conv_td' >> tmp-libgcc.mvars
[ALL  ]    echo GCC_EXTRA_PARTS = 'crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o' >> tmp-libgcc.mvars
[ALL  ]    echo SHLIB_LINK = '$(GCC_FOR_TARGET) -O2  -g -Os -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wold-style-definition  -isystem ./include  -fPIC -Wno-missing-prototypes  -g   -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -Dinhibit_libc -shared -nodefaultlibs  -Wl,--soname=@[email protected]  -Wl,--version-script=@shlib_map_file@  -o @multilib_dir@/@[email protected] @multilib_flags@  @shlib_objs@ @libgcc_libm@ -lc &&  rm -f @multilib_dir@/@[email protected] &&  if [ -f @multilib_dir@/@[email protected] ]; then  mv -f @multilib_dir@/@[email protected]  @multilib_dir@/@[email protected];  else true; fi &&  mv @multilib_dir@/@[email protected] @multilib_dir@/@[email protected] &&  (echo "/* GNU ld script";  echo "   Use the shared library, but some functions are only in";  echo "   the static library.  */";  echo "GROUP ( @[email protected] libgcc.a )"  ) > @multilib_dir@/@[email protected]' >> tmp-libgcc.mvars
[ALL  ]    echo SHLIB_INSTALL = '$(mkinstalldirs) $(DESTDIR)$(slibdir)@shlib_slibdir_qual@;  /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/tools/bin/install -c -m 644 @multilib_dir@/@[email protected]  $(DESTDIR)$(slibdir)@shlib_slibdir_qual@/@[email protected];  rm -f $(DESTDIR)$(slibdir)@shlib_slibdir_qual@/@[email protected];  /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/tools/bin/install -c -m 644 @multilib_dir@/@[email protected]  $(DESTDIR)$(slibdir)@shlib_slibdir_qual@/@[email protected]' >> tmp-libgcc.mvars
[ALL  ]    echo SHLIB_EXT = '.so' >> tmp-libgcc.mvars
[ALL  ]    echo SHLIB_MKMAP = '$(gcc_srcdir)/mkmap-symver.awk  ' >> tmp-libgcc.mvars
[ALL  ]    echo SHLIB_MKMAP_OPTS = '' >> tmp-libgcc.mvars
[ALL  ]    echo SHLIB_MAPFILES = '$(gcc_srcdir)/libgcc-std.ver $(gcc_srcdir)/config/libgcc-glibc.ver $(gcc_srcdir)/config/libgcc-glibc.ver $(gcc_srcdir)/config/arm/libgcc-bpabi.ver  ' >> tmp-libgcc.mvars
[ALL  ]    echo SHLIB_NM_FLAGS = '-pg' >> tmp-libgcc.mvars
[ALL  ]    echo LIBGCC2_CFLAGS = '-O2  -g -Os -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wold-style-definition  -isystem ./include  -fPIC -Wno-missing-prototypes  -g   -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -Dinhibit_libc' >> tmp-libgcc.mvars
[ALL  ]    echo TARGET_LIBGCC2_CFLAGS = '-fPIC -Wno-missing-prototypes' >> tmp-libgcc.mvars
[ALL  ]    echo LIBGCC_SYNC = '' >> tmp-libgcc.mvars
[ALL  ]    echo LIBGCC_SYNC_CFLAGS = '' >> tmp-libgcc.mvars
[ALL  ]    echo CRTSTUFF_CFLAGS = '-O2 -g -Os -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wold-style-definition  -isystem ./include  -I. -I. -I/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/gcc-4.4.6/gcc -I/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/gcc-4.4.6/gcc/.  -I/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/gcc-4.4.6/gcc/../include   -I/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/gcc-4.4.6/gcc/../libcpp/include -I/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/include -I/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/include -I/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/gcc-4.4.6/gcc/../libdecnumber -I/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/gcc-4.4.6/gcc/../libdecnumber/dpd -I../libdecnumber   -I/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/buildtools/include -DCLOOG_PPL_BACKEND   -g0  -finhibit-size-directive -fno-inline-functions -fno-exceptions  -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize  -Dinhibit_libc' >> tmp-libgcc.mvars
[ALL  ]    echo CRTSTUFF_T_CFLAGS = '' >> tmp-libgcc.mvars
[ALL  ]    echo CRTSTUFF_T_CFLAGS_S = ' -fPIC' >> tmp-libgcc.mvars
[ALL  ]    mv tmp-libgcc.mvars libgcc.mvars
[ALL  ]    rm gcc.pod
[ALL  ]    make[2]: Leaving directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/build/build-cc-core-pass-1/gcc'
[ALL  ]    Makefile:4872: recipe for target `all-gcc' failed
[ERROR]    make[1]: *** [all-gcc] Error 2
[ALL  ]    make[1]: Leaving directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/build/build-cc-core-pass-1'
[ERROR]  
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing pass-1 core C compiler'
[ERROR]  >>        called in step '(top-level)'

            

原因:

好像是之前的gcc中的cloog方面的bug

解決辦法:

最後是使用 gcc 4.6.0,可以正常編譯,可以避免此問題。

詳見:

【未解決】cygwin下編譯xscale的crosstool-ng時,gcc出錯:[cc1-dummy.exe] Error 1

5.2.1.5.Makefile:240: *** mixed implicit and normal rules. Stop.

錯誤現象:

cygwin下ct-ng build去編譯crosstool-ng出現:

CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng build
......
[INFO ]  Installing kernel headers: done in 1854.80s (at 72:22)
[EXTRA]  Saving state to restart at step 'libc_start_files'...
[INFO ]  =================================================================
[INFO ]  Installing C library headers & start files
[EXTRA]    Configuring C library
[EXTRA]    Installing C library headers
[ERROR]    make[2]: *** [manual/install-headers] Error 2
[ERROR]    make[1]: *** [install-headers] Error 2
[ERROR]
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing C library headers & start files'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR]  >>        called from: do_libc_backend_once[scripts/build/libc/glibc-eglibc.sh-common@380]
[ERROR]  >>        called from: do_libc_backend[scripts/build/libc/glibc-eglibc.sh-common@143]
[ERROR]  >>        called from: do_libc_start_files[scripts/build/libc/glibc-eglibc.sh-common@60]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@632]
......

            

對應build.log中的詳細內容為:

[ALL  ]    make[3]: Entering directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/glibc-2.9/gnulib'
[ALL  ]    make[3]: `install-headers' is up to date.
[ALL  ]    make[3]: Leaving directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/glibc-2.9/gnulib'
[ALL  ]    /usr/bin/make  subdir=wctype -C wctype ..=../ install-headers
[ALL  ]    make[3]: Entering directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/glibc-2.9/wctype'
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/tools/bin/install -c -m 644 wctype.h /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/sysroot/usr/include/wctype.h
[ALL  ]    make[3]: Leaving directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/glibc-2.9/wctype'
[ALL  ]    /usr/bin/make  subdir=manual -C manual ..=../ install-headers
[ALL  ]    make[3]: Entering directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/glibc-2.9/manual'
[ALL  ]    Makefile:240: *** mixed implicit and normal rules.  Stop.
[ALL  ]    make[3]: Leaving directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/glibc-2.9/manual'
[ALL  ]    Makefile:207: recipe for target `manual/install-headers' failed
[ERROR]    make[2]: *** [manual/install-headers] Error 2
[ALL  ]    make[2]: Leaving directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/glibc-2.9'
[ALL  ]    Makefile:12: recipe for target `install-headers' failed
[ERROR]    make[1]: *** [install-headers] Error 2
[ALL  ]    make[1]: Leaving directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/build/build-libc-startfiles'
[ERROR]  
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing C library headers & start files'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR]  >>        called from: do_libc_backend_once[scripts/build/libc/glibc-eglibc.sh-common@380]
[ERROR]  >>        called from: do_libc_backend[scripts/build/libc/glibc-eglibc.sh-common@143]
[ERROR]  >>        called from: do_libc_start_files[scripts/build/libc/glibc-eglibc.sh-common@60]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@632]

            

原因:

make是3.82的,不識別,舊的,顯示和隱式的規則混合在一起的混合規則

所以才報此錯誤。

解決辦法:

而這種makefile中混合規則,老版本的make,即3.81版本的make,是支援的。

所以,總的來說,有兩種解決辦法:

5.2.1.5.1.手動修改每個Makefile中對應的混合規則->使得3.82的make可以識別

很明顯此辦法,的確可以解決此類問題。

比如我之前這裡:

【已解決】編譯crosstool-ng在Installing kernel headers時出錯:/home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/linux-custom/Makefile:1444: *** mixed implicit and normal rules. Stop.

就是這樣手工改makefile的。

但是此辦法的缺點是:

crosstool-ng專案中,涉及到這種混合規則的Makefile中的寫法,有N多個

如果你要是每個都手動改,那就累死了。

並且需要你對Makefile的語法和規則,有足夠深入的理解,也才能確保修改為正確的寫法

所以:

此法,不適合,本身對於Makefile就不是很熟悉的,大部分的人

更好的辦法是,下面要介紹的這個第5.2.1.5.2節 “把3.82的make換成3.81版本的make”把此處3.82的make想辦法換成3.81版本的make,就可以了。

5.2.1.5.2.把3.82的make換成3.81版本的make

此法,很明顯,屬於:一勞永逸的辦法

把make換成3.81的,之前的makefile中,N多處的混合規則,就不用手動修改,即可識別,正常編譯了。

對應的,把3.82的make,換成3.81的make,其實也有兩種辦法:

5.2.1.5.2.1.把你當前的(Linux或Cygwin等)系統環境中的3.82的make換成3.81的make

此法,也是我之前,在Cygwin中折騰crosstool-ng時,去嘗試過的:

【已解決】Cygwin下配置Linux核心出錯:Makefile:419: *** mixed implicit and normal rules. Stop.

但是很明顯,此法,代價太大:

使得整個系統中的make,都從3.82降級到3.81了。

總的來說,也不算好事。

並且,像是Cygwin中,去更換某個版本的軟體包的話,相對來說,還比較麻煩。

而Linux系統,比如Ubuntu中,如果你用的源中沒有3.81的make的話,還涉及到先換源

總之,就是很麻煩。

所以,一般來說,都還是用下面介紹的這個更好的辦法:

第5.2.1.5.2.2節 “用crosstool-ng中提供的3.81的make(而不用更換系統環境中的3.82的make)”

5.2.1.5.2.2.用crosstool-ng中提供的3.81的make(而不用更換系統環境中的3.82的make)

最終,後來通過:

【已解決】crosstool-ng在Installing C library headers & start files期間出錯:Makefile:240: *** mixed implicit and normal rules. Stop.

而去通過更改crosstool-ng中的配置,得以實現:

直接使用crosstool-ng中提供的那個3.81的make

而實現:

不僅解決了此處的問題:

Makefile:xxx: *** mixed implicit and normal rules. Stop.

而且,無需更改當前系統的3.82的make

也無需去手動更改出錯的每一個makefile了。

對應的做法是:

ct-ng menuconfig

去如下配置:

Paths and misc options  —>
    [*] Try features marked as EXPERIMENTAL
Companion tools  —>
    [*] Build some companion tools
    [*]   make

                    

Try features marked as EXPERIMENTAL對應的help幫助內容為:

  ┌───────────────────────── Try features marked as EXPERIMENTAL ─────────────────────────┐
  │ CT_EXPERIMENTAL:                                                                      │
  │                                                                                       │
  │ If you set this to Y, then you will be able to try very experimental                  │
  │ features.                                                                             │
  │                                                                                       │
  │ Experimental features can be one of:                                                  │
  │   - working, in which case you should tell me it is!                                  │
  │   - buggy, in which case you could try patching and send me the result                │
  │   - unfinished, in which case you could try hacking it and send me the result         │
  │   - non-existant, in which case you could also try hacking it in and send me          │
  │     the result                                                                        │
  │                                                                                       │
  │ Symbol: EXPERIMENTAL [=y]                                                             │
  │ Type  : boolean                                                                       │
  │ Prompt: Try features marked as EXPERIMENTAL                                           │
  │   Defined at config/global/ct-behave.in:18                                            │
  │   Location:                                                                           │
  │     -> Paths and misc options                                                         │

                    

以及:

Build some companion tools對應的help幫助內容為:

  ┌───────────────────────────── Build some companion tools ──────────────────────────────┐
  │ CT_COMP_TOOLS:                                                                        │
  │                                                                                       │
  │ Crosstool-NG relies on some external tools to be recent enough, namely:               │
  │   make = 3.81 (in some cases)                                                         │
  │   m4 >= 1.4.12                                                                        │
  │   autoconf >= 2.63                                                                    │
  │   automake >= 1.10.2                                                                  │
  │   libtool >= 2.2.4                                                                    │
  │                                                                                       │
  │ If your system has older versions, we can build them for you,                         │
  │ but you are strongly encouraged to update your system instead!                        │
  │                                                                                       │
  │ Symbol: COMP_TOOLS [=y]                                                               │
  │ Type  : boolean                                                                       │
  │ Prompt: Build some companion tools                                                    │
  │   Defined at config/companion_tools.in:8                                              │
  │   Depends on: EXPERIMENTAL [=y]                                                       │
  │   Location:                                                                           │
  │     -> Companion tools                                                                │

                    

如此,再去繼續重新編譯,可以看到對應的編譯輸出資訊:

[EXTRA]    Extracting ‘make-3.81′
[EXTRA]    Patching ‘make-3.81′
[EXTRA]    =================================================================
[EXTRA]    Installing make
[02:14] |

                    

即,去下載並編譯對應的3.81的make,供後續使用了。

至此,才算是比較完美的解決此處的問題。

詳見:

【未解決】crosstool-ng編譯arm的xscale時,編譯gcc-4.2.4時出錯:[libgcc/./_powisf2.o] Error 1,/tmp/cc7Xh6xp.s:21: Error: selected processor does not support ARM mode `fmsr s14,r0′

5.2.2.Cygwin下編譯crosstool-ng常見錯誤及解決辦法

此處是,在Cygwin下才會出現的一些,關於編譯crosstol-ng時遇到的問題和解決辦法:

5.2.2.1.Cygwin下編譯crosstool-ng時導致記憶體洩露

我之前在:

Win7 x64 + Cygwin 1.7.24

下,去編譯crosstool-ng:

【記錄】重試使用最新版本1.18.0的crosstool-ng去配置和編譯xscale的交叉編譯器

結果,期間出現多次的:

Cannot allocate memory 

詳見:

【未解決】crosstool-ng編譯出錯:Installing C library headers中的make[3]: xxx/sys-root/usr/include/sys/uio.h] Error 1

【未解決】crosstool-ng編譯出錯:gcc-4.2.2/gcc/regrename.c:1646:12: error: ‘IFCVT_ALLOW_MODIFY_TEST_IN_INSN’ undeclared (first use in this function)

【未解決】firefox的CPU佔用率太高而多次崩潰

【未解決】cygwin下編譯xscale的crosstool-ng時,gcc出錯:[cc1-dummy.exe] Error 1

最終,而推測出的:

【未解決】用cygwin編譯crosstool-ng,好像有記憶體洩露(memory leak)

但是,截止現在,其實也不完全確定:

到底是cygwin中的(比如ld)有bug

還是crosstool-ng對於此處的cygwin不太相容?

而導致的此處的記憶體洩露,記憶體被消耗光的問題。

不過,和此對比的是:

後來又去Ubuntu 13.04中,去編譯crosstool-ng:

【記錄】Ubuntu下用crosstool-ng為xscale建立交叉編譯器arm-xscale-linux-gnueabi-gcc

確定,是沒有出現記憶體佔用極高,而導致記憶體不夠的問題。

所以,此處截止目前的結論是:

此處在Win7 x64 + Cygwin 1.7.24,去編譯crosstool-ng,出現了記憶體佔用極高

而導致系統卡死,無法繼續編譯

應該就是:記憶體洩露

但是原因,到底是cygwin本身的問題,還是crosstool-ng不太相容cygwin

至今仍未知。

已知的是:crosstool-ng在Ubuntu 13.04中,編譯是很順利的,不會出現此記憶體洩露的現象。

5.2.2.2.Your file system in ‘xxx/targets’ is *not* case-sensitive!

錯誤現象:

cygwin下ct-ng build去編譯crosstool-ng出現:

[ERROR]  Your file system in ‘/home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets’ is *not* case-sensitive! 

            

原因:

windows系統預設是大小寫不分的

而crosstool-ng,一般是在Linux類系統中執行的,是區分大小寫的

比如兩個檔案檔名的字元可能相同,但是大小寫不同,就是兩個不同檔案

而如果Windows中不區分大小寫,那麼就會導致檔案衝突。

所以此處報錯,說你的環境是不區分大小寫的。

解決辦法:

Windows下,修改登錄檔:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel\obcaseinsensitive

            

將值從1改為0。

詳見:【已解決】cygwin下crosstool去build出錯:Performing some trivial sanity checks,Your file system in xxx is *not* case-sensitive!

已managed的方式掛載cygwin好像也可以解決此問題

對於此問題,之前好像在某處看到說是

以managed的方式去mount cygwin,好像也是可以解決此問題的

目前沒去深入研究,只是聽說。供參考。

5.2.3.Linux下編譯crosstool-ng常見錯誤及解決辦法

此處是,在Linux類系統下才會出現的一些,關於編譯crosstol-ng時遇到的問題和解決辦法:

5.2.3.1.gcc-4.2.2/gcc/regrename.c:1646:12: error: ‘IFCVT_ALLOW_MODIFY_TEST_IN_INSN’ undeclared (first use in this function)

錯誤現象:

cygwin下ct-ng build去編譯crosstool-ng出現:

CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng build
[INFO ]  Performing some trivial sanity checks
......
[INFO ]  =================================================================
[INFO ]  Installing pass-1 core C compiler
[EXTRA]    Configuring gcc
[EXTRA]    Building gcc
[ERROR]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/gcc-4.2.2/gcc/regrename.c:1646:12: error: 'IFCVT_ALLOW_MODIFY_TEST_IN_INSN' undeclared (first use in this function)
[ERROR]    make[2]: *** [regrename.o] Error 1
[ERROR]    make[1]: *** [all-gcc] Error 2
...

            

原因:

暫未清楚深層次的原因。

解決辦法:

去修改對應的檔案:

crosstool-ng-1.18.0_build\.build\src\gcc-4.2.2\gcc\regrename.c

去註釋掉對應的程式碼,變成:

      /* Added for targets (AVR32) which supports test operands to be modified
         in cond_exec instruction. For these targets we cannot make a change to
         the test operands if one of the test operands is an output operand This beacuse
         changing the test operands might cause the need for inserting a new test
         insns in the middle of a sequence of cond_exec insns and if the test operands
         are modified these tests will fail.
      */
      
      // if ( IFCVT_ALLOW_MODIFY_TEST_IN_INSN
           // && predicated )
        // { 
          // int insn_skipped = 0;
          // rtx test = COND_EXEC_TEST (PATTERN (insn));

          // /* Check if the previous insn was a skipped predicated insn with the same
             // test as this predicated insns. If so we cannot do any modification to
             // this insn either since we cannot emit the test insn because the operands
             // are clobbered. */
          // if ( prev_pred_insn_skipped 
               // && (rtx_equal_p (test, prev_pred_test) 
                   // || rtx_equal_p (test, reversed_condition (prev_pred_test))) )
            // { 
              // insn_skipped = 1;
            // }
          // else
            // {
              // /* Check if the output operand is used in the test expression. */
              // for (i = 0; i < n_ops; ++i)
                // if ( recog_data.operand_type[i] == OP_INOUT 
                     // && reg_mentioned_p (recog_data.operand[i], test) )
                  // {
                    // insn_skipped = 1;
                    // break;
                  // }
              
            // }
          
          // prev_pred_test = test;
          // prev_pred_insn_skipped = insn_skipped;
          // if ( insn_skipped )
            // {
              // if (insn == BB_END (bb))
                // break;
              // else
                // continue;
            // }
        // } 
      // else 
        // {
          // prev_pred_insn_skipped = 0;
        // }

            

即可。

詳見:【未解決】crosstool-ng編譯出錯:gcc-4.2.2/gcc/regrename.c:1646:12: error: ‘IFCVT_ALLOW_MODIFY_TEST_IN_INSN’ undeclared (first use in this function)

第6章與crosstool-ng相關的一些事項

目錄

6.1. crosstool-ng的作者的主頁
6.2. crosstool-ng支援Linaro的gcc
6.3. Buildroot支援crosstool-ng

相關舊帖:【總結】crosstool-ng使用心得和注意事項

6.1.crosstool-ng的作者的主頁

後來無意間發現,其實crosstool-ng的作者Yann E. MORIN,簡稱ymorin,其有個主頁的:http://ymorin.is-a-geek.org/

其中,很容易看出:ymorin.is-a-geek,即:ymorin is a geek,翻譯為中文即為:ymorin是個極客,即技術上比較能折騰的傢伙,^_^

然後,對應該主頁中,有此crosstool-ng的主頁連結:http://crosstool-ng.org/

然後也可以看到,其也參考了別的一些專案的,比如:BusyBox中的modprobe。

6.2.crosstool-ng支援Linaro的gcc

Linaro,是一個組織,其維護了一堆的基礎庫等內容,方便其他人使用。包括Ubuntu等Linux的發行版,Android等等。

其所維護的東西,除了基礎的gcc庫等常見內容之外,還包括此crosstool-ng。

關於如何在crosstool-ng中,使用linaro的gcc,可參考:

Linaro版本的gcc

和:

crosstool-NG in Linaro

6.3.Buildroot支援crosstool-ng

Buildroot,預設是使用自己的交叉編譯器,去製作整個Linux系統,包括編譯kernel,編譯uboot,製作rootfs的。

而最新的Buildroot,已經支援,使用第三方的交叉編譯器,去製作整個Linux系統。

其中,就已經支援了,用crosstool-ng的交叉編譯器。

詳見Buildroot中的配置說明:

Buildroot

參考書目

[1]crosstool

[2]crosstool-ng

[3]Refering to crosstool-NG

[4]Using a released version

[5]crosstool-NG: Download and usage

[6]http://ymorin.is-a-geek.org/

[7]crosstool-NG in Linaro

[8]BusyBox

[9]Cygwin下用crosstool-ng 編譯交叉工具鏈

[10]【總結】crosstool-ng使用心得和注意事項

[11]交叉編譯詳解

[12]藉助別人的工具去製作交叉編譯器

[13]crosstool

[14]【整理】make config,make menuconfig,make oldconfig,make xconfig,make defconfig,make gconfig

[15]軟體開發基礎之linux下安裝某個軟體的邏輯和過程

[16]【記錄】在Cygwin下編譯gcc-3.4.5-glibc-2.3.6的arm-xscale-linux-gnu交叉編譯器

[17]【未解決】crosstool-ng編譯出錯:Installing C library headers中的make[3]: xxx/sys-root/usr/include/sys/uio.h] Error 1

[18]【記錄】重試使用最新版本1.18.0的crosstool-ng去配置和編譯xscale的交叉編譯器

[19]【已解決】total commander裡面的檔名是中文加數字而無法正常排序

[20]【記錄】在Ubuntu下用crosstool-ng編譯xscale的交叉工具鏈

[21]【已解決】Cygwin中安裝完crosstool-ng後,執行ct-ng help出錯:bash: ct-ng: command not found

[22]【記錄】Cygwin下為arm920t配置crosstool-ng

[23]【整理】Linux下的make命令使用心得

[24]【已解決】crosstool-ng在Installing C library headers & start files期間出錯:Makefile:240: *** mixed implicit and normal rules. Stop.

[25]【記錄】crosstool為xscale編譯(ct-ng build)過程

[26]【已解決】Ubuntu中crosstool-ng編譯出錯:scripts/unifdef.c:209:25: error: conflicting types for ‘getline’

[27]【記錄】為arm的xscale配置crosstool-ng

[28]【整理】crosstool中的Architecture level(CT_ARCH_ARCH),Emit assembly for CPU(CT_ARCH_CPU),Tune for CPU(CT_ARCH_TUNE)的值,對於arm的xscale應該是填寫什麼

[29]【整理】crosstool-ng中的Architecture level,Emit assembly for CPU,Tune for CPU對於TQ2440的S3C2440的ARM920T填寫何值

[30]crosstool-ng中交叉編譯字首的命名規則

[31]大端(Big Endian)與小端(Little Endian)詳解

[32]【整理】crosstool中Target CFLAGS引數的含義和如何設定

[33]Cygwin詳解

[34]【已解決】Ubuntu中用sudo apt-get install安裝某軟體,結果出錯:E: Unable to locate package makeinfo

[35]【已解決】Ubuntu下去配置crosstool-ng時出現:configure: error: could not find GNU libtool >= 1.5.26

[36]【已解決】cygwin下crosstool去build出錯:Performing some trivial sanity checks,Your file system in xxx is *not* case-sensitive!

[37]Buildroot

[38]【整理】Linaro簡介

[39]【整理】crosstool和crosstool-ng