日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當前位置:首頁 > 芯聞號 > 充電吧
[導(dǎo)讀]具體內(nèi)容: ?首先需要安裝macports安裝完成后我們使用命令:callondeMacBook-Pro:~?callon$?sudo?port?install?libelf Password: Er


具體內(nèi)容: ?
首先需要安裝macports
安裝完成后我們使用命令:

callondeMacBook-Pro:~?callon$?sudo?port?install?libelf
Password:
Error:?Port?libelf?not?found

居然是沒有找到,原因是我們需要更新macports:

callondeMacBook-Pro:~?callon$?sudo?port?-v?selfupdate
--->??Updating?MacPorts?base?sources?using?rsync
receiving?file?list?...?done
base.tar

sent?31276?bytes??received?223560?bytes??8090.03?bytes/sec
total?size?is?27013120??speedup?is?106.00
receiving?file?list?...?done

--->??MacPorts?base?is?already?the?latest?version

The?ports?tree?has?been?updated.?To?upgrade?your?installed?ports,?you?should?run
??port?upgrade?outdated
callondeMacBook-Pro:~?callon$?
callondeMacBook-Pro:~?callon$?sudo?port?upgrade?outdated
Password:
Nothing?to?upgrade.
callondeMacBook-Pro:~?callon$?sudo?port?search?libelf
libelf?@0.8.13_2?(devel)
????ELF?object?file?access?library

py-pylibelf?@0.1.20110915?(python,?devel)
????Pythonic?wrapper?for?the?libelf?library.

py27-pylibelf?@0.1.20110915?(python,?devel)
????Pythonic?wrapper?for?the?libelf?library.

Found?3?ports.

此時就說明我們可以正常使用macports安裝軟件了,下面開始正式操作:

callondeMacBook-Pro:~?callon$?sudo?port?install?libelf

出現(xiàn):

--->??Installing?libelf?@0.8.13_2
--->??Activating?libelf?@0.8.13_2
--->??Cleaning?libelf
--->??Updating?database?of?binaries
--->??Scanning?binaries?for?linking?errors???????????????
--->??No?broken?files?found.

即為安裝成功。
同理:

callondeMacBook-Pro:~?callon$?sudo?port?install?gsed
callondeMacBook-Pro:~?callon$?sudo?port?install?arm-elf-binutils
callondeMacBook-Pro:~?callon$?sudo?port?install?arm-elf-gcc

此時我們的裸機編譯環(huán)境其實就搭建好了,但是我們需要把裸機makefile的所有之前用的arm-linux-xxx換成現(xiàn)在的arm-elf-xxx即可!

callondeMacBook-Pro:hkl-continue?callon$?make?clean
rm?-f?*.o?*.elf?*.bin
make?-C?dev?clean
rm?-f?*.o???????
make?-C?lib?clean
rm?-f?*.o???????
callondeMacBook-Pro:hkl-continue?callon$?make
arm-elf-gcc?-g?-c?start.S
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?main.c
make?-C?dev?all
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?mmu.c
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?interrupt.c
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?gpio.c
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?uart.c
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?nandflash.c
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?lcd.c
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?dma.c
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?bmp.c
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?bmpp.c
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?timer.c
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?touch.c
arm-elf-ld?-r?-o?dev.o?mmu.o?interrupt.o?gpio.o?uart.o?nandflash.o?lcd.o?dma.o?bmp.o?bmpp.o?timer.o?touch.o
arm-elf-gcc?-g?-c?mem.S
make?-C?lib?all
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?div64.S
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?lib1funcs.S
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?ctype.c
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?muldi3.c
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?printf.c
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?string.c
arm-elf-gcc?-g?-fno-builtin?-I/Users/callon/Desktop/hkl-continue/include?-c?vsprintf.c
arm-elf-ld?-r?-o?lib.o?div64.o?lib1funcs.o?ctype.o?muldi3.o?printf.o?string.o?vsprintf.o
arm-elf-ld?-Thkl.lds?-o?hkl_boot.elf?start.o?main.o?dev/dev.o?mem.o?lib/lib.o
arm-elf-objcopy?-O?binary?hkl_boot.elf?hkl_boot.bin
arm-elf-objdump?-D?-S?hkl_boot.elf?>?dump
callondeMacBook-Pro:hkl-continue?callon$?ls
Makefile????hkl.lds?????include?????main.o??????start.S
dev?????hkl_boot.bin????lib?????mem.S???????start.S~
dump????????hkl_boot.elf????main.c??????mem.o???????start.o

同樣的嘗試了安裝arm-none-eabi-工具鏈,也能編譯裸機代碼:

callondeMacBook-Pro:s3c-linux-2.6.28.6-Real6410?callon$?sudo?port?install?arm-none-eabi-gcc

但是編譯不了內(nèi)核,總會出現(xiàn)莫名其妙的問題。

***最后現(xiàn)象總結(jié):***
arm-none-eabi- 能夠編譯內(nèi)核模塊,能夠編譯裸機代碼,但是在編譯應(yīng)用程序會出錯:

callondeMacBook-Pro:key_irq_misc?callon$?arm-none-eabi-gcc?-static?key_app.c?-o?key_app
key_app.c:?在函數(shù)‘main’中:
key_app.c:9:8:?警告:隱式聲明函數(shù)‘open’?[-Wimplicit-function-declaration]
???fd?=?open("/dev/6410key",0);
????????^
key_app.c:11:3:?警告:隱式聲明函數(shù)‘read’?[-Wimplicit-function-declaration]
???read(fd,?&key_num,?4);
???^
key_app.c:15:3:?警告:隱式聲明函數(shù)‘close’?[-Wimplicit-function-declaration]
???close(fd);
???^
/opt/local/lib/gcc/arm-none-eabi/5.1.0/../../../../arm-none-eabi/bin/ld:?cannot?find?crt0.o:?No?such?file?or?directory
collect2:?錯誤:ld?返回?1

arm-elf- 能夠編譯出應(yīng)用程序和裸機代碼:

callondeMacBook-Pro:key_irq_misc?callon$?arm-elf-gcc?-static?key_app.c?-o?key_app
callondeMacBook-Pro:key_irq_misc?callon$?ls

但是編譯不了內(nèi)核模塊:

callondeMacBook-Pro:key_irq_misc?callon$?make
make?-C?/Users/callon/Documents/s3c-linux-2.6.28.6-Real6410?M=/Users/callon/Desktop/key_irq_misc?modules?CROSS_COMPILE=arm-elf-?ARCH=arm
??CC?[M]??/Users/callon/Desktop/key_irq_misc/key.o
/Users/callon/Desktop/key_irq_misc/key.c:1:0:?error:?FPA?is?unsupported?in?the?AAPCS
make[2]:?***?[/Users/callon/Desktop/key_irq_misc/key.o]?Error?1
make[1]:?***?[_module_/Users/callon/Desktop/key_irq_misc]?Error?2
make:?***?[all]?Error?2

最后還有一種交叉編譯工具:
參考http://blog.csdn.net/rk2900/article/details/8738442

新建一個磁盤映像:
磁盤工具->文件->新建映像->空白映像

有時你的磁盤映像還是不區(qū)分大小寫,你可以在磁盤映像下建立兩個readme和Readme文件夾來測試,如果的確還是不區(qū)分,就磁盤工具選擇:磁盤映像->抹掉

再操作一次就完全正確了,你可以進行測試。
然后將下載好的ARMx-2009q3-67.tar.bz2,鏈接在參考的blog中有提到,這里再啰嗦一下:
https://github.com/downloads/UnhandledException/ARMx/ARMx-2009q3-67.tar.bz2
拷貝到磁盤映像下,執(zhí)行命令:

最后修改/etc/profile把path環(huán)境變量修改了,然后source /etc/profile即可!

最后修改內(nèi)核代碼中.config或者Makefile里對CROSS_COMPILE的定義,改成arm-none-linux-gnueabi-即可,此時就可以進行內(nèi)核代碼編譯了:


編譯完內(nèi)核再編譯內(nèi)核模塊也就不會有莫名其妙的問題了:

成功!
但是裸機代碼拿arm-none-linux-gnueabi- 編譯會有問題。

此博文得到的結(jié)論均為實踐與查找資料所得,僅供參考。

本站聲明: 本文章由作者或相關(guān)機構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點,本站亦不保證或承諾內(nèi)容真實性等。需要轉(zhuǎn)載請聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請及時聯(lián)系本站刪除( 郵箱:macysun@21ic.com )。
換一批
延伸閱讀
關(guān)閉