comp.lang.ada
 help / color / mirror / Atom feed
* How to use Zero Footprint runtime with GNAT GPL 2017
@ 2017-07-14  8:34 joakimds
  2017-07-14  8:42 ` Egil H H
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: joakimds @ 2017-07-14  8:34 UTC (permalink / raw)


Hi!

On the AdaCore blog one can read that there is a ZFP-runtime included with the release of GNAT GPL 2017 a month ago:
http://blog.adacore.com/gnat-gpl-2017-is-out

In the description it says "The native runtime comes with a Zero Foot Print runtime". How does one invoke it? I thought it is enough to add "--RTS=zfp" when invoking gprbuild. What I've done is creating a "Hello World!" application and attempted to buid it with the "--RTS=zfp" switch. I expected the compiler to tell me that "Ada.Text_IO" can't be used with the ZFP runtime. However, gprbuild complains "no language defined for project" instead.

If I could get compilation to work with ZFP runtime, I've been planning to try using GNAT.IO for printing to "standard out". And if that doesn't work, importing OS specific subprograms...

Is there anyone else in the Ada Community that has attempted to use the ZFP runtime? Any hints will be greatly appreciated.

Best regards,
Joakim

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

* Re: How to use Zero Footprint runtime with GNAT GPL 2017
  2017-07-14  8:34 How to use Zero Footprint runtime with GNAT GPL 2017 joakimds
@ 2017-07-14  8:42 ` Egil H H
  2017-07-14  8:58   ` joakimds
  2017-07-14  9:56 ` Mark Lorenzen
  2017-07-15 13:16 ` Mr. Man-wai Chang
  2 siblings, 1 reply; 17+ messages in thread
From: Egil H H @ 2017-07-14  8:42 UTC (permalink / raw)


On Friday, July 14, 2017 at 10:34:16 AM UTC+2, joak...@kth.se wrote:
> However, gprbuild complains "no language defined for project" instead.
> 

That's usually a hint about the project missing a
   for Languages use ("Ada");

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

* Re: How to use Zero Footprint runtime with GNAT GPL 2017
  2017-07-14  8:42 ` Egil H H
@ 2017-07-14  8:58   ` joakimds
  2017-07-14 15:41     ` Simon Wright
  0 siblings, 1 reply; 17+ messages in thread
From: joakimds @ 2017-07-14  8:58 UTC (permalink / raw)


Den fredag 14 juli 2017 kl. 10:43:00 UTC+2 skrev Egil H H:
> On Friday, July 14, 2017 at 10:34:16 AM UTC+2, joak...@kth.se wrote:
> > However, gprbuild complains "no language defined for project" instead.
> > 
> 
> That's usually a hint about the project missing a
>    for Languages use ("Ada");

I added that and then gprbuild complained something about "not being able to find a corresponding compiler". I've googled for that too, and what I could understand is that something is wrong with the configuration and one should use gprconfig to fix it. Anyways, it didn't seem like the right path.

The version of GNAT GPL 2017 I am using the 64-bit Darwin version for Mac OS X. Maybe the ZFP runtime is only supplied with the ARM ELF cross-compiler? I'm at work now and can't investigate that until I come home tonight...


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

* Re: How to use Zero Footprint runtime with GNAT GPL 2017
  2017-07-14  8:34 How to use Zero Footprint runtime with GNAT GPL 2017 joakimds
  2017-07-14  8:42 ` Egil H H
@ 2017-07-14  9:56 ` Mark Lorenzen
  2017-07-15 13:16 ` Mr. Man-wai Chang
  2 siblings, 0 replies; 17+ messages in thread
From: Mark Lorenzen @ 2017-07-14  9:56 UTC (permalink / raw)


On Friday, July 14, 2017 at 10:34:16 AM UTC+2, joak...@kth.se wrote:
> 
> If I could get compilation to work with ZFP runtime, I've been planning to try using GNAT.IO for printing to "standard out". And if that doesn't work, importing OS specific subprograms...

Using the following project file, it seems to work fine:

project Native is

   for Languages use ("Ada");

   for Main use ("hello.adb");

end Native;

main.adb is a simple "Hello World!" procedure and I can get it to compile with native RTS and with --RTS=zfp (or the Runtime project attribute). In the zfp case, the executable is smaller but calls to Ada.Text_IO is allowed.

Looking into the RTS source code, it seems that a stripped-down version of Ada.Text_IO is supplied with the zfp RTS.

Regards,

Mark L

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

* Re: How to use Zero Footprint runtime with GNAT GPL 2017
  2017-07-14  8:58   ` joakimds
@ 2017-07-14 15:41     ` Simon Wright
  2017-07-14 21:35       ` ake.ragnar.dahlgren
  0 siblings, 1 reply; 17+ messages in thread
