GCC version for RTEMS 6? (Can Ada be used?)

Frank Kühndel frank.kuehndel at embedded-brains.de
Thu Apr 28 09:45:49 UTC 2022


Hello,

On 4/27/22 20:22, Joel Sherrill wrote:
> On Wed, Apr 27, 2022 at 1:12 PM Frank Kühndel <
> frank.kuehndel at embedded-brains.de> wrote:
> 
>> Hi Karel,
>>
>> On 4/27/22 19:46, Karel Gardas wrote:
>>> On 4/27/22 19:25, Frank Kühndel wrote:
>>>> I do not need ADA but ADA may be worth considering. With GCC 10 one
>>>> needed to have a GNAT 10 compiler installed to build the tools incl.
>>>> --with_ada. I presume, one would need a GNAT 12 to build ADA with the
>>>> GCC 12 sources? The current Fedora 35 has GNAT 11. All other distros I
>>>> know of have GNAT 10 at best (I have not checked on tumbleweed yet).
>>>> OpenSUSE may get ADA 12 from an unusual repro???
>>> On https://gcc.gnu.org/install/prerequisites.html there is a text:
>>>
>>> "
>>> GNAT
>>>
>>>     In order to build GNAT, the Ada compiler, you need a working GNAT
>>> compiler (GCC version 5.1 or later).
>>>
>>> ...
>>> "
>>>
>>> is it outdated? If so, this would require some bugreport to gcc team?
>> The text says too: "Other native compiler versions may work but this is
>> not guaranteed and will typically fail with hard to understand
>> compilation errors during the build."
>>
>> I tried last year to build the tools "--with_ada" on Ubuntu, OpenSUSE,
>> Fedora, AlmaLinux and Debian. Moreover, I tried all versions of GNAT
>> each of the OS offered "normal" users to install. Only GNAT 10 worked
>> for me. Nothing else.
>>
>> The text in the chapter your cited can be understood this way: Compiling
>> ADA with a native compiler of the same version will work. If the native
>> compiler has a higher version it, is rather unlikely to work. If the
>> native compiler has a lower version, it may work or not. So, I do not
>> think you can file a bug with GCC.
>>
> When I more regularly built Ada, I always used the native Ada compiler
> to build the same version of GCC I was going to use with RTEMS natively
> with  Ada enabled. I didn't care what version of GCC/Ada was from the OS.
> 
> + OS GCC/Ada ->
> +  native using RTEMS GCC version
> + cross compiler for RTEMS with Ada

With "native using RTEMS GCC version" you mean you downloaded the
official GCC tar-ball and build an Ada compiler following the
README/Install instructions?

I was always thinking that building an Ada non-cross compiler would run
into the same errors as building an Ada cross compiler. Interesting. I
have no time to test it right now but I will write it on my list and
give it a try.

In case that will work, Karel would be right. The RSB should at least
check the GNAT Version and issue a warning or error instead of letting
users marvel around why the Ada cross compiler failed to build with a
bizarre error.

> 
> At least now you don't have to build RTEMS to have some headers and
> libraries before you build Ada. Long ago, you had to build a cross C/C++
> compiler first to build RTEMS, then use the RTEMS libraries as part of
> building the toolchain with Ada.
> 
> Also as I mentioned to Sebastian privately, Ada is likely to build for
> all targets except those where float and double are the same size. I
> only remember sh as having a multilib like this but I feel like there
> is another case.

I tried on all targets and Ada does not build on sh and lm32 (tested on
Ubuntu, Debian, OpenSUSE with RTEMS 6 and GNAT 10).

Greetings
fk

++++ Ada on Sh failure (Debian 11) ++++

../gcc-interface/Makefile:299: update target 's-soflin.o' due to:
s-soflin.adb
/home/minna/src/rtems-source-builder/rtems/build/sh-rtems6-gcc-0f001dd-newlib-64
b2081-x86_64-linux-gnu-1/build/./gcc/xgcc
-B/home/minna/src/rtems-source-builder
/rtems/build/sh-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-gnu-1/build/./gcc
/ -nostdinc
-B/home/minna/src/rtems-source-builder/rtems/build/sh-rtems6-gcc-0f0
01dd-newlib-64b2081-x86_64-linux-gnu-1/build/sh-rtems6/newlib/ -isystem
/home/mi
nna/src/rtems-source-builder/rtems/build/sh-rtems6-gcc-0f001dd-newlib-64b2081-x8
6_64-linux-gnu-1/build/sh-rtems6/newlib/targ-include -isystem
/home/minna/src/rt
ems-source-builder/rtems/build/sh-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux
-gnu-1/gnu-mirror-gcc-0f001dd/newlib/libc/include
-B/opt/rtems/6/sh-rtems6/bin/
-B/opt/rtems/6/sh-rtems6/lib/ -isystem /opt/rtems/6/sh-rtems6/include
-isystem /
opt/rtems/6/sh-rtems6/sys-include    -c -g -O2 -m4-single-only  -W -Wall
-gnatpg
 -nostdinc -m4-single-only  s-soflin.adb -o s-soflin.o
s-scaval.adb:103:07: warning: "IV_Ilf" overlays smaller object
s-scaval.adb:103:07: warning: program execution may be erroneous
s-scaval.adb:103:07: warning: size of "IV_Ilf" is 64
s-scaval.adb:103:07: warning: size of "IS_Ilf" is 32
s-scaval.adb:104:07: warning: "IV_Ill" overlays smaller object
s-scaval.adb:104:07: warning: program execution may be erroneous
s-scaval.adb:104:07: warning: size of "IV_Ill" is 96
s-scaval.adb:104:07: warning: size of "IS_Ill" is 64
make[8]: *** [../gcc-interface/Makefile:299: s-scaval.o] Error 1



