From: Johannes Krottmayer <johannes@krotti42.com>
To: gcc-help@gcc.gnu.org
Subject: Re: Difference between *-none-elf and *-linux-gnu configurations
Date: Fri, 12 Apr 2024 16:03:11 +0000 [thread overview]
Message-ID: <127c3933-5658-4aa6-b849-84669196846d@krotti42.com> (raw)
In-Reply-To: <CAH6eHdQzWkOMdPLfQVEKT+Y1TAVT4sH+D8G0eY5WEHy7QKCAmA@mail.gmail.com>
[-- 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 --]
prev parent reply other threads:[~2024-04-12 16:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-12 14:24 Johannes Krottmayer
2024-04-12 15:14 ` Jonathan Wakely
2024-04-12 16:03 ` Johannes Krottmayer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=127c3933-5658-4aa6-b849-84669196846d@krotti42.com \
--to=johannes@krotti42.com \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).