From: Simon Wright @ 2017-07-14 15:41 UTC (permalink / raw)


joakimds@kth.se writes:

> Den fredag 14 juli 2017 kl. 10:43:00 UTC+2 skrev Egil H H:
>> On Friday, July 14, 2017 at 10:34:16 AM UTC+2, joak...@kth.se wrote:
>> > However, gprbuild complains "no language defined for project" instead.
>> > 
>> 
>> That's usually a hint about the project missing a
>>    for Languages use ("Ada");
>
> I added that and then gprbuild complained something about "not being
> able to find a corresponding compiler". I've googled for that too, and
> what I could understand is that something is wrong with the
> configuration and one should use gprconfig to fix it. Anyways, it
> didn't seem like the right path.
>
> The version of GNAT GPL 2017 I am using the 64-bit Darwin version for
> Mac OS X. Maybe the ZFP runtime is only supplied with the ARM ELF
> cross-compiler? I'm at work now and can't investigate that until I
> come home tonight...

The ZFP native runtime is only provided in the Linux and Windows
versions of GNAT GPL 2017. Darwin has an ios-simulator RTS instead :-)

You could always report the lack of zfp as a problem to AdaCore!

It doesn't look as if it would be too difficult to make a ZFP for
Darwin.


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

* Re: How to use Zero Footprint runtime with GNAT GPL 2017
  2017-07-14 15:41     ` Simon Wright
@ 2017-07-14 21:35       ` ake.ragnar.dahlgren
  2017-07-17  7:13         ` Mark Lorenzen
  0 siblings, 1 reply; 17+ messages in thread
From: ake.ragnar.dahlgren @ 2017-07-14 21:35 UTC (permalink / raw)


Thanks for the feedback Egil, Mark and Simon! I can confirm the ZFP native runtime is only provided in the Linux and Windows version of GNAT GPL 2017. I also saw the ios-simulator RTS in Darwin, but don't know how to make use of it, yet.

On windows 10 the hello world executable goes from 952kb to 131kb with the ZFP runtime, and on Linux Ubuntu 16.04 the executable goes from 588kb to 11kb. Comparing with hello world application for C++, the executable is 109kb on Windows 10 and 7,5kb in Linux Ubuntu.

Best regards,
Joakim

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

* Re: How to use Zero Footprint runtime with GNAT GPL 2017
  2017-07-14  8:34 How to use Zero Footprint runtime with GNAT GPL 2017 joakimds
  2017-07-14  8:42 ` Egil H H
  2017-07-14  9:56 ` Mark Lorenzen
@ 2017-07-15 13:16 ` Mr. Man-wai Chang
  2017-07-15 16:29   ` Lucretia
  2 siblings, 1 reply; 17+ messages in thread
From: Mr. Man-wai Chang @ 2017-07-15 13:16 UTC (permalink / raw)


On 14/7/2017 4:34 PM, joakimds@kth.se wrote:
 >
 > ... Zero Footprint runtime ....
 >

There is no zero footprint runtime. All runtimes need storage space. :)

-- 
   @~@   Remain silent! Drink, Blink, Stretch! Live long and prosper!!
  / v \  Simplicity is Beauty!
/( _ )\ May the Force and farces be with you!
   ^ ^   (x86_64 Ubuntu 9.10)  Linux 2.6.39.3
不借貸! 不詐騙! 不援交! 不打交! 不打劫! 不自殺! 請考慮綜援 (CSSA):
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa

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

* Re: How to use Zero Footprint runtime with GNAT GPL 2017
  2017-07-15 13:16 ` Mr. Man-wai Chang
@ 2017-07-15 16:29   ` Lucretia
  2017-07-16 13:39     ` Jacob Sparre Andersen
  2017-07-16 14:17     ` Mr. Man-wai Chang
  0 siblings, 2 replies; 17+ messages in thread
From: Lucretia @ 2017-07-15 16:29 UTC (permalink / raw)


On Saturday, 15 July 2017 14:16:24 UTC+1, Mr. Man-wai Chang  wrote:
> On 14/7/2017 4:34 PM, joakim@somewhere wrote:
>  >
>  > ... Zero Footprint runtime ....
>  >
> 
> There is no zero footprint runtime. All runtimes need storage space. :)

ZFP means all you have are the compiler intrinsics as language support and nothing else. Although, I modified mine to include a small secondary stack so that indefinites could be returned from functions.

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

* Re: How to use Zero Footprint runtime with GNAT GPL 2017
  2017-07-15 16:29   ` Lucretia
