Thomas Schwinge | 16 Jun 2012 16:42
Gravatar

[PATCH] GCC Ada/GNAT configuration for GNU/Hurd

Hi!

Here is a patch that adds a basic GCC Ada/GNAT configuration for x86
GNU/Hurd.  This has originally been created by Svante Signell for use
with Debian's GCC 4.6 package, and now I have ported it to trunk, and
also applied some further changes.

2012-06-16  Svante Signell  <svante.signell <at> telia.com>
	    Thomas Schwinge  <thomas <at> codesourcery.com>

gcc/ada/
	* gcc-interface/Makefile.in: Add configuration for x86 GNU/Hurd.
	* gsocket.h [__GNU__] (Has_Sockaddr_Len): #define to 1.
	* s-oscons-tmplt.c: Add checks for __GNU__ next to several __linux__
	and linux conditionals.
	* terminals.c [__GNU__]: Don't #include <termio.h>.  #define USE_GETPT.
	* s-osinte-gnu.ads: New file.
	* s-taprop-gnu.adb: Likewise.

There is still room for improvement (and I plan to work on that), but the
test results look very good already, so I'd like to check this in, OK?

                    === acats Summary ===
    # of expected passes            2311
    # of unexpected failures        9
    *** FAILURES: c23003b c23003g c23003i c52103x c52104x c52104y cb1010a cb1010c cb1010d 

                    === gnat Summary ===
    
    # of expected passes            1101
(Continue reading)

Arnaud Charlet | 18 Jun 2012 12:23
Favicon

Re: [PATCH] GCC Ada/GNAT configuration for GNU/Hurd

> Here is a patch that adds a basic GCC Ada/GNAT configuration for x86
> GNU/Hurd.  This has originally been created by Svante Signell for use
> with Debian's GCC 4.6 package, and now I have ported it to trunk, and
> also applied some further changes.
> 
> 2012-06-16  Svante Signell  <svante.signell <at> telia.com>
> 	    Thomas Schwinge  <thomas <at> codesourcery.com>
> 
> gcc/ada/
> 	* gcc-interface/Makefile.in: Add configuration for x86 GNU/Hurd.
> 	* gsocket.h [__GNU__] (Has_Sockaddr_Len): #define to 1.
> 	* s-oscons-tmplt.c: Add checks for __GNU__ next to several __linux__
> 	and linux conditionals.
> 	* terminals.c [__GNU__]: Don't #include <termio.h>.  #define USE_GETPT.
> 	* s-osinte-gnu.ads: New file.
> 	* s-taprop-gnu.adb: Likewise.

Well, the main question is: who is volunteering to maintain this code
and fix it when things break?

Also, is s-taprop-gnu.adb really necessary? Assuming GNU Hurd provides
a posix pthread interface, then you should be using s-taprop-posix.adb,
NOT s-taprop-gnu.adb

Another comment:

> --- a/gcc/ada/s-oscons-tmplt.c
> +++ b/gcc/ada/s-oscons-tmplt.c
>  <at>  <at>  -80,7 +80,7  <at>  <at>  pragma Style_Checks ("M32766");
>  
(Continue reading)

Thomas Schwinge | 18 Jun 2012 12:44
Gravatar

Re: [PATCH] GCC Ada/GNAT configuration for GNU/Hurd

Hi!

On Mon, 18 Jun 2012 12:23:47 +0200, Arnaud Charlet <charlet <at> adacore.com> wrote:
> > Here is a patch that adds a basic GCC Ada/GNAT configuration for x86
> > GNU/Hurd.  This has originally been created by Svante Signell for use
> > with Debian's GCC 4.6 package, and now I have ported it to trunk, and
> > also applied some further changes.
> > 
> > 2012-06-16  Svante Signell  <svante.signell <at> telia.com>
> > 	    Thomas Schwinge  <thomas <at> codesourcery.com>
> > 
> > gcc/ada/
> > 	* gcc-interface/Makefile.in: Add configuration for x86 GNU/Hurd.
> > 	* gsocket.h [__GNU__] (Has_Sockaddr_Len): #define to 1.
> > 	* s-oscons-tmplt.c: Add checks for __GNU__ next to several __linux__
> > 	and linux conditionals.
> > 	* terminals.c [__GNU__]: Don't #include <termio.h>.  #define USE_GETPT.
> > 	* s-osinte-gnu.ads: New file.
> > 	* s-taprop-gnu.adb: Likewise.
> 
> Well, the main question is: who is volunteering to maintain this code
> and fix it when things break?

I'm available; I also maintain other GNU/Hurd toolchain bits.

> Also, is s-taprop-gnu.adb really necessary? Assuming GNU Hurd provides
> a posix pthread interface, then you should be using s-taprop-posix.adb,
> NOT s-taprop-gnu.adb

Thanks for the suggestion, I'll look into that.
(Continue reading)

Arnaud Charlet | 18 Jun 2012 12:46
Favicon

