From: Noel Duffy <hobcraft-usenet@yahooxtra.co.nz>
Subject: Differences between gnat 4.4.5 and 4.5.1
Date: Thu, 10 Mar 2011 06:01:53 +0000 (UTC)
Date: 2011-03-10T06:01:53+00:00 [thread overview]
Message-ID: <il9pgg$lvn$1@news.eternal-september.org> (raw)
I recently started learning Ada using Fedora 14 and gcc-gnat 4.5.1 as my
development environment and a copy of John Barne's book. I have another
computer on which I installed Debian Squeeze and gcc-gnat-4.4.5. Both
versions of gcc-gnat (I think it's gcc-gnat, the man pages describe it as
GNU gnat) are the default versions from the distribution repositories.
However, I noticed some differences in the generated executables created
by these two compilers and I thought it worth investigating. The
following (admittedly silly) program demonstrates the issue:
--
with Ada.Strings.Wide_Unbounded; use Ada.Strings.Wide_Unbounded;
with Ada.Text_IO;
procedure Hello is
N:Unbounded_Wide_String;
begin
Ada.Text_IO.Put_Line ("Hello World");
end Hello;
--
I compile on both environments with this command:
gnatmake -f -Os hello.adb -largs -s
On Fedora 14, the generated program looks like this:
$ ls -l hello
-rwxrwxr-x. 1 noeld noeld 36352 Mar 10 18:08 hello
On Debian, I see:
$ ls -l hello
-rwxr-xr-x 1 noeld noeld 13728 Mar 10 18:15 hello
I only notice this disparity in size when my programs use unbounded
strings. I develop using dynamic languages like PHP and Python to earn a
living so I use unbounded strings in pretty much everything. I compiled
some larger programs and the size disparity seems to remain relatively
fixed. E.g, I have one program whose executable is 110k on Fedora but 83k
on Debian. Both compilers produce dynamically linked executable programs.
The programs all work equally well on both platforms.
I wonder whether what I am seeing is a result of a difference in gcc-gnat
version, a difference in distribution packaging, or possibly a
combination of both. Is there anyone using Fedora here who could possibly
shed any light on this?
I must say that Ada development on Debian looks much nicer than Fedora:
GPS is packaged along with GTK and POSIX bindings, and not forgetting the
Ada standard in html.
next reply other threads:[~2011-03-10 6:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-10 6:01 Noel Duffy [this message]
2011-03-10 13:48 ` Differences between gnat 4.4.5 and 4.5.1 Julian Leyh
2011-03-10 21:32 ` Mart van de Wege
2011-03-10 21:39 ` Ludovic Brenta
2011-03-11 9:16 ` Mart van de Wege
2011-03-20 20:11 ` Ludovic Brenta
2011-03-21 7:05 ` Noel Duffy
2011-03-21 7:52 ` Ludovic Brenta
2011-03-10 21:42 ` Noel Duffy
2011-03-10 21:36 ` Noel Duffy
2011-03-21 8:35 ` Dmitry A. Kazakov
2011-03-21 10:16 ` Simon Wright
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox