![](/img/trans.png)
[英]Cross compiling static C hello world for Android using arm-linux-gnueabi-gcc
[英]Flag for cross-compiling for ARMv6l with arm-linux-gnueabi-gcc
我很難用C交叉編譯一個簡單的HelloWorld。主機是Ubuntu X86_64,目標是運行Linux內核2.6.21.7的ARMv6兼容處理器rev 7(v6l)。
如果我嘗試:
arm-linux-gnueabi-gcc -static -march=armv6 hello.c -o hello
我在目標上出現細分錯誤。 文件命令輸出為:
hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.31, BuildID[sha1]=0x0c77ad13c58160eab9dcbf2feeeaf4d27a4319cb, not stripped
我在GCC文檔中沒有看到任何“ armv6l”標志。 是否可以使用GCC對這種體系結構進行交叉編譯?
它與Sourcery一起使用: https ://sourcery.mentor.com/sgpp/lite/arm/portal/release2029
安裝后,我必須重新啟動計算機,然后使用以下命令編譯良好:
arm-none-linux-gnueabi-gcc -o hello -static hello.c
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.