comp.lang.ada
 help / color / mirror / Atom feed
From: Leff Ivanov <droiddermo@gmail.com>
Subject: Re: Can I get rid of C libraries dependencies?
Date: Thu, 17 Sep 2015 01:13:47 -0700 (PDT)
Date: 2015-09-17T01:13:47-07:00	[thread overview]
Message-ID: <af8944a0-bf24-4255-af87-2a1ea34a7e9b@googlegroups.com> (raw)
In-Reply-To: <lyr3lywdey.fsf@pushface.org>

среда, 16 сентября 2015 г., 19:13:11 UTC+3 пользователь Simon Wright написал:
> Leff Ivanov <droiddermo@gmail.com> writes:
> 
> > What I want to achive is a tiny 2kb binary executable 
> 
> Can you tell us a little more about why you need to do this, what OS
> you're using ...

I'm using windows and want to write tiny tools in Ada like I can 
write one in C/C++ using -nostdlib flag and directly linking to
OS specific libraries. The same can be applied to Linux and Mac
OSX as well, but currently I'm focusing on Windows.

If I do "gnatmake -a -f -nostdlib main.adb" I can see that GNAT
actually recompiles a lot of stuff from RTS, like a-except.adb,
s-secsta.abd and etc. So the No_Run_Time pragma cuts off only
a part of Ada RTS, but leaves the rest.

Gnatlink tool with -nostdlib returns a lot of undefined references
to C code, which I want to get rid off. It seems that mostly it is
functions that implements exceptions, like _Unwind_SjLj_Register,
__gnat_personality_sj0 and etc. 

Undefined references to stuff like memmove and memcmp I can simply
fix by linking directly with libmsvcrt.a, so theese functions would
be taked from standard windows msvcrt.dll library. But there's also 
undefined reference to __chkstk_ms, this function seem to check if 
the stack is full. This function is MinGW specific and there is no implementation in standard windows libraries.


  reply	other threads:[~2015-09-17  8:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-16 12:55 Can I get rid of C libraries dependencies? Leff Ivanov
2015-09-16 13:44 ` Simon Clubley
2015-09-16 14:20 ` G.B.
2015-09-16 16:13 ` Simon Wright
2015-09-17  8:13   ` Leff Ivanov [this message]
2015-09-17 10:25     ` Brian Drummond
replies disabled

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