@ 2017-07-16 13:39     ` Jacob Sparre Andersen
  2017-07-16 15:00       ` Lucretia
  2017-07-16 14:17     ` Mr. Man-wai Chang
  1 sibling, 1 reply; 17+ messages in thread
From: Jacob Sparre Andersen @ 2017-07-16 13:39 UTC (permalink / raw)


Lucretia wrote:

> ZFP means all you have are the compiler intrinsics as language support
> and nothing else. Although, I modified mine to include a small
> secondary stack so that indefinites could be returned from functions.

How much larger does that make the run-time?  (Compiled for ARM, for
example.)

Greetings,

Jacob
-- 
recursive, adj.; see recursive


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

* Re: How to use Zero Footprint runtime with GNAT GPL 2017
  2017-07-15 16:29   ` Lucretia
  2017-07-16 13:39     ` Jacob Sparre Andersen
@ 2017-07-16 14:17     ` Mr. Man-wai Chang
  1 sibling, 0 replies; 17+ messages in thread
From: Mr. Man-wai Chang @ 2017-07-16 14:17 UTC (permalink / raw)


On 16/7/2017 12:29 AM, Lucretia wrote:
>
> ZFP means all you have are the compiler intrinsics as language support and nothing else. Although, I modified mine to include a small secondary stack so that indefinites could be returned from functions.
>

I think ZFP was merely playing with how you drew the line between 
operating system and run-times.

Remember how Internet Explorer (now Edge) was bundled with Window$? Is 
it a ZFP browser? :)

-- 
   @~@   Remain silent! Drink, Blink, Stretch! Live long and prosper!!
  / v \  Simplicity is Beauty!
/( _ )\ May the Force and farces be with you!
   ^ ^   (x86_64 Ubuntu 9.10)  Linux 2.6.39.3
不借貸! 不詐騙! 不援交! 不打交! 不打劫! 不自殺! 請考慮綜援 (CSSA):
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa


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

* Re: How to use Zero Footprint runtime with GNAT GPL 2017
  2017-07-16 13:39     ` Jacob Sparre Andersen
@ 2017-07-16 15:00       ` Lucretia
  0 siblings, 0 replies; 17+ messages in thread
From: Lucretia @ 2017-07-16 15:00 UTC (permalink / raw)


On Sunday, 16 July 2017 14:39:51 UTC+1, Jacob Sparre Andersen  wrote:
> Lucretia wrote:
> 
> > ZFP means all you have are the compiler intrinsics as language support
> > and nothing else. Although, I modified mine to include a small
> > secondary stack so that indefinites could be returned from functions.
> 
> How much larger does that make the run-time?  (Compiled for ARM, for
> example.)

Intrinsics are supplied by the compiler, not the runtime itself. The basic packages for ZFP are (taken from my osdev article: http://wiki.osdev.org/Ada_Bare_bones#RTS_files_to_copy):

ada.ads, gnat.ads - pure, nothing inside

a-unccon.ads, a-uncdea.ads, g-souinf.ads, interfac.ads, s-maccod.ads - All intrinsics.

s-atacco.adb, s-atacco.ads, s-stoele.adb, s-stoele.ads - these are the only ones which actually has any Ada functions inside.

As for code size, I've no idea as you'd have to look at what the compiler generates for those intrinsics.

Luke.


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

* Re: How to use Zero Footprint runtime with GNAT GPL 2017
  2017-07-14 21:35       ` ake.ragnar.dahlgren
@ 2017-07-17  7:13         ` Mark Lorenzen
  2017-07-17  7:27           ` Simon Wright
  2017-07-26 21:28           ` joakimds
  0 siblings, 2 replies; 17+ messages in thread
From: Mark Lorenzen @ 2017-07-17  7:13 UTC (permalink / raw)


On Friday, July 14, 2017 at 11:35:09 PM UTC+2, ake.ragna...@gmail.com wrote:
> On windows 10 the hello world executable goes from 952kb to 131kb with the ZFP runtime, and on Linux Ubuntu 16.04 the executable goes from 588kb to 11kb. Comparing with hello world application for C++, the executable is 109kb on Windows 10 and 7,5kb in Linux Ubuntu.

If you are concerned about the size of the executable, you should use the -ffunction-sections and -fdata-sections compiler switches and let the linker garbage collect unused symbols away (linker switch --gc-sections). See http://docs.adacore.com/gnat_ugn-docs/html/gnat_ugn/gnat_ugn.html section 6.3.3.

The you maybe don't need the ZFP runtime.

Regards,

Mark L


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

* Re: How to use Zero Footprint runtime with GNAT GPL 2017
  2017-07-17  7:13         ` Mark Lorenzen
@ 2017-07-17  7:27           ` Simon Wright
  2017-07-17 20:52             ` Luke A. Guest
  2017-07-26 21:31             ` joakimds
  2017-07-26 21:28           ` joakimds
  1 sibling, 2 replies; 17+ messages in thread
From: Simon Wright @ 2017-07-17  7:27 UTC (permalink / raw)


Mark Lorenzen <mark.lorenzen@gmail.com> writes:

> On Friday, July 14, 2017 at 11:35:09 PM UTC+2, ake.ragna...@gmail.com wrote:
>> On windows 10 the hello world executable goes from 952kb to 131kb
>> with the ZFP runtime, and on Linux Ubuntu 16.04 the executable goes
>> from 588kb to 11kb. Comparing with hello world application for C++,
>> the executable is 109kb on Windows 10 and 7,5kb in Linux Ubuntu.
>
> If you are concerned about the size of the executable, you should use
> the -ffunction-sections and -fdata-sections compiler switches and let
> the linker garbage collect unused symbols away (linker switch
> --gc-sections). See
> http://docs.adacore.com/gnat_ugn-docs/html/gnat_ugn/gnat_ugn.html
> section 6.3.3.

This works if you are using GNU ld; but not for native Darwin.

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

* Re: How to use Zero Footprint runtime with GNAT GPL 2017
  2017-07-17  7:27           ` Simon Wright
@ 2017-07-17 20:52             ` Luke A. Guest
  2017-07-26 21:29               ` joakimds
  2017-07-26 21:31             ` joakimds
  1 sibling, 1 reply; 17+ messages in thread
From: Luke A. Guest @ 2017-07-17 20:52 UTC (permalink / raw)



>> If you are concerned about the size of the executable, you should use
>> the -ffunction-sections and -fdata-sections compiler switches and let
>> the linker garbage collect unused symbols away (linker switch
>> --gc-sections). See
>> http://docs.adacore.com/gnat_ugn-docs/html/gnat_ugn/gnat_ugn.html
>> section 6.3.3.
> 
> This works if you are using GNU ld; but not for native Darwin.
> 

See
https://stackoverflow.com/questions/24734409/make-error-in-mac-clang-ld-unknown-option-gc-sections

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

* Re: How to use Zero Footprint runtime with GNAT GPL 2017
  2017-07-17  7:13         ` Mark Lorenzen
  2017-07-17  7:27           ` Simon Wright
@ 2017-07-26 21:28           ` joakimds
  1 sibling, 0 replies; 17+ messages in thread
From: joakimds @ 2017-07-26 21:28 UTC (permalink / raw)


> If you are concerned about the size of the executable, you should use the -ffunction-sections and -fdata-sections compiler switches and let the linker garbage collect unused symbols away (linker switch --gc-sections). See http://docs.adacore.com/gnat_ugn-docs/html/gnat_ugn/gnat_ugn.html section 6.3.3.
> 
> The you maybe don't need the ZFP runtime.
> 
> Regards,
> 
> Mark L

Thanks for the suggestion Mark! The Hello world executable goes from 268kb to 87kb.

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

* Re: How to use Zero Footprint runtime with GNAT GPL 2017
  2017-07-17 20:52             ` Luke A. Guest
@ 2017-07-26 21:29               ` joakimds
  0 siblings, 0 replies; 17+ messages in thread
From: joakimds @ 2017-07-26 21:29 UTC (permalink / raw)


> See
> https://stackoverflow.com/questions/24734409/make-error-in-mac-clang-ld-unknown-option-gc-sections

Thanks for the link Luke!


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

* Re: How to use Zero Footprint runtime with GNAT GPL 2017
  2017-07-17  7:27           ` Simon Wright
  2017-07-17 20:52             ` Luke A. Guest
@ 2017-07-26 21:31             ` joakimds
  1 sibling, 0 replies; 17+ messages in thread
From: joakimds @ 2017-07-26 21:31 UTC (permalink / raw)


> This works if you are using GNU ld; but not for native Darwin.

Thanks for the clarification Simon!

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

end of thread, other threads:[~2017-07-26 21:31 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-14  8:34 How to use Zero Footprint runtime with GNAT GPL 2017 joakimds
2017-07-14  8:42 ` Egil H H
2017-07-14  8:58   ` joakimds
2017-07-14 15:41     ` Simon Wright
2017-07-14 21:35       ` ake.ragnar.dahlgren
2017-07-17  7:13         ` Mark Lorenzen
2017-07-17  7:27           ` Simon Wright
2017-07-17 20:52             ` Luke A. Guest
2017-07-26 21:29               ` joakimds
2017-07-26 21:31             ` joakimds
2017-07-26 21:28           ` joakimds
2017-07-14  9:56 ` Mark Lorenzen
2017-07-15 13:16 ` Mr. Man-wai Chang
2017-07-15 16:29   ` Lucretia
2017-07-16 13:39     ` Jacob Sparre Andersen
2017-07-16 15:00       ` Lucretia
2017-07-16 14:17     ` Mr. Man-wai Chang

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