* Difference between *-none-elf and *-linux-gnu configurations
@ 2024-04-12 14:24 Johannes Krottmayer
2024-04-12 15:14 ` Jonathan Wakely
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Krottmayer @ 2024-04-12 14:24 UTC (permalink / raw)
To: gcc-help
[-- Attachment #1.1: Type: text/plain, Size: 492 bytes --]
Hi!
Sorry if already asked, but what are the differences from as example
x86_64-none-elf and x86_64-linux-gnu configurations?
I have tried to compile Linux with a x86_64-none-elf build, but failed with
assembler errors. (It's might be also a binutils question.) With the
x86_64-linux-gnu build, everything worked fine.
Can somebody explain me the key differences between this both builds?
Unfortunately I currently didn't find any information.
Thanks in advance!
Kind regards,
Johannes
[-- Attachment #1.2: publickey - johannes@krotti42.com - 0x0D55CF6F.asc --]
[-- Type: application/pgp-keys, Size: 705 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Difference between *-none-elf and *-linux-gnu configurations
2024-04-12 14:24 Difference between *-none-elf and *-linux-gnu configurations Johannes Krottmayer
@ 2024-04-12 15:14 ` Jonathan Wakely
2024-04-12 16:03 ` Johannes Krottmayer
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Wakely @ 2024-04-12 15:14 UTC (permalink / raw)
To: Johannes Krottmayer; +Cc: gcc-help
[-- Attachment #1: Type: text/plain, Size: 916 bytes --]
On Fri, 12 Apr 2024, 15:26 Johannes Krottmayer via Gcc-help, <
gcc-help@gcc.gnu.org> wrote:
> Hi!
>
> Sorry if already asked, but what are the differences from as example
> x86_64-none-elf and x86_64-linux-gnu configurations?
>
The former is a bare metal "freestanding" target that generates code for a
system without an OS or C library. The latter is a "hosted" target that
uses the Linux kernel and Glibc C library.
> I have tried to compile Linux with a x86_64-none-elf build, but failed with
> assembler errors. (It's might be also a binutils question.) With the
> x86_64-linux-gnu build, everything worked fine.
>
You need a binutils configured for x86_64-none-elf to assemble and link
code compiled for that target.
> Can somebody explain me the key differences between this both builds?
> Unfortunately I currently didn't find any information.
>
> Thanks in advance!
>
> Kind regards,
>
> Johannes
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Difference between *-none-elf and *-linux-gnu configurations
2024-04-12 15:14 ` Jonathan Wakely
@ 2024-04-12 16:03 ` Johannes Krottmayer
0 siblings, 0 replies; 3+ messages in thread
From: Johannes Krottmayer @ 2024-04-12 16:03 UTC (permalink / raw)
To: gcc-help
[-- Attachment #1.1: Type: text/plain, Size: 1819 bytes --]
Hi Jonathan!
Thanks for the answer.
On 4/12/24 17:14, Jonathan Wakely via Gcc-help wrote:
> On Fri, 12 Apr 2024, 15:26 Johannes Krottmayer via Gcc-help, <
> gcc-help@gcc.gnu.org> wrote:
>
>> Hi!
>>
>> Sorry if already asked, but what are the differences from as example
>> x86_64-none-elf and x86_64-linux-gnu configurations?
>>
> The former is a bare metal "freestanding" target that generates code for a
> system without an OS or C library. The latter is a "hosted" target that
> uses the Linux kernel and Glibc C library.
>
I already did know that. The *-none-elf configurations I primarily use them
in my own embedded projects. But there seems for me, there are more
differences.
>> I have tried to compile Linux with a x86_64-none-elf build, but failed with
>> assembler errors. (It's might be also a binutils question.) With the
>> x86_64-linux-gnu build, everything worked fine.
>>
>
> You need a binutils configured for x86_64-none-elf to assemble and link
> co
de compiled for that target.
Yes, the binutils are configured as *-none-elf. For my projects these
configuration works fine. But I'm wondering why the x86_64-none-elf build
didn't work when I try to compile the Linux kernel. AFAIK, Linux use it's
own libc and also some functions from libgcc.
So I have thought there must be another differences. Like how comments
are interpreted, as example (The assembler error, when I try to build
Linux with a x86_64-none-elf is inner a comment.).
Currently I have only compared the Makefile from GCC after configuration,
and only seen that additional _GNU_SOURCE is defined in the *-linux-gnu
configuration.
>
>> Can somebody explain me the key differences between this both builds?
>> Unfortunately I currently didn't find any information.
>>
>> Thanks in advance!
>>
>> Kind regards,
>>
>> Johannes
>>
[-- Attachment #1.2: publickey - johannes@krotti42.com - 0x0D55CF6F.asc --]
[-- Type: application/pgp-keys, Size: 705 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-12 16:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-12 14:24 Difference between *-none-elf and *-linux-gnu configurations Johannes Krottmayer
2024-04-12 15:14 ` Jonathan Wakely
2024-04-12 16:03 ` Johannes Krottmayer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).