comp.lang.ada
 help / color / mirror / Atom feed
From: ajxscc@gmail.com
Subject: Re: Setting up a bare metal x86 toolchain
Date: Tue, 25 Jun 2019 02:44:35 -0700 (PDT)
Date: 2019-06-25T02:44:35-07:00	[thread overview]
Message-ID: <43d217ea-bd75-40ad-b770-36c678dc0cf6@googlegroups.com> (raw)
In-Reply-To: <ly1rzk8y9b.fsf@pushface.org>

Hi Simon, thanks so much for taking the time to respond!
My host system is x86-64 Linux. So building a GCC cross-compiler isn't so difficult. From piecing together a few different answers I think I've answered some of my questions. It looks like I am able to build an x86 bare-metal executable using the native platform compiler. From what I understand, it appears that my assumption that compiling the equivalent of a 'freestanding' C executable in Ada is a matter of correctly configuring the RTS.
I actually already follow you on GitHub, and have already seen some of your example work on there, which has been a great resource! Thank you for having those resources there.

> but what I can't at once see how to do is to get gcc to pass the
arcitecture option on to the assembler.

From what I've seen FSF GNAT will accept the `-m32` switch, and it appears that AdaCore Gnat will also accept global configuration switches in the gprconfig as follows:
```
   package Builder is
      for Global_Compilation_Switches ("Ada") use ("-m32", "-march=i386");
      for Switches ("Ada") use ("-gnat2012", "-g", "-x", "-gnatg");
   end Builder;
```

Following the answer here: https://stackoverflow.com/questions/56721890/setting-up-a-bare-metal-x86-ada-toolchain I've been able to get a bare metal executable built using FSF GNAT. I'm still working on porting this over to the more modern AdaCore GNAT compiler.


  parent reply	other threads:[~2019-06-25  9:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-23  1:25 Setting up a bare metal x86 toolchain ajxscc
2019-06-23  9:08 ` Simon Wright
2019-06-25  9:43   ` ff45t1z
2019-06-25  9:44   ` ajxscc [this message]
2019-06-25 16:56 ` Shark8
2019-06-25 22:59   ` Lucretia
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox