Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <17f3b400-9d10-ec43-a086-e89873f8e8f6@in2p3.fr>
Date: Sun, 5 Nov 2017 21:35:46 +0100
From: Didier Kryn <kryn@...p3.fr>
To: musl@...ts.openwall.com
Subject: Re: Successfull build of gnat-6.3.0 with musl-cross-make

Le 05/11/2017 à 19:01, Rich Felker a écrit :
> On Thu, Nov 02, 2017 at 10:44:13AM +0100, Didier Kryn wrote:
>>      I report the successfull build of the cross-compiler
>> x86_64-musl-gcc-6.3.0 - understanding Ada - on x86_64 Debian Wheezy.
>>
>>      The toolchain for build was gcc-6.3.0 for Linux-Gnu provided by
>> Adacore.The build toolchain to build major version 6 must be at
>> least major version 5.
>>
>>      Of course, the language option must be '--enable-languages=ada,c,c++' .
> This is very interesting! Thanks for the report. As an aside, I know
> there's been some interest in building GHDL, which depends on GNU Ada;
> I'm not sure if this gets us closer to making that work but I suspect
> it might.
>
>>      Three patches were necessary:
>>         gnat63-terminals.diff: removes a #include <termio.h> in a C
>> source file.
>>         gnat63-prj-attr.diff: corrects the layout of a record in an
>> Ada source file to prevent a warning concerning performance.
>>         gnat63-xr_tabls.diff: same as the previous.
> Are the second and third actually necessary, and are they related to
> musl at all? If they're actual improvement regardless of libc, they
> should probably go upstream in gcc. But if they're needed for now to
> make mcm work with ada out of the box, I don't mind including them in
> mcm as a convenience.
     The second and third are meant to prevent a warning because the 
compilation is done with option -Werror. They are only related to 
-Werror. But I think this compiler option is sensible considering this 
is a single-step build.

     The patches might be slightly less intrusive: instead of changing 
the layout of the record, it would be enough to insert a pragma to 
disable the warning. But, frankly, the original layout of the record 
only makes the source slightly more readable: a record in Ada is like a 
struct in C or C++. In this case, the first componant is the name which 
is a string of variable length. It makes sense to put the name first but 
it is better for performance that the fixed-size components of a record 
are placed first. Hence the warning. This is a tool for which 
performance isn't critical; this is why the author didn't take care.

>
>>      Note on static linking:
>>      Compilation of Ada program is often made in one invocation of
>> gnatmake, which calls gcc, gnatbind and gnatlink. By default,
>> gnatmake links everything statically, except the libc (probably a
>> gnuism). If the option -shared is given, then it links everything
>> dynamically. The option -static is ignored by gnatmake.
>>      However, it is possible to produce static executables by
>> invoking gcc -c, gnatbind, andgnatlink, because gnatlink honours the
>> -static option.
>>
>>      I attach the patches in case someone is interested.
>>
>>      I was able to compile a native x86_64-pc-linux-musl-gcc-6.3.0
>> (with the 3 steps) using this cross-compiler for build.
> Seems there's no reason not to static link libc if everything else is
> static too, except for glibc issues with static linking. It might make
> sense to change the default for musl target tuples.
     The problem is that it requires a better understanding of the 
program than I have.

     HTH
                         Didier


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.