From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Clubley Newsgroups: comp.lang.ada Subject: Re: Can I get rid of C libraries dependencies? Date: Wed, 16 Sep 2015 13:44:25 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <0dd03a38-391b-45bc-859c-4ed2c42452e3@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Date: Wed, 16 Sep 2015 13:44:25 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="6029dd4ece9ca563ae2802dd71fd81fd"; logging-data="31877"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/GlMGa6ZX0FhfUpnAJfKq9fo95FGXafL4=" User-Agent: slrn/0.9.9p1 (Linux) Cancel-Lock: sha1:Vv9o/huMXLwYz6T7W2ose0aIg1o= Xref: news.eternal-september.org comp.lang.ada:27777 Date: 2015-09-16T13:44:25+00:00 List-Id: On 2015-09-16, Leff Ivanov wrote: > > What I want to achive is a tiny 2kb binary executable > with a single function called as entry point (which is > defined in Ada and called Main procedure). The pragma > on top let me get rid of the huge RTL code that is written > in Ada. However I'm still getting a lot of code linked > in from C libraries, so... > > 1) Can I get rid of the C code linked in? > 2) What is implemented in thoose C libraries? > 3) Can I use Ada's RTL library without the C > support code, if I use some Restrictions? The basic problem here is that the C API _is_ considered to be the interface to the OS for this kind of thing on Linux/Unix and (these days) probably Windows as well[*]. Unless you call the operating system services directly then at some level either you, or the Ada RTL acting on your behalf, has to call the C API. It is possible to call the OS services directly (once you understand how the interface is implemented for each OS and architecture combination), but is this really a road that it's wise to do down ? Simon. [*] I have a VMS background and it's a lot easier to do this kind of thing there. Unfortunately, I doubt you are running VMS. :-) -- Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP Microsoft: Bringing you 1980s technology to a 21st century world