我有关于交叉编译的问题。
#include <stdio.h>
int main()
{
printf("hello\n");
return 0;
}
这是我使用的一个简单的hello world代码。
我正在使用从导师图形下载的arm-none-eabi-g ++。这是错误。我不知道会错过什么lib。
/home/kang/Utils/arm-2013.05/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld: warning: cannot find entry symbol _start; defaulting to 00008018
/home/kang/Utils/arm-2013.05/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/libc.a(lib_a-abort.o): In function `abort':
abort.c:(.text+0x10): undefined reference to `_exit'
/home/kang/Utils/arm-2013.05/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/libc.a(lib_a-signalr.o): In function `_kill_r':
signalr.c:(.text+0x1c): undefined reference to `_kill'
/home/kang/Utils/arm-2013.05/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/libc.a(lib_a-signalr.o): In function `_getpid_r':
signalr.c:(.text+0x44): undefined reference to `_getpid'
/home/kang/Utils/arm-2013.05/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text+0x18): undefined reference to `_sbrk'
/home/kang/Utils/arm-2013.05/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/libc.a(lib_a-writer.o): In function `_write_r':
writer.c:(.text+0x20): undefined reference to `_write'
/home/kang/Utils/arm-2013.05/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/libc.a(lib_a-closer.o): In function `_close_r':
closer.c:(.text+0x18): undefined reference to `_close'
/home/kang/Utils/arm-2013.05/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/libc.a(lib_a-fstatr.o): In function `_fstat_r':
fstatr.c:(.text+0x1c): undefined reference to `_fstat'
/home/kang/Utils/arm-2013.05/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/libc.a(lib_a-isattyr.o): In function `_isatty_r':
isattyr.c:(.text+0x18): undefined reference to `_isatty'
/home/kang/Utils/arm-2013.05/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/libc.a(lib_a-lseekr.o): In function `_lseek_r':
lseekr.c:(.text+0x20): undefined reference to `_lseek'
/home/kang/Utils/arm-2013.05/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/libc.a(lib_a-readr.o): In function `_read_r':
readr.c:(.text+0x20): undefined reference to `_read'
collect2: error: ld returned 1 exit status
这是编译器版本。
$ arm-linux-gnueabi-g ++ -v
使用内置规格。COLLECT_GCC = / home / kang / Utils / arm-2013.05 / bin / arm-none-
eabi-g COLLECT_LTO_WRAPPER = / home / kang / Utils / arm-2013.05 / bin
/../ libexec / gcc / arm-none-eabi / 4.7.3 / lto-wrapper目标:arm-none-
eabi配置为:/scratch/jbrown/2013.05-arm-eabi-
release/src/gcc-4.7-2013.05/configure –build = i686-pc-linux-gnu –host =
i686-pc-linux-gnu –target = arm-none-eabi –enable-threads –disable-
libmudflap –disable-libssp –disable-libstdcxx-pch –enable-extra-sgxxlite-
multilibs –with-gnu-as –with-gnu-ld –with-specs =’%{保存温度:-fverbose-asm}
-D__CS_SOURCERYGXX_MAJ = 2013 -D__CS_SOURCERYGXX_MIN = 5
-D__CS_SOURCERYGXX_REV __ = 23%{O2:% {!fno-remove-local-statics:-fremove-
local-statics}}%{O *:%{O | O0 | O1 | O2 | Os:;:%{!fno-remove-local-
statics:-fremove -local-statics}}}’–enable-languages =
c,https://sourcery.mentor.com/GNUToolchain/--disable-
nls –prefix = / opt / codesourcery –with-headers =是–with-sysroot = / opt
/ codesourcery / arm-none-eabi –with-build-sysroot = / scratch / jbrown /
2013.05 -arm-eabi-release / install / arm-none-eabi –with-gmp = / scratch /
jbrown / 2013.05-arm-eabi-release / obj / pkg-2013.05-23-arm-none-eabi /
arm-2013.05 -23-arm-none-eabi.extras / host-libs-i686-pc-linux-gnu / usr
–with-mpfr = / scratch / jbrown / 2013.05-arm-eabi-release / obj /
pkg-2013.05-23 -arm-none-eabi / arm-2013.05-23-arm-none-eabi.extras / host-
libs-i686-pc-linux-gnu / usr –with-mpc = / scratch / jbrown / 2013.05-arm-
eabi -release / obj / pkg-2013.05-23-arm-none-eabi / arm-2013.05-23-arm-
none-eabi.extras / host-libs-i686-pc-linux-gnu / usr –with-ppl =
/scratch/jbrown/2013.05-arm-eabi-release/obj/pkg-2013.05-23-arm-none-
eabi/arm-2013.05-23-arm-none-eabi.extras/host-libs-i686-pc-linux -gnu / usr
–with-host-libstdcxx =’-static-libgcc -Wl,-Bstatic,-lstdc
,-Bdynamic -lm’
–with-cloog = / scratch / jbrown / 2013.05-arm-eabi-release / obj /
pkg-2013.05-23-arm-none-eabi /arm-2013.05-23-arm-none-eabi.extras/host-
libs-i686-pc-linux-gnu/usr –with-libelf = / scratch / jbrown / 2013.05-arm-
eabi-release / obj / pkg -2013.05-23-arm-none-eabi / arm-2013.05-23-arm-
none-eabi.extras / host-libs-i686-pc-linux-gnu / usr –disable-libgomp
–disable-libitm-启用中毒系统目录–with-build-time-tools = / scratch / jbrown /
2013.05-arm-eabi-release / install / arm-none-eabi / bin –with-build-time-
tools = / scratch / jbrown / 2013.05-arm-eabi-release / install / arm-none-
eabi / bin线程模型:单个gcc版本4.7.3(Sourcery CodeBench Lite 2013.05-23)Extras /
host-libs-i686-pc-linux-gnu / usr –with-libelf = / scratch / jbrown /
2013.05-arm-eabi-release / obj / pkg-2013.05-23-arm-none-eabi / arm-
2013.05-23-arm-none-eabi.extras / host-libs-i686-pc-linux-gnu / usr
–disable-libgomp –disable-libitm –enable-poison-system-directories
–with-build-时间工具= / scratch / jbrown / 2013.05-arm-eabi-release / install /
arm-none-eabi / bin –with-build-time-tools = / scratch / jbrown /
2013.05-arm-eabi-release / install / arm-none-eabi /
bin线程模型:单个gcc版本4.7.3(Sourcery CodeBench Lite 2013.05-23)Extras / host-
libs-i686-pc-linux-gnu / usr –with-libelf = / scratch / jbrown /
2013.05-arm-eabi-release / obj / pkg-2013.05-23-arm-none-eabi / arm-
2013.05-23-arm-none-eabi.extras / host-libs-i686-pc-linux-gnu / usr
–disable-libgomp –disable-libitm –enable-poison-system-directories
–with-build-时间工具= / scratch / jbrown / 2013.05-arm-eabi-release / install /
arm-none-eabi / bin –with-build-time-tools = / scratch / jbrown /
2013.05-arm-eabi-release / install / arm-none-eabi /
bin线程模型:单个gcc版本4.7.3(Sourcery CodeBench Lite 2013.05-23)05-arm-eabi-release
/ install / arm-none-eabi / bin –with-build-time-tools = / scratch / jbrown
/ 2013.05-arm-eabi-release / install / arm / none-eabi /
bin线程型号:单一gcc版本4.7.3(Sourcery CodeBench Lite 2013.05-23)05-arm-eabi-release
/ install / arm-none-eabi / bin –with-build-time-tools = / scratch / jbrown
/ 2013.05-arm-eabi-release / install / arm / none-eabi /
bin线程型号:单一gcc版本4.7.3(Sourcery CodeBench Lite 2013.05-23)
您下载了错误的工具链。
arm-linux-gnueabi-g++
是使用建造的arm-none-eabi
,用于裸机程序。它不包含 libc,
即该工具链中不存在标准库(glibc或eglibc)。
因此,您需要下载arm-none-linux-gnueabi
工具链(即arm-2013.05-24-arm-none-linux- gnueabi-i686-pc-linux-gnu.tar.bz2
不是arm-2013.11-24-arm-none-eabi-i686-pc- linux-gnu.tar.bz2
)。
要验证以上内容,请输入:
cd /home/kang/Utils/arm-2013.05/arm-none-eabi
在这里,您只会找到bin include lib share
,而没有libc
目录。
下载arm-2013.05-24-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
;
在这里您会找到一个文件夹arm-2013.05/arm-none-linux-gnueabi/libc
。
您还可以通过以下方式进行验证:
arm-linux-eabi-g++ -print-sysroot and
arm-none-linux-gnueabi-g++ -print-sysroot
本文档说明如何在kali linux上配置ARM交叉编译环境,是我们多份关于”定制ARM镜像”的文档的起点. 开发机的配置 编译内核生成镜象通常需要大量硬盘空间.确保你的开发机至少有50G可用硬盘空间以及足够的内存,CPU不要太差. 安装依赖 先安装ARM交叉编译所需的依赖. apt-get install git-core gnupg flex bison gperf libesd0-dev b
我试图交叉编译一个linux系统的简单hello world程序。 我有以下资料: null 我试图运行/lib/libc.so.0来获取版本信息,但出现了一个分段错误。它似乎用-static编译解决了这个问题。所以我想这是libc库的问题。谢谢你的帮助。
问题内容: 当代码到达递归调用增量时,我收到错误找不到符号,我不知道为什么?这是增量代码。任何帮助将不胜感激。 编辑:我真的是Java的新手,所以可以做的答案越基本越好。好的,所以我收到的错误是:BigNatural.java.35:找不到符号符号方法增量()位置:类java.lang.String temp.increment() 并在此处清除所有其他问题,是整个代码。 }公共类BigNatur
我在c代码中使用include: 。当我用“gcc”编译器编译它时,我没有任何错误,但当我用交叉编译器“arm-linux-gnueabi-gcc”编译它时,我有以下错误:
当使用arm-none-linux-gnueabi-g++编译此代码时,系统调用将被跳过,除了系统(“echo nikhil”)之外,所有其他指令都将被执行
问题内容: 嘿,我刚开始我的第一本Java编程书籍,所以这应该很容易解决。弄乱我对条件句的新知识,发现标题错误。 这是代码: 当我尝试编译时: 问题答案: 错误消息告诉您变量“输入”在您的作用域中不存在。您可能想使用Scanner对象,但将其命名为“ x”,而不是“ input”。 应该修复它。