Talk:Coreboot

From Gentoo Wiki
Jump to:navigation Jump to:search
Note
Before creating a discussion or leaving a comment, please read about using talk pages. To create a new discussion, click here. Comments on an existing discussion should be signed using ~~~~:
A comment [[User:Larry|Larry]] 13:52, 13 May 2024 (UTC)
: A reply [[User:Sally|Sally]] 15:45, 21 December 2024 (UTC)
:: Your reply ~~~~

Ada and gcc

Talk status
This discussion needs help as of 2024-05-23.
Tip: To get this fixed sooner, use {{Proposal}}.

I installed dev-lang/gnat-gpl (which requires 6 GB space in PORTAGE_TMPDIR):

root #emerge --ask dev-lang/gnat-gpl

Then I ran make crossgcc CPUS=4 and got "No compatible Ada compiler (GNAT) found":

user $make crossgcc CPUS=4
Welcome to the coreboot cross toolchain builder v51d23c589b (2021-01-05)

Building toolchain using 4 thread(s).

Target architecture is i386-elf

WARNING
No compatible Ada compiler (GNAT) found. You can continue without
Ada support, but this will limit the features of coreboot (e.g.
native graphics initialization won't be available on most Intel
boards).

Usually, you can install GNAT with your package management system
(the package is called `gnat` or `gcc-ada`). It has to match the
`gcc` package in version. If there are multiple versions of GCC in-
stalled, you can point this script to the matching version through
the `CC` and `CXX` environment variables.

e.g. on Ubuntu 14.04, if `gcc` is `gcc-4.8`:
    apt-get install gnat-4.8 && make crossgcc

on Ubuntu 16.04, if `gcc` is `gcc-5`:
    apt-get install gnat-5 && make crossgcc

Press Ctrl-C to abort, Enter to continue...

As I see, Ada compiler version is 8.3.1:

user $equery list -po dev-lang/gnat-gpl
 * Searching for gnat-gpl in dev-lang ...
[-P-] [  ] dev-lang/gnat-gpl-2016-r4:4.9.4
[-P-] [  ] dev-lang/gnat-gpl-2017-r1:6.3.0
[-P-] [  ] dev-lang/gnat-gpl-2018-r3:7.3.1
[IP-] [  ] dev-lang/gnat-gpl-2019-r2:8.3.1

But default GCC version is 9.3.0:

user $eselect gcc list
 [1] x86_64-pc-linux-gnu-8.3.1
 [2] x86_64-pc-linux-gnu-9.3.0 *


So I had to do

root #eselect gcc set x86_64-pc-linux-gnu-8.3.1
 * Switching native-compiler to x86_64-pc-linux-gnu-8.3.1 ...
>>> Regenerating /etc/ld.so.cache...                                                                                                                              [ ok ]

 * If you intend to use the gcc from the new profile in an already
 * running shell, please remember to do:

 *   . /etc/profile

Now make crossgcc starts compiling.

Why I'm writing here:

  1. This part of Gentoo documentation should be improved: Coreboot#Compiling
  2. Probably Project:Ada documentation should be improved too
  3. I hope there is some better way than using eselect gcc set x86_64-pc-linux-gnu-8.3.1, so I decided to not change the documentation right now, but find a better options.

--Vazhnov (talk) 19:27, 24 January 2021 (UTC)