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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:a0c:9890:: with SMTP id f16mr61150998qvd.165.1561455784129; Tue, 25 Jun 2019 02:43:04 -0700 (PDT) X-Received: by 2002:aca:1a0e:: with SMTP id a14mr12840968oia.51.1561455783744; Tue, 25 Jun 2019 02:43:03 -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!m24no3093184qtm.0!news-out.google.com!e20ni52qta.0!nntp.google.com!m24no3093177qtm.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 25 Jun 2019 02:43:03 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=115.64.33.135; posting-account=CWeRCQoAAACJzQ7ds1hRZ3V2Cxesor47 NNTP-Posting-Host: 115.64.33.135 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4581efe5-af75-4272-ad55-7bf9224a103b@googlegroups.com> Subject: Re: Setting up a bare metal x86 toolchain From: ff45t1z@gmail.com Injection-Date: Tue, 25 Jun 2019 09:43:04 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:56754 Date: 2019-06-25T02:43:03-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.