Re: [PATCH] GCC Ada/GNAT configuration for GNU/Hurd

> > Another comment:
> > 
> > > --- a/gcc/ada/s-oscons-tmplt.c
> > > +++ b/gcc/ada/s-oscons-tmplt.c
> > >  <at>  <at>  -80,7 +80,7  <at>  <at>  pragma Style_Checks ("M32766");
> > >  
> > >  /* Feature macro definitions */
> > >  
> > > -#if defined (__linux__) && !defined (_XOPEN_SOURCE)
> > > +#if (defined (__linux__) || defined (__GNU__)) && !defined
> > > (_XOPEN_SOURCE)
> > >  /** For Linux _XOPEN_SOURCE must be defined, otherwise IOV_MAX is not
> > >  defined
> > >   **/
> > >  #define _XOPEN_SOURCE 500
> > 
> > You need to update the comment here, since the section so far only
> > applied to GNU/Linux and not GNU/Hurd.
> 
> In fact, should that perhaps (unverified) simply say »For glibc,
> _XOPEN_SOURCE must be defined [...]« -- or is this code meant to be
> usable on GNU/Linux with a C library different from glibc?

Posibly yes. Thomas (Quinot), any comment on the above?

Arno

Thomas Quinot | 8 Aug 2012 13:08
Favicon

Re: [PATCH] GCC Ada/GNAT configuration for GNU/Hurd

* Arnaud Charlet, 2012-06-18 :

> > > > -#if defined (__linux__) && !defined (_XOPEN_SOURCE)
> > > > +#if (defined (__linux__) || defined (__GNU__)) && !defined
> > > > (_XOPEN_SOURCE)
> > > >  /** For Linux _XOPEN_SOURCE must be defined, otherwise IOV_MAX is not
> > > >  defined
> > > >   **/
> > > >  #define _XOPEN_SOURCE 500
> > > 
> > > You need to update the comment here, since the section so far only
> > > applied to GNU/Linux and not GNU/Hurd.
> > 
> > In fact, should that perhaps (unverified) simply say »For glibc,
> > _XOPEN_SOURCE must be defined [...]« -- or is this code meant to be
> > usable on GNU/Linux with a C library different from glibc?
> 
> Posibly yes. Thomas (Quinot), any comment on the above?

No strong opinion either way. What is important is that the comment be
consistent with what we actually test. If we want the comment to say
"For glibc, blah..." then we need to change the test to something that
actually tests for glibc.

Thomas.

--

-- 
Thomas Quinot, Ph.D. ** quinot <at> adacore.com ** Senior Software Engineer
               AdaCore -- Paris, France -- New York, USA

(Continue reading)

Svante Signell | 18 Jun 2012 21:47
Picon

Re: [PATCH] GCC Ada/GNAT configuration for GNU/Hurd

On Mon, 2012-06-18 at 12:23 +0200, Arnaud Charlet wrote:
> > Here is a patch that adds a basic GCC Ada/GNAT configuration for x86
> > GNU/Hurd.  This has originally been created by Svante Signell for use
> > with Debian's GCC 4.6 package, and now I have ported it to trunk, and
> > also applied some further changes.
> > 
> > 2012-06-16  Svante Signell  <svante.signell <at> telia.com>
> > 	    Thomas Schwinge  <thomas <at> codesourcery.com>
> > 
> > gcc/ada/
> > 	* gcc-interface/Makefile.in: Add configuration for x86 GNU/Hurd.
> > 	* gsocket.h [__GNU__] (Has_Sockaddr_Len): #define to 1.
> > 	* s-oscons-tmplt.c: Add checks for __GNU__ next to several __linux__
> > 	and linux conditionals.
> > 	* terminals.c [__GNU__]: Don't #include <termio.h>.  #define USE_GETPT.
> > 	* s-osinte-gnu.ads: New file.
> > 	* s-taprop-gnu.adb: Likewise.
> 
> Well, the main question is: who is volunteering to maintain this code
> and fix it when things break?
> 
> Also, is s-taprop-gnu.adb really necessary? Assuming GNU Hurd provides
> a posix pthread interface, then you should be using s-taprop-posix.adb,
> NOT s-taprop-gnu.adb

Hi, I tried with s-taprop-posix.adb earlier (among many tries), but
GNU/Hurd does not seem to be fully POSIX pthread compliant yet,
unfortunately. At least to my findings.

(Continue reading)

Arnaud Charlet | 18 Jun 2012 21:51
Favicon

Re: [PATCH] GCC Ada/GNAT configuration for GNU/Hurd

> Hi, I tried with s-taprop-posix.adb earlier (among many tries), but
> GNU/Hurd does not seem to be fully POSIX pthread compliant yet,
> unfortunately. At least to my findings.

Well, would be good to understnad in more details what's missing.

Some trivial missing wrappers are better put in s-osinte-gnu to still allow
usage/sharing of s-taprop-posix.adb

Arno


Gmane