diff mbox

Please include ada-hurd.diff upstream (try2)

Message ID 20160504153407.GG2861@var.bordeaux.inria.fr
State New
Headers show

Commit Message

Samuel Thibault May 4, 2016, 3:34 p.m. UTC
Samuel Thibault, on Wed 04 May 2016 17:29:48 +0200, wrote:
> The gcc-6 build failed. I see that one of the change is:
> 
> -   --  From: /usr/include/unistd.h __getpagesize or getpagesize??
> -   function Get_Page_Size return int;
> +   --  From: /usr/include/i386-gnu/bits/shm.h __getpagesize or getpagesize??
> +   function Get_Page_Size return size_t;
> +   function Get_Page_Size return Address;
> 
> Why using size_t and Address?  Other OSes use int, and the prototype for
> getpagesize is returning int.
> 
> Also, don't use the __ versions of the glibc functions, they are
> internal aliases, the API is without __.

I.e. the proposed change below.

Samuel


2016-05-04  Samuel Thibault  <samuel.thibault@ens-lyon.org>

* s-osinte-gnu.ads: Make Get_Page_Size return int, and make it use
getpagesize instead of __getpagesize.

Comments

Arnaud Charlet May 4, 2016, 4:02 p.m. UTC | #1
> 2016-05-04  Samuel Thibault  <samuel.thibault@ens-lyon.org>
> 
> * s-osinte-gnu.ads: Make Get_Page_Size return int, and make it use
> getpagesize instead of __getpagesize.
> 
> --- a/src/gcc/ada/s-osinte-gnu.ads
> +++ b/src/gcc/ada/s-osinte-gnu.ads
> @@ -344,10 +344,9 @@ package System.OS_Interface is
>     --  returns the stack base of the specified thread. Only call this
>     function
>     --  when Stack_Base_Available is True.
>  
> -   --  From: /usr/include/i386-gnu/bits/shm.h __getpagesize or
> getpagesize??
> -   function Get_Page_Size return size_t;
> -   function Get_Page_Size return Address;
> -   pragma Import (C, Get_Page_Size, "__getpagesize");
> +   --  From: /usr/include/i386-gnu/bits/shm.h
> +   function Get_Page_Size return int;
> +   pragma Import (C, Get_Page_Size, "getpagesize");
>     --  Returns the size of a page
>  
>     --  From /usr/include/i386-gnu/bits/mman.h

Yes, something like the above would be needed to bring the old patch on par
with GCC 6. Above patch is OK with me, assuming testing is OK.

Arno
Svante Signell May 4, 2016, 4:43 p.m. UTC | #2
On Wed, 2016-05-04 at 17:34 +0200, Samuel Thibault wrote:
> Samuel Thibault, on Wed 04 May 2016 17:29:48 +0200, wrote:
> > The gcc-6 build failed. I see that one of the change is:
> > 
> > -   --  From: /usr/include/unistd.h __getpagesize or getpagesize??
> > -   function Get_Page_Size return int;
> > +   --  From: /usr/include/i386-gnu/bits/shm.h __getpagesize or
> > getpagesize??
> > +   function Get_Page_Size return size_t;
> > +   function Get_Page_Size return Address;
> > 
> > Why using size_t and Address?  Other OSes use int, and the
> > prototype for
> > getpagesize is returning int.
> > 
> > Also, don't use the __ versions of the glibc functions, they are
> > internal aliases, the API is without __.
> 
> I.e. the proposed change below.
> 
> Samuel
> 
> 
> 2016-05-04  Samuel Thibault  <samuel.thibault@ens-lyon.org>
> 
> * s-osinte-gnu.ads: Make Get_Page_Size return int, and make it
> usehome/srs/DEBs/gcc-5/gcc-5-5.3.1/debian/patches/ada-hurd.diff
> getpagesize instead of __getpagesize.
> 
> --- a/src/gcc/ada/s-osinte-gnu.ads
> +++ b/src/gcc/ada/s-osinte-gnu.ads
> @@ -344,10 +344,9 @@ package System.OS_Interface is
>     --  returns the stack base of the specified thread. Only call
> this function
>     --  when Stack_Base_Available is True.
>  
> -   --  From: /usr/include/i386-gnu/bits/shm.h __getpagesize or
> getpagesize??
> -   function Get_Page_Size return size_t;
> -   function Get_Page_Size return Address;
> -   pragma Import (C, Get_Page_Size, "__getpagesize");
> +   --  From: /usr/include/i386-gnu/bits/shm.h
> +   function Get_Page_Size return int;
> +   pragma Import (C, Get_Page_Size, "getpagesize");
>     --  Returns the size of a page
>  
>     --  From /usr/include/i386-gnu/bits/mman.h

I thought I did change that, but apparently not. I did such a change,
but it was probably somewhere else. Please submit your patch upstream
and to Debian.

