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

2022-04-28 Thread Frank Kühndel
Hello,

On 4/27/22 20:22, Joel Sherrill wrote:
> On Wed, Apr 27, 2022 at 1:12 PM Frank Kühndel <
> frank.kuehn...@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 

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

2022-04-28 Thread Sebastian Huber

On 27.04.22 19:25, Frank Kühndel wrote:

Hello Sebastian,

On 4/27/22 11:54, Sebastian Huber wrote:

we have to select a GCC version for the RTEMS 6 release. Currently,
GCC 10 is used, however, with the release of GCC 10.4 this year it
will reach its end of life. Other options are GCC 11 and 12. GCC 12
will be released in the next weeks. It has some nice features:

* Initialization of stack variables:

https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-ftrivial-auto-var-init


* Improved static analysis with -fanalyzer

* Improved gcov support, with the ability to back port changes from
GCC 13:

https://gcc.gnu.org/pipermail/gcc-patches/2022-April/593536.html

* Upstream maintenance for the next three years

The draw back is that it is brand new.

The Ada support is broken in GCC 12 for most targets:

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???


There is a GCC development repository for openSUSE which all current GCC 
versions:


https://download.opensuse.org/repositories/devel:/gcc/



So, if I am not mistaken, switching to GCC 12 will have the effect that
the "normal" RTEMS ADA user will for quite a while not be able to build
ADA. I am not sure how important that would be.


I already fixed the Ada build.

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
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/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

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

2022-04-27 Thread Joel Sherrill
On Wed, Apr 27, 2022 at 1:12 PM Frank Kühndel <
frank.kuehn...@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

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.

As for trivia, GNAT/RTEMS first passed the ACVC formally in March
1997 on the sparc/erc32. It's been around a long time. ;)

--joel


> Greetings
> fk
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

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

2022-04-27 Thread Karel Gardas

On 4/27/22 20:12, Frank Kühndel 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."



Hmm, I see, thanks for correcting me, but your citation is missing one 
important detail:


"In order to build a cross compiler, it is strongly recommended to 
install the new compiler as native first, and then use it to build the 
cross compiler."


So I'm afraid this looks like ball is on the RSB side which should first 
build native compiler of required version -- for this you may use older 
GNAT (at least GCC 5.1) and then use exactly this compiler to build a 
cross-compiler.


E.g. GNAT 10 native -> GNAT 12 native -> GNAT 12 cross-compiler (RTEMS).

Is that correct?

Thanks!
Karel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

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

2022-04-27 Thread Frank Kühndel
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.

Greetings
fk
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

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

2022-04-27 Thread Karel Gardas

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?

Thanks,
Karel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

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

2022-04-27 Thread Frank Kühndel
Hello Sebastian,

On 4/27/22 11:54, Sebastian Huber wrote:
>> we have to select a GCC version for the RTEMS 6 release. Currently,
>> GCC 10 is used, however, with the release of GCC 10.4 this year it
>> will reach its end of life. Other options are GCC 11 and 12. GCC 12
>> will be released in the next weeks. It has some nice features:
>>
>> * Initialization of stack variables:
>>
>> https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-ftrivial-auto-var-init
>>
>>
>> * Improved static analysis with -fanalyzer
>>
>> * Improved gcov support, with the ability to back port changes from
>> GCC 13:
>>
>> https://gcc.gnu.org/pipermail/gcc-patches/2022-April/593536.html
>>
>> * Upstream maintenance for the next three years
>>
>> The draw back is that it is brand new.
> 
> The Ada support is broken in GCC 12 for most targets:

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???

So, if I am not mistaken, switching to GCC 12 will have the effect that
the "normal" RTEMS ADA user will for quite a while not be able to build
ADA. I am not sure how important that would be.

Greetings
fk
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel