2012-08-31 97 views
1

我試圖在我的Macbook Pro上構建SGABIOS。不幸的是,我收到了一些我不熟悉的奇怪的編譯錯誤。當我試圖運行make,這裏是輸出我得到:SGABIOS彙編錯誤

Ajax-2:sgabios-read-only dash$ make 
rm -f .depend 
cc -E -M -Wall -Os -m32 -nostdlib sgabios.S >.tmpdepend && mv .tmpdepend .depend 
make clean 
rm -f sgabios.bin csum8 sgabios.o *.elf *.srec *.com version.h 
touch sgabios.S 
cc -Wall -Os -m32 -nostdlib -DBUILD_DATE="\"Fri Aug 31 19:10:03 UTC 2012\"" -DBUILD_SHORT_DATE="\"08/31/12\"" -DBUILD_HOST="\"Ajax-2.local\"" -DBUILD_USER="\"dash\"" -c -o sgabios.o sgabios.S 
sgabios.S:24:Unknown pseudo-op: .type 
sgabios.S:24:Rest of line ignored. 1st junk character valued 95 (_). 
sgabios.S:30:Unknown pseudo-op: .size 
sgabios.S:30:Rest of line ignored. 1st junk character valued 95 (_). 
sgabios.S:33:Unknown pseudo-op: .type 
sgabios.S:33:Rest of line ignored. 1st junk character valued 108 (l). 
sgabios.S:156:Alignment too large: 15. assumed. 
make: *** [sgabios.o] Error 1 

我GCC版本信息如下:

Ajax-2:sgabios-read-only dash$ gcc -v 
Using built-in specs. 
Target: i686-apple-darwin11 
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1 
Thread model: posix 
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00) 

我已經做了廣泛的谷歌搜索和胡鬧和似乎沒有任何工作。我也嘗試了cygwin的整個混亂,並且我得到了幾乎相同的東西。供大家參考,我已上載從最新發布的一些文件:

sgabios.S

sgabios.h

Makefile

更新:Cygwin中化妝的發佈輸出:

[email protected]_virtual ~/sgabios-read-only 
$ make 
rm -f .depend 
cc -E -M -Wall -Os -m32 -nostdlib sgabios.S >.tmpdepend && mv .tmpdepend .depen         d 
make clean 
make[1]: Entering directory `/home/dash/sgabios-read-only' 
rm -f sgabios.bin csum8 sgabios.o *.elf *.srec *.com version.h 
make[1]: Leaving directory `/home/dash/sgabios-read-only' 
touch sgabios.S 
cc -Wall -Os -m32 -nostdlib -DBUILD_DATE="\"Fri, Aug 31, 2012 10:14:21 PM\"" -DB         UILD_SHORT_DATE="\"08/31/12\"" -DBUILD_HOST="\"Ajax_virtual\"" -DBUILD_USER="\"d         ash\"" -c -o sgabios.o sgabios.S 
sgabios.S: Assembler messages: 
sgabios.S:22: Error: junk at end of line, first unrecognized character is `"' 
sgabios.S:24: Warning: .type pseudo-op used outside of .def/.endef ignored. 
sgabios.S:24: Error: junk at end of line, first unrecognized character is `_' 
sgabios.S:30: Warning: .size pseudo-op used outside of .def/.endef ignored. 
sgabios.S:30: Error: junk at end of line, first unrecognized character is `_' 
sgabios.S:33: Warning: .type pseudo-op used outside of .def/.endef ignored. 
sgabios.S:33: Error: junk at end of line, first unrecognized character is `l' 
<builtin>: recipe for target `sgabios.o' failed 
make: *** [sgabios.o] Error 1 
+0

運行'make CC =「cc -v」'來顯示彙編程序的實際調用併發布 –

回答

2

這是因爲彙編程序文件寫成了f或GNU as,但OS X不使用它,而是使用它自己的彙編程序。

此外,根據documentation on the .type directive GNU指令的含義取決於目標平臺。鏈接文件中的指令僅對在Linux(和其他單元)上使用的ELF目標有效,但cygwin是COFF目標。

+0

感謝您的迴應。我也嘗試過使用cygwin,並獲得了幾乎相同的結果,我在上面發佈了更新。 – Eicos

+0

謝謝。我認爲讓我這樣做的最簡單的方法就是讓Ubuntu運行在Virtualbox上並從那裏嘗試。 – Eicos

+0

工作就像一個魅力! – Eicos