Thanks!
Svante Signell May 4, 2016, 5:43 p.m. UTC | #3
On Wed, 2016-05-04 at 18:43 +0200, Svante Signell wrote:
> OnSamuel Thibault, on Wed 04 May 2016 17:29:48 +0200, wrote:
> > 
> > > -   --  From: /usr/include/unistd.h __getpagesize or
> > > getpagesize??
> > > -   function Get_Page_Size return int;
> > > +   --  From: /usr/include/i386-gnu/bits/shm.h __getpagesize or
> > > getpagesize??
> > > +   function Get_Page_Size return size_t;
> > > +   function Get_Page_Size return Address;
> > > 
> > > Why using size_t and Address?  Other OSes use int, and the
> > > prototype for
> > > getpagesize is returning int.
> > > 
> > > Also, don't use the __ versions of the glibc functions, they are
> > > internal aliases, the API is without __.
> > > 
> > 
> I thought I did change that, but apparently not. I did such a change,
> but it was probably somewhere else. Please submit your patch upstream
> and to Debian.

No it was not somewhere else. I did change that, see Debian bug
#811063. I even built gcc-6 to make sure everything was OK. And still
it did not get into the updated patch, strange.

May I comment on Debian way of apt-get source gcc-*: Doing that does
not unpack the sources, neither does it apply the patches, you have to
unpack and patch before you can change sources and update patches. Iv'e
patched the sources several times and still find that the updated
patches are not included in the next build. Really confusing.

Thanks!
Eric Botcazou May 4, 2016, 7:17 p.m. UTC | #4
> I.e. the proposed change below.

Applied on mainline and 6 branch.  Please post patches as attachments instead 
of plain text though, this avoids nasty surprises from mail readers.
Samuel Thibault May 4, 2016, 9:06 p.m. UTC | #5
Svante Signell, on Wed 04 May 2016 19:43:27 +0200, wrote:
> May I comment on Debian way of apt-get source gcc-*: Doing that does
> not unpack the sources, neither does it apply the patches, you have to
> unpack and patch before you can change sources and update patches. Iv'e
> patched the sources several times and still find that the updated
> patches are not included in the next build. Really confusing.

Did you read debian/README.source?

Samuel
Svante Signell May 4, 2016, 9:25 p.m. UTC | #6
On Wed, 2016-05-04 at 23:06 +0200, Samuel Thibault wrote:
> Svante Signell, on Wed 04 May 2016 19:43:27 +0200, wrote:
> > May I comment on Debian way of apt-get source gcc-*: Doing that
> > does
> > not unpack the sources, neither does it apply the patches, you have
> > to
> > unpack and patch before you can change sources and update patches.
> > Iv'e
> > patched the sources several times and still find that the updated
> > patches are not included in the next build. Really confusing.
> 
> Did you read debian/README.source?

Now I have read it, but still cannot find a convincing reason for doing
things this way, sorry! Matthias, why? There should be very strong
arguments for the present procedure.
Samuel Thibault May 4, 2016, 9:28 p.m. UTC | #7
Svante Signell, on Wed 04 May 2016 23:25:28 +0200, wrote:
> On Wed, 2016-05-04 at 23:06 +0200, Samuel Thibault wrote:
> > Svante Signell, on Wed 04 May 2016 19:43:27 +0200, wrote:
> > > May I comment on Debian way of apt-get source gcc-*: Doing that
> > > does
> > > not unpack the sources, neither does it apply the patches, you have
> > > to
> > > unpack and patch before you can change sources and update patches.
> > > Iv'e
> > > patched the sources several times and still find that the updated
> > > patches are not included in the next build. Really confusing.
> > 
> > Did you read debian/README.source?
> 
> Now I have read it, but still cannot find a convincing reason for doing
> things this way, sorry! Matthias, why? There should be very strong
> arguments for the present procedure.

See rules.patch. You can't get this behavior with the simple dpkg
patching.

Samuel
diff mbox

Patch

--- a/src/gcc/ada/s-osinte-gnu.ads
+++ b/src/gcc/ada/s-osinte-gnu.ads
@@ -344,10 +344,9 @@  package System.OS_Interface is
    --  returns the stack base of the specified thread. Only call this function
    --  when Stack_Base_Available is True.
 
-   --  From: /usr/include/i386-gnu/bits/shm.h __getpagesize or getpagesize??
-   function Get_Page_Size return size_t;
-   function Get_Page_Size return Address;
-   pragma Import (C, Get_Page_Size, "__getpagesize");
+   --  From: /usr/include/i386-gnu/bits/shm.h
+   function Get_Page_Size return int;
+   pragma Import (C, Get_Page_Size, "getpagesize");
    --  Returns the size of a page
 
    --  From /usr/include/i386-gnu/bits/mman.h