From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a37:5645:: with SMTP id k66mr123424724qkb.177.1561455875778; Tue, 25 Jun 2019 02:44:35 -0700 (PDT) X-Received: by 2002:a05:6830:1316:: with SMTP id p22mr599641otq.329.1561455875485; Tue, 25 Jun 2019 02:44:35 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!m24no3096677qtm.0!news-out.google.com!e20ni52qta.0!nntp.google.com!m24no3096671qtm.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 25 Jun 2019 02:44:35 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=115.64.33.135; posting-account=L5BIhAoAAABpFS40uWyw6qp3RjzNguaC NNTP-Posting-Host: 115.64.33.135 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <43d217ea-bd75-40ad-b770-36c678dc0cf6@googlegroups.com> Subject: Re: Setting up a bare metal x86 toolchain From: ajxscc@gmail.com Injection-Date: Tue, 25 Jun 2019 09:44:35 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:56755 Date: 2019-06-25T02:44:35-07:00 List-Id: 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 d= ifficult. From piecing together a few different answers I think I've answer= ed 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 havi= ng 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 gpr= config as follows: ``` package Builder is for Global_Compilation_Switches ("Ada") use ("-m32", "-march=3Di386")= ; for Switches ("Ada") use ("-gnat2012", "-g", "-x", "-gnatg"); end Builder; ``` Following the answer here: https://stackoverflow.com/questions/56721890/set= ting-up-a-bare-metal-x86-ada-toolchain I've been able to get a bare metal e= xecutable built using FSF GNAT. I'm still working on porting this over to t= he more modern AdaCore GNAT compiler.