comp.lang.ada
 help / color / mirror / Atom feed
* Things AVR-Ada needs to sort out - calling Rolf
@ 2016-11-28 18:39 Lucretia
  2016-11-29 18:32 ` rrr.eee.27
  0 siblings, 1 reply; 4+ messages in thread
From: Lucretia @ 2016-11-28 18:39 UTC (permalink / raw)


Hi,

Looking back at AVR stuff again and I still cannot believe Rolf Ebert hacks up the GCC build so much still.

As of GCC-4.9.4, the ability to build bare metal GNAT builds has been put back in place, see https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/ada/gcc-interface/Makefile.in?r1=218003&r2=219183&pathrev=219183 for the patch.

This then renders 23-gcc-4.7-ada-Makefile.patch and 24-gcc-4.7-ada-gnattools.patch unnecessary and quite possibly no_25-gcc-4.7-ada-gnattools_bug55243.patch too. 

The -ffreestanding is part of the C standard for compiling OS kernels where there is no C runtime libs and has nothing to do with Ada, this should be removed, it should never have even been there. Therefore, 71-gcc-4.7-ada-freestanding.patch is irrelevant.

As for 72-gcc-4.7-ada-timebase.patch, I'm not sure about this one. Is there really a need for this at all? Why does the time duration need to be changed for AVR?

Given the above, I cannot see the need for 73-gcc-4.7-ada-gnat1_print_path.patch either.

The way to build this new compiler is to use --disable-libada in the configure command then:

make all-gcc
make all-target-libgcc
make -C gcc cross-gnattools ada.all.cross
make install-strip-gcc install-target-libgcc

as can be seen here - https://github.com/Lucretia/free-ada/blob/develop/includes/bare_metal.inc

I think if this were sorted out, it would make building the compiler easier and any extra patches could be passed onto the FSF for inclusion into the source, with proper copyright assignments in place. You would only then require your custom runtime to be distributed to be built.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Things AVR-Ada needs to sort out - calling Rolf
  2016-11-28 18:39 Things AVR-Ada needs to sort out - calling Rolf Lucretia
@ 2016-11-29 18:32 ` rrr.eee.27
  2016-11-29 21:18   ` Lucretia
  0 siblings, 1 reply; 4+ messages in thread
From: rrr.eee.27 @ 2016-11-29 18:32 UTC (permalink / raw)


On Monday, November 28, 2016 at 7:39:45 PM UTC+1, Lucretia wrote:
> Hi,
 
Hi,

> Looking back at AVR stuff again and I still cannot believe Rolf Ebert hacks up the GCC build so much still.

That depends on the meaning of "so much".

I ported my patches for building gcc to gcc-5.3 and last February to gcc-6.2.

> As of GCC-4.9.4, the ability to build bare metal GNAT builds has been put back in place, see https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/ada/gcc-interface/Makefile.in?r1=218003&r2=219183&pathrev=219183 for the patch.

I read about it in the gcc-patches mailing, but cannot find it in your reference.  Actually I always wanted to move my build patches to your (or Simon's) way.
 
> This then renders 23-gcc-4.7-ada-Makefile.patch and 24-gcc-4.7-ada-gnattools.patch unnecessary and quite possibly no_25-gcc-4.7-ada-gnattools_bug55243.patch too. 

I still use the first two ones (23-gcc..., 25-gcc...). The last one is prefixed with a no_ indicating that it wasn't necessary anymore when you picked it up (my build script only accepts patches starting with numbers and ending in .patch)
 
> The -ffreestanding is part of the C standard for compiling OS kernels where there is no C runtime libs and has nothing to do with Ada, this should be removed, it should never have even been there. Therefore, 71-gcc-4.7-ada-freestanding.patch is irrelevant.

Perhaps the name of the patch is misleading. Actually when I first created it (gcc-3.4?) it removed about 200 bytes in the generated code from the binder file. It still makes the generated binder code a few bytes smaller. I could live without it, definitely.

> As for 72-gcc-4.7-ada-timebase.patch, I'm not sure about this one. Is there really a need for this at all? Why does the time duration need to be changed for AVR?

That patch is also an attempt to reduce the code size on the target. Deviating from the Ada standard I can use a time base of 1ms and a time variable of only 32 bits. A few years ago 64 bit integers didn't work well on AVR.

> Given the above, I cannot see the need for 73-gcc-4.7-ada-gnat1_print_path.patch either.

I already removed that one in gcc-4.9, 5.3 and 6.2
 
> The way to build this new compiler is to use --disable-libada in the configure command then:
> 
> make all-gcc
> make all-target-libgcc
> make -C gcc cross-gnattools ada.all.cross
> make install-strip-gcc install-target-libgcc

Actually, I have difficulties to make that work. 

> as can be seen here - https://github.com/Lucretia/free-ada/blob/develop/includes/bare_metal.inc

I looked at your script last February. In the end I sticked to my patches because I wanted to proceed and did not want to beautify my set of patches.

> I think if this were sorted out, it would make building the compiler easier and any extra patches could be passed onto the FSF for inclusion into the source, with proper copyright assignments in place. You would only then require your custom runtime to be distributed to be built.

There aren't any extra patches anymore that need to be included in the upstream gcc!


Thanks for your hints. I'll see if I can streamline building AVR-Ada in the future.

best regards
    Rolf

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Things AVR-Ada needs to sort out - calling Rolf
  2016-11-29 18:32 ` rrr.eee.27
