2015-09-09 20 views
2

我在2008年前後繼承了一個在SUSE linux環境下構建的powerpc項目。我的目標是在Linux Mint(v 17)中構建相同的東西。我相信目標處理器是一個powerpc,它在環境變量中設置。在關於薄荷Linux的構建,它產生以下錯誤:在gcc powerpc中使用-meabi選項編譯

[email protected] ~/temp/linux.apps $ make -f Makefile.runme 
make DESTDIR=`pwd`/tmp install 
make[1]: Entering directory `/home/developer/temp/linux.apps' 
Making install in libStreamerControl 
make[2]: Entering directory `/home/developer/temp/linux.apps/libStreamerControl' 
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../include -I../include -ffixed-r14 -meabi -fno-builtin -std=gnu99 -Wall -g -O2 -MT streamerControl.lo -MD -MP -MF .deps/streamerControl.Tpo -c -o streamerControl.lo streamerControl.c 
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I../include -I../include -ffixed-r14 -meabi -fno-builtin -std=gnu99 -Wall -g -O2 -MT streamerControl.lo -MD -MP -MF .deps/streamerControl.Tpo -c streamerControl.c -o streamerControl.o 
gcc: error: unrecognized command line option '-meabi' 
make[2]: *** [streamerControl.lo] Error 1 
... 

據抱怨-meabi選項。我已經安裝/更新了一些可能相關的軟件包(eldk-5.6,automake,libtool和powerpc-linux-gnu-gcc 4.8.2的更新版本)。

具體來說,我想知道關於-meabi選項。我沒有發現很多。什麼可能導致編譯器不知道它是什麼?我看到SUSE安裝程序的輸出版本,它處理好了-meabi選項。有什麼建議麼? 謝謝, 將

+0

嗨 - 我想我已經找到了一部分難題:編譯使用gcc而不是ppc-linux-gcc編譯powerpc。我假設-meabi是powerpc家族特有的東西。無論如何,現在我將着重討論爲什麼構建忽略了我的環境變量:'ARCH = powerpc''''' CROSS_COMPILE = ppc-linux-' – WillK

回答

0

從您的評論,這聽起來像你在這裏交叉編譯(即,你的構建架構不同於你的主機架構)。在這種情況下,你的(構建)gcc不會識別-meabi,因爲它只對主機gcc有效。

所以,你需要使用正確的編譯器來建立你的項目才能工作。執行此操作的方法將取決於項目中的makefile。你已經提到了ARCHCROSS_COMPILE,但是這些變量是特定於Linux內核的構建系統的。

在猜測,你可能makefile文件使用一些相當標準的變量來控制編譯器工具鏈&的選擇,喜歡CCLD等嘗試類似:

make -f Makefile.runme CC=powerpc-linux-gnu-gcc LD=powerpc-linux-gnu-ld 

如果你的編譯仍然失敗,你可能需要提供您的Makefiles的來源(或鏈接)。