s-taprop.adb failed to compile for x32: s-taprop.adb:341:29: operator for type "System.Linux.time_t" is not directly vis ible s-taprop.adb:341:29: add with_clause and use_clause for "Linux" which is caused by 2017-09-25 Doug Rupp <rupp@adacore.com> * libgnarl/s-taprop__linux.adb (Base_Monotonic_Clock): New variable. (Compute_Base_Monotonic_Clock): New function. (Timed_Sleep): Adjust to use Base_Monotonic_Clock. (Timed_Delay): Likewise. (Monotonic_Clock): Likewise. * s-oscons-tmplt.c (CLOCK_MONOTONIC): Use on Linux.
Created attachment 42273 [details] Tentative untested fix Hello, Thank you for reporting this. Could you please check that the attached untested patch fixes the issue you are reporting? (or tell me how to reproduce on my x86_64-linux box :-)) Thank you in advance!
.
> Thank you for reporting this. Could you please check that the attached > untested patch fixes the issue you are reporting? (or tell me how to > reproduce on my x86_64-linux box :-)) Thank you in advance! I have essentially the same patch locally: Index: s-linux__x32.ads =================================================================== --- s-linux__x32.ads (revision 253315) +++ s-linux__x32.ads (working copy) @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2013-2017, Free Software Foundation, Inc. -- +-- Copyright (C) 2013-2017, Free Software Foundation, Inc. -- -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- @@ -45,8 +45,9 @@ package System.Linux is -- Time -- ---------- - type time_t is new Long_Long_Integer; - subtype clockid_t is Interfaces.C.int; + subtype suseconds_t is Long_Long_Integer; + subtype time_t is Long_Long_Integer; + subtype clockid_t is Interfaces.C.int; type timespec is record tv_sec : time_t; @@ -56,7 +57,7 @@ package System.Linux is type timeval is record tv_sec : time_t; - tv_usec : Long_Long_Integer; + tv_usec : suseconds_t; end record; pragma Convention (C, timeval); with additional tweaks to make it resemble s-linux.ads more closely.
(In reply to Pierre-Marie de Rodat from comment #1) > Created attachment 42273 [details] > Tentative untested fix > > Hello, > > Thank you for reporting this. Could you please check that the attached I am testing it now. > untested patch fixes the issue you are reporting? (or tell me how to > reproduce on my x86_64-linux box :-)) Thank you in advance! You can install x32 run-time libraries on Ubuntu and configure GCC with --with-multilib-list=m32,m64,mx32
(In reply to H.J. Lu from comment #4) > (In reply to Pierre-Marie de Rodat from comment #1) > > Created attachment 42273 [details] > > Tentative untested fix > > > > Hello, > > > > Thank you for reporting this. Could you please check that the attached > > I am testing it now. It doesn't work: [hjl@gnu-efi-2 rts_x32]$ /export/build/gnu/gcc-x32/build-x86_64-linux/./gcc/xgcc -B/export/build/gnu/gcc-x32/build-x86_64-linux/./gcc/ -B/usr/gcc-8.0.0-x32/x86_64-pc-linux-gnu/bin/ -B/usr/gcc-8.0.0-x32/x86_64-pc-linux-gnu/lib/ -isystem /usr/gcc-8.0.0-x32/x86_64-pc-linux-gnu/include -isystem /usr/gcc-8.0.0-x32/x86_64-pc-linux-gnu/sys-include -c -g -O2 -mx32 -fpic -W -Wall -gnatpg -nostdinc -mx32 s-osinte.adb -o s-osinte.o s-osinte.adb:93:07: warning: ineffective use clause for type "System.Linux.time_t" [hjl@gnu-efi-2 rts_x32]$
(In reply to Eric Botcazou from comment #3) > > Thank you for reporting this. Could you please check that the attached > > untested patch fixes the issue you are reporting? (or tell me how to > > reproduce on my x86_64-linux box :-)) Thank you in advance! > > I have essentially the same patch locally: > > Index: s-linux__x32.ads > =================================================================== > --- s-linux__x32.ads (revision 253315) > +++ s-linux__x32.ads (working copy) > @@ -6,7 +6,7 @@ > -- > -- > -- S p e c > -- > -- > -- > --- Copyright (C) 2013-2017, Free Software Foundation, Inc. > -- > +-- Copyright (C) 2013-2017, Free Software Foundation, Inc. > -- > -- > -- > -- > -- GNARL is free software; you can redistribute it and/or modify it under > -- > @@ -45,8 +45,9 @@ package System.Linux is > -- Time -- > ---------- > > - type time_t is new Long_Long_Integer; > - subtype clockid_t is Interfaces.C.int; > + subtype suseconds_t is Long_Long_Integer; > + subtype time_t is Long_Long_Integer; > + subtype clockid_t is Interfaces.C.int; > > type timespec is record > tv_sec : time_t; > @@ -56,7 +57,7 @@ package System.Linux is > > type timeval is record > tv_sec : time_t; > - tv_usec : Long_Long_Integer; > + tv_usec : suseconds_t; > end record; > pragma Convention (C, timeval); > > with additional tweaks to make it resemble s-linux.ads more closely. I am testing this now.
I think your second test will also fail for the same reason. I suggest you also add the following patchlet: diff --git a/gcc/ada/libgnarl/s-osinte__x32.adb b/gcc/ada/libgnarl/s-osinte__x32.adb index a2874be3d69..477abcc4176 100644 --- a/gcc/ada/libgnarl/s-osinte__x32.adb +++ b/gcc/ada/libgnarl/s-osinte__x32.adb @@ -89,8 +89,6 @@ package body System.OS_Interface is function To_Timespec (D : Duration) return timespec is S : time_t; F : Duration; - - use type System.Linux.time_t; begin S := time_t (Long_Long_Integer (D)); F := D - Duration (S); Unfortunately my Linux distrib does not package a runtime package for x32, so testing will require me to install a VM and so on. I hope you’ll understand that I’ll do that only if things get too complex on your side. Thanks again for your help!
Created attachment 42277 [details] I am testing this patch.
Created attachment 42288 [details] Better fix Let's use this one instead to avoid future problems.
Author: ebotcazou Date: Mon Oct 2 19:38:06 2017 New Revision: 253366 URL: https://gcc.gnu.org/viewcvs?rev=253366&root=gcc&view=rev Log: PR ada/82384 * libgnarl/s-linux__x32.ads (suseconds_t): New subtype. (time_t): Change from derived type to subtype. (timeval): Use suseconds_t for tv_usec. * libgnarl/s-osinte__x32.adb (To_Timespec): Remove use type clause. Modified: trunk/gcc/ada/ChangeLog trunk/gcc/ada/libgnarl/s-linux__x32.ads trunk/gcc/ada/libgnarl/s-osinte__x32.adb
Thanks for reporting the problem.
Yes, and thank you Eric for checking the fix in. :-)