++++ Ada failure on lm32 (Ubuntu 22.04) ++++

../gcc-interface/Makefile:302: update target 'a-chlat1.o' due to:
a-chlat1.ads
/home/minna/src/rtems-source-builder/rtems/build/lm32-rtems6-gcc-0f001dd-newlib-
64b2081-x86_64-linux-gnu-1/build/./gcc/xgcc
-B/home/minna/src/rtems-source-build
er/rtems/build/lm32-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-gnu-1/build/.
/gcc/ -nostdinc
-B/home/minna/src/rtems-source-builder/rtems/build/lm32-rtems6-g
cc-0f001dd-newlib-64b2081-x86_64-linux-gnu-1/build/lm32-rtems6/newlib/
-isystem
/home/minna/src/rtems-source-builder/rtems/build/lm32-rtems6-gcc-0f001dd-newlib-
64b2081-x86_64-linux-gnu-1/build/lm32-rtems6/newlib/targ-include
-isystem /home/
minna/src/rtems-source-builder/rtems/build/lm32-rtems6-gcc-0f001dd-newlib-64b208
1-x86_64-linux-gnu-1/gnu-mirror-gcc-0f001dd/newlib/libc/include
-B/opt/rtems/6/l
m32-rtems6/bin/ -B/opt/rtems/6/lm32-rtems6/lib/ -isystem
/opt/rtems/6/lm32-rtems
6/include -isystem /opt/rtems/6/lm32-rtems6/sys-include    -c -g -O2
-mbarrel-sh
ift-enabled  -W -Wall -gnatpg -nostdinc -mbarrel-shift-enabled
a-chlat1.ads -o
a-chlat1.o
a-calfor.adb: In function 'Ada.Calendar.Formatting.Time_Of':
a-calfor.adb:664:8: error: unrecognizable insn:
(insn 210 211 49 6 (set (reg/v:SI 14 r14 [orig:60 time_zone+-2 ] [60])
        (sign_extend:SI (reg:HI 7 r7 [orig:105+2 ] [105]))) -1
     (expr_list:REG_DEAD (reg:HI 7 r7 [orig:105+2 ] [105])
        (nil)))
+===========================GNAT BUG DETECTED==============================+
| 10.3.1 20220224 (RTEMS 6, RSB
a53d2c94322ed4fe261ba0c99bfb66a6cbd1def1-modifie
d, Newlib 64b2081) (lm32-rtems6) GCC error:|
| in extract_insn, at recog.c:2294                                         |
| Error detected around a-calfor.adb:664:8                                 |
| Please submit a bug report; see https://gcc.gnu.org/bugs/ .              |
| Use a subject line meaningful to you and us to track the bug.            |
../gcc-interface/Makefile:302: update target 'a-chlat9.o' due to:
a-chlat9.ads
| Include the entire contents of this bug box in the report.               |
| Include the exact command that you entered.                              |
| Also include sources listed below.                                       |
/home/minna/src/rtems-source-builder/rtems/build/lm32-rtems6-gcc-0f001dd-newlib-
64b2081-x86_64-linux-gnu-1/build/./gcc/xgcc
-B/home/minna/src/rtems-source-build
er/rtems/build/lm32-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-gnu-1/build/.
/gcc/ -nostdinc
-B/home/minna/src/rtems-source-builder/rtems/build/lm32-rtems6-g
cc-0f001dd-newlib-64b2081-x86_64-linux-gnu-1/build/lm32-rtems6/newlib/
-isystem
/home/minna/src/rtems-source-builder/rtems/build/lm32-rtems6-gcc-0f001dd-newlib-
64b2081-x86_64-linux-gnu-1/build/lm32-rtems6/newlib/targ-include
-isystem /home/
minna/src/rtems-source-builder/rtems/build/lm32-rtems6-gcc-0f001dd-newlib-64b208
1-x86_64-linux-gnu-1/gnu-mirror-gcc-0f001dd/newlib/libc/include
-B/opt/rtems/6/l
m32-rtems6/bin/ -B/opt/rtems/6/lm32-rtems6/lib/ -isystem
/opt/rtems/6/lm32-rtems
6/include -isystem /opt/rtems/6/lm32-rtems6/sys-include    -c -g -O2
-mbarrel-sh
ift-enabled  -W -Wall -gnatpg -nostdinc -mbarrel-shift-enabled
a-chlat9.ads -o
a-chlat9.o
+==========================================================================+

Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.
Consider also -gnatd.n switch (see debug.adb).

system.ads
a-calfor.adb
a-calfor.ads
a-calend.ads
ada.ads
a-catizo.ads
s-stalib.ads
a-unccon.ads
s-exctab.ads
s-secsta.ads
s-parame.ads
s-stoele.ads
interfac.ads
a-except.ads
s-traent.ads
s-valint.ads
s-valrea.ads


raised TYPES.UNRECOVERABLE_ERROR : comperr.adb:407
make[8]: *** [../gcc-interface/Makefile:299: a-calfor.o] Error 1

-- 
embedded brains GmbH
Herr Frank KÜHNDEL
Dornierstr. 4
82178 Puchheim
Germany
email: frank.kuehndel at embedded-brains.de
phone: +49-89-18 94 741 - 23
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/



More information about the devel mailing list