@ 2016-11-29 21:18   ` Lucretia
  2016-11-29 23:14     ` Luke A. Guest
  0 siblings, 1 reply; 4+ messages in thread
From: Lucretia @ 2016-11-29 21:18 UTC (permalink / raw)


On Tuesday, 29 November 2016 18:32:28 UTC, rrr.e...@gmail.com  wrote:
> On Monday, November 28, 2016 at 7:39:45 PM UTC+1, Lucretia wrote:
> > Hi,
>  
> Hi,

Hi ho :D
 
> > Looking back at AVR stuff again and I still cannot believe Rolf Ebert hacks up the GCC build so much still.
> 
> That depends on the meaning of "so much".
> 
> I ported my patches for building gcc to gcc-5.3 and last February to gcc-6.2.
> 
> > As of GCC-4.9.4, the ability to build bare metal GNAT builds has been put back in place, see https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/ada/gcc-interface/Makefile.in?r1=218003&r2=219183&pathrev=219183 for the patch.
> 
> I read about it in the gcc-patches mailing, but cannot find it in your reference.  Actually I always wanted to move my build patches to your (or Simon's) way.

Er, the reference is above :/
  
> Perhaps the name of the patch is misleading. Actually when I first created it (gcc-3.4?) it removed about 200 bytes in the generated code from the binder file. It still makes the generated binder code a few bytes smaller. I could live without it, definitely.
> 

This (https://gist.github.com/Lucretia/d1c99124a889fd7b10f98b0418e2aaad & https://gist.github.com/Lucretia/326a08e89b5ec805eb67bb52e2ffdc34) is the b~led_shifter.ads generated from https://github.com/Lucretia/electronics/commit/593b6fb76779bb989b273cf4fe5db7841e3833d6#diff-9574567a0d03bebebfdad27c1c2a80c0

This (https://gist.github.com/Lucretia/e0ee7b35acad13d2b9dc726a671aa477) generated from https://github.com/Lucretia/bare_bones using free-ada. That is as small as it's gonna get.


> > As for 72-gcc-4.7-ada-timebase.patch, I'm not sure about this one. Is there really a need for this at all? Why does the time duration need to be changed for AVR?
> 
> That patch is also an attempt to reduce the code size on the target. Deviating from the Ada standard I can use a time base of 1ms and a time variable of only 32 bits. A few years ago 64 bit integers didn't work well on AVR.

But shouldn't setting the following:

Duration_32_Bits : constant Boolean := True;  -- ??

Sort this out?

I notice the code changes the denominator to 20000 * -6 rather than 20000 * -3, I'm not sure what this acheives tbh. Can you explain more?

> > The way to build this new compiler is to use --disable-libada in the configure command then:
> > 
> > make all-gcc
> > make all-target-libgcc
> > make -C gcc cross-gnattools ada.all.cross
> > make install-strip-gcc install-target-libgcc
> 
> Actually, I have difficulties to make that work. 

Try https://github.com/Lucretia/free-ada - build native first, then build i586-elf and then build bare_bones, trust me it works.

> > as can be seen here - https://github.com/Lucretia/free-ada/blob/develop/includes/bare_metal.inc
> 
> I looked at your script last February. In the end I sticked to my patches because I wanted to proceed and did not want to beautify my set of patches.

Yeah moving on is fine, but I really think it needs to be sorted out so anyone can just grab the source from fsf and build a working compiler.
 
> There aren't any extra patches anymore that need to be included in the upstream gcc!

Well, there are, whatever is left from the above list.
 
> Thanks for your hints. I'll see if I can streamline building AVR-Ada in the future.

Try what I have so far and see what you get. There is a build for avr-elf in free-ada, but I've not tried to build anything with it. Because of the extra timebase patch.

> best regards
>     Rolf

Ta.
Luke.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Things AVR-Ada needs to sort out - calling Rolf
  2016-11-29 21:18   ` Lucretia
@ 2016-11-29 23:14     ` Luke A. Guest
  0 siblings, 0 replies; 4+ messages in thread
From: Luke A. Guest @ 2016-11-29 23:14 UTC (permalink / raw)


Lucretia <laguest9000@googlemail.com> wrote:

> This (https://gist.github.com/Lucretia/d1c99124a889fd7b10f98b0418e2aaad &
> https://gist.github.com/Lucretia/326a08e89b5ec805eb67bb52e2ffdc34) is the
> b~led_shifter.ads generated from
> https://github.com/Lucretia/electronics/commit/593b6fb76779bb989b273cf4fe5db7841e3833d6#diff-9574567a0d03bebebfdad27c1c2a80c0
> 
> This (https://gist.github.com/Lucretia/e0ee7b35acad13d2b9dc726a671aa477)
> generated from https://github.com/Lucretia/bare_bones using free-ada.
> That is as small as it's gonna get.

In fact you can stop gnatbind from creating the "main" in the b~*.ad[sb]
meaning an even smaller program, you just have to call adainit and the
elaboration code in your own kernel procedure.

Luke

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-29 23:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-28 18:39 Things AVR-Ada needs to sort out - calling Rolf Lucretia
2016-11-29 18:32 ` rrr.eee.27
2016-11-29 21:18   ` Lucretia
2016-11-29 23:14     ` Luke A. Guest

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox