From: Didier Kryn <kryn@in2p3.fr>
To: musl@lists.openwall.com
Subject: Successfull build of gnat-6.3.0 with musl-cross-make
Date: Thu, 2 Nov 2017 10:44:13 +0100 [thread overview]
Message-ID: <69c03d16-1946-d4e3-f909-2bd2196afe97@in2p3.fr> (raw)
[-- Attachment #1: Type: text/plain, Size: 1372 bytes --]
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++' .
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.
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.
Didier
[-- Attachment #2: gnat63-terminals.diff --]
[-- Type: text/x-patch, Size: 597 bytes --]
diff -rupN gcc-6.3.0-A/gcc/ada/terminals.c gcc-6.3.0-B/gcc/ada/terminals.c
--- gcc-6.3.0-A/gcc/ada/terminals.c 2016-02-12 00:53:54.000000000 +0100
+++ gcc-6.3.0-B/gcc/ada/terminals.c 2017-10-13 08:17:35.000000000 +0200
@@ -1068,12 +1068,6 @@ __gnat_setup_winsize (void *desc, int ro
#include <stdio.h>
#include <stdlib.h>
-/* On some system termio is either absent or including it will disable termios
- (HP-UX) */
-#if !defined (__hpux__) && !defined (BSD) && !defined (__APPLE__) \
- && !defined (__rtems__)
-# include <termio.h>
-#endif
#include <sys/ioctl.h>
#include <termios.h>
[-- Attachment #3: gnat63-prj-attr.diff --]
[-- Type: text/x-patch, Size: 932 bytes --]
diff -rupN gcc-6.3.0-A/gcc/ada/prj-attr.ads gcc-6.3.0-B/gcc/ada/prj-attr.ads
--- gcc-6.3.0-A/gcc/ada/prj-attr.ads 2014-08-04 11:55:01.000000000 +0200
+++ gcc-6.3.0-B/gcc/ada/prj-attr.ads 2017-11-01 20:31:11.000000000 +0100
@@ -86,9 +86,6 @@ package Prj.Attr is
Positive range 1 .. Max_Attribute_Name_Length;
type Attribute_Data (Name_Length : Attribute_Name_Length := 1) is record
- Name : String (1 .. Name_Length);
- -- The name of the attribute
-
Attr_Kind : Defined_Attribute_Kind;
-- The type of the attribute
@@ -111,6 +108,8 @@ package Prj.Attr is
-- The value of the attribute when referenced if the attribute has not
-- yet been declared.
+ Name : String (1 .. Name_Length);
+ -- The name of the attribute
end record;
-- Name and characteristics of an attribute in a package registered
-- explicitly with Register_New_Package (see below).
[-- Attachment #4: gnat63-xr_tabls.diff --]
[-- Type: text/x-patch, Size: 1451 bytes --]
diff -rupN gcc-6.3.0-A/gcc/ada/xr_tabls.ads gcc-6.3.0-B/gcc/ada/xr_tabls.ads
--- gcc-6.3.0-A/gcc/ada/xr_tabls.ads 2014-08-01 11:38:48.000000000 +0200
+++ gcc-6.3.0-B/gcc/ada/xr_tabls.ads 2017-10-13 08:50:24.000000000 +0200
@@ -292,12 +292,11 @@ package Xr_Tabls is
private
type Project_File (Src_Dir_Length, Obj_Dir_Length : Natural) is record
- Src_Dir : String (1 .. Src_Dir_Length);
Src_Dir_Index : Integer;
-
- Obj_Dir : String (1 .. Obj_Dir_Length);
Obj_Dir_Index : Integer;
Last_Obj_Dir_Start : Natural;
+ Src_Dir : String (1 .. Src_Dir_Length);
+ Obj_Dir : String (1 .. Obj_Dir_Length);
end record;
type Project_File_Ptr is access all Project_File;
@@ -364,7 +363,6 @@ private
type Declaration_Record (Symbol_Length : Natural) is record
Key : Cst_String_Access;
- Symbol : String (1 .. Symbol_Length);
Decl : Reference;
Is_Parameter : Boolean := False; -- True if entity is subprog param
Decl_Type : Character;
@@ -374,6 +372,7 @@ private
Match : Boolean := False;
Par_Symbol : Declaration_Reference := null;
Next : Declaration_Reference := null;
+ Symbol : String (1 .. Symbol_Length);
end record;
-- The lists of referenced (Body_Ref, Ref_Ref and Modif_Ref) are
-- kept unsorted until the results needs to be printed. This saves
next reply other threads:[~2017-11-02 9:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-02 9:44 Didier Kryn [this message]
2017-11-05 18:01 ` Rich Felker
2017-11-05 20:35 ` Didier Kryn
2017-11-30 16:30 ` Building musl-cross-make with gnat in musl environement Didier Kryn
2017-11-30 17:06 ` Rich Felker
2017-12-01 7:31 ` Didier Kryn
2017-12-13 9:29 ` Didier Kryn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=69c03d16-1946-d4e3-f909-2bd2196afe97@in2p3.fr \
--to=kryn@in2p3.fr \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).