arm-linux-gcc 与 arm-elf-gcc

发布于 2024-07-10 22:41:10 字数 169 浏览 5 评论 0原文

我正在研究 uClinux 系统,该系统使用arm-linux-xxx构建内核,但使用arm-elf-xxx构建用户应用程序。

如果应用程序打算在 Linux 上运行,那么使用 arm-linux-xxx 构建所有内容不是更好吗?

在整个 uClinux 构建配置中的哪里设置该选项?

I am looking at uClinux system that builds the kernel with arm-linux-xxx, but builds the user apps with arm-elf-xxx.

If the apps are intended to run on linux, wouldn't it be better to build everything with arm-linux-xxx ?

Where does one set that option in the overall uClinux build config?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

白云悠悠 2024-07-17 22:41:10

编译器的名称不一定意味着什么。 根据编译器的构建者(并为其命名),您将得到不同的结果。 可以说,特定配置有一个正确的名称,但某些随机编译的 gcc 可能不正确。

对于 CodeSourcery 编译器(可能是最正确的名称),请参阅其平台页面了解具体内容他们的命名方式。

The names of the compilers don't necessarily mean anything. Depending on who built the compilers (and named them), you'll get differing results. Arguably, there is a correct name for a particular configuration, but some random compiled gcc may not be correct.

For the CodeSourcery compilers (likely the most correct names), see their platforms page for what their naming means.

人间☆小暴躁 2024-07-17 22:41:10

您可以运行 arm-linux-gcc -varm-elf-gcc -v 来查看这两个版本的 gcc 之间的一些差异(例如目标架构/语言) 。

You can run arm-linux-gcc -v and arm-elf-gcc -v to see some differences between these two versions of gcc (such as target architectures/languages).

梦幻的心爱 2024-07-17 22:41:10

ELF 是Linux 和许多其他使用的二进制格式:

ELF 格式已取代旧格式
可执行格式,例如 a.out 和
COFF在许多类Unix操作中
Linux、Solaris、IRIX 等系统
FreeBSD、NetBSD、OpenBSD、蜻蜓
BSD、Syllable 和 HP-UX(除了
32位PA-RISC程序继续
使用 SOM)。 ELF也见过一些
在非 Unix 操作系统中的采用
系统,例如 Itanium 版本
OpenVMS 和 BeOS 修订版 4 以及
稍后对于基于 x86 的计算机(其中
它取代了可移植可执行文件
格式; PowerPC 版本保留
与首选可执行格式)。 这
PlayStation 便携式、PlayStation 2、
PlayStation 3、Wii 和 GP2X 游戏机
也用ELF。 AmigaOS 4 和 MorphOS
也运行在 PowerPC 机器上,使用
精灵。 Amiga平台上的ELF
可执行文件已取代以前的
EHF(扩展块格式)
用于配备 PPC 的 Amigas
处理器扩展卡。 塞班系统
OS v9 使用 E32Image[3] 格式,即
基于ELF文件格式。

大多数索尼爱立信(例如,
W800i、W610、K790等)、部分西门子
(SGOLD 和 SGOLD2 平台:来自
西门子 C65 至 S75 和明基西门子
E71/EL71)和摩托罗拉(例如,
E398、SLVR L7、v360、v3i 等
已应用补丁的手机 LTE2)
手机可以通过以下方式运行ELF文件
使用添加汇编代码的补丁
到主固件(称为
ELFPack,地下改装
文化)。

ELF is the binary format linux and many others use:

The ELF format has replaced older
executable formats such as a.out and
COFF in many Unix-like operating
systems such as Linux, Solaris, IRIX,
FreeBSD, NetBSD, OpenBSD, DragonFly
BSD, Syllable, and HP-UX (except for
32-bit PA-RISC programs which continue
to use SOM). ELF has also seen some
adoption in non-Unix operating
systems, such as the Itanium version
of OpenVMS, and BeOS Revision 4 and
later for x86 based computers (where
it replaced the Portable Executable
format; the PowerPC version stayed
with Preferred Executable Format). The
PlayStation Portable, PlayStation 2,
PlayStation 3, Wii and GP2X consoles
also use ELF. AmigaOS 4 and MorphOS
also running on PowerPC machines, use
ELF. On the Amiga platform the ELF
executable has replaced the previous
EHF (Extended Hunk Format) which was
used on Amigas equipped with PPC
processor expansion cards. The Symbian
OS v9 uses E32Image[3] format that is
based on ELF file format.

Most Sony Ericsson (for example, the
W800i, W610, K790, etc.), some Siemens
(SGOLD and SGOLD2 platforms: from
Siemens C65 to S75 and BenQ-Siemens
E71/EL71) and Motorola (for example,
the E398, SLVR L7, v360, v3i and all
phone LTE2 which has the patch apply)
phones can run ELF files through the
use of a patch that adds assembly code
to the main firmware (Known as the
ELFPack, in the underground modding
culture).

昨迟人 2024-07-17 22:41:10

我似乎记得在某个时候,中间的那一点并不重要。 正如已经提到的,elf 是标准文件格式,您无论如何都想使用它,并且无论如何都会得到它,而与二进制名称无关。 可能(或不)更重要的是调用约定,我不知道在调用共享库函数时是否必须使调用约定匹配,或者是否在其他地方为您处理。

I seem to remember at some point that that bit in the middle didnt matter. As already mentioned elf is the standard file format, you want to use that anyway and will get that anyway independent of the binary name. What may (or not) matter more is the calling convention, I dont know if when calling a shared library function you have to get your calling convention to match or if it is handled for you somewhere else.

星軌x 2024-07-17 22:41:10

区别在于,arm-elf-xxx 工具链的链接输出是 Linux 可加载二进制文件,而 arm-linux-xxx 输出内核对象 (ko),它是具有自己的链接格式(对于模块)的 blob,或者主内核本身,不需要打包格式。 即,对于用户空间,您希望最终的动态链接对象是 ELF 可执行文件、库或共享对象。 对于内核空间,您希望最终对象(内核或模块)采用 linux-arm-kernel 链接格式。

您会注意到两个目标的中间对象(.o 文件)可能都是 ELF,因为这是工具链所期望的。

The difference is that the linked output from the arm-elf-xxx toolchain is a linux loadable binary, while arm-linux-xxx outputs a kernel object (ko), which is a blob with its own linkage format (for modules), or the main kernel itself, which doesn't need a packaging format. I.e., for user space you want the final dynamically linked object to be an ELF executable, library, or shared object. For kernel space, you want the final object (kernel or module) to be in the linux-arm-kernel linkage format.

You'll notice that the intermediate objects (.o files) of both targets are probably all ELF, since that is what the toolchain is expecting.

逐鹿 2024-07-17 22:41:10

在我们的例子中,我们使用 sparc-elf-gcc 构建 Linux,并使用 sparc-..-linux-gcc 构建 busybox(在 Linux 上运行的应用程序)。 我认为这是正确的,而不是相反。

In our case we build linux using sparc-elf-gcc and we build busybox(appliation run on linux) using sparc-..-linux-gcc. and I think this is correct, not the other way around.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文