Re: [PATCH, libphobos] Committed added AArch64 Linux as a supported target.

2019-04-25 Thread Richard Earnshaw (lists)
On 25/04/2019 16:45, Jakub Jelinek wrote:
> On Thu, Apr 25, 2019 at 03:32:41PM +0100, Richard Earnshaw (lists) wrote:
>>> --- a/libphobos/libdruntime/core/sys/posix/sys/stat.d
>>> +++ b/libphobos/libdruntime/core/sys/posix/sys/stat.d
>>> @@ -709,10 +709,10 @@ version (CRuntime_Glibc)
>>>  }
>>>  int[2] __unused;
>>>  }
>>> -static if (__USE_FILE_OFFSET64)
>>> +version (D_LP64)
>>>  static assert(stat_t.sizeof == 128);
>>>  else
>>> -static assert(stat_t.sizeof == 128);
>>> +static assert(stat_t.sizeof == 104);
>>
>> I can't be sure just from the context, but 104 looks suspicious.  Maybe
>> that should be 64?
> 
> Why?  Not all struct stat fields are pointers or longs that double for -m64
> vs. -m32.
> 
>   Jakub
> 

I was forgetting that these were byte counts, not bit counts.  Makes
more sense when you realize that...

R.



Re: [PATCH, libphobos] Committed added AArch64 Linux as a supported target.

2019-04-25 Thread Jakub Jelinek
On Thu, Apr 25, 2019 at 03:32:41PM +0100, Richard Earnshaw (lists) wrote:
> > --- a/libphobos/libdruntime/core/sys/posix/sys/stat.d
> > +++ b/libphobos/libdruntime/core/sys/posix/sys/stat.d
> > @@ -709,10 +709,10 @@ version (CRuntime_Glibc)
> >  }
> >  int[2] __unused;
> >  }
> > -static if (__USE_FILE_OFFSET64)
> > +version (D_LP64)
> >  static assert(stat_t.sizeof == 128);
> >  else
> > -static assert(stat_t.sizeof == 128);
> > +static assert(stat_t.sizeof == 104);
> 
> I can't be sure just from the context, but 104 looks suspicious.  Maybe
> that should be 64?

Why?  Not all struct stat fields are pointers or longs that double for -m64
vs. -m32.

Jakub


Re: [PATCH, libphobos] Committed added AArch64 Linux as a supported target.

2019-04-25 Thread Iain Buclaw
On Thu, 25 Apr 2019 at 16:32, Richard Earnshaw (lists)
 wrote:
>
> On 24/04/2019 12:10, Iain Buclaw wrote:
> > On Wed, 24 Apr 2019 at 09:33, Andreas Schwab  wrote:
> >>
> >> On Apr 24 2019, Iain Buclaw  wrote:
> >>
> >>> This patch adds arch64*-*-linux* as a supported libphobos target,
> >>> something that has been passing the testsuite for a while now.
> >>>
> >>> Committed to trunk as r270524.
> >>
> >> That breaks -mabi=ilp32:
> >>
> >> /opt/gcc/gcc-20190424/libphobos/libdruntime/core/sys/posix/sys/stat.d:713:13:
> >>  error: static assert  (104u == 128u) is false
> >>   713 | static assert(stat_t.sizeof == 128);
> >>   | ^
> >> make[8]: *** [Makefile:2047: core/sys/posix/fcntl.lo] Error 1
> >>
> >
> > Confirmed, I've sent fix to upstream and committed as r270541.
> >
> > Tested this on aarch64-linux-gnu, though as I don't have ilp32
> > libraries on my arm64 phone, I can only see that all modules compile
> > down to object code.
> >
> >
> > druntime51365217.patch
> >
> > diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE
> > index 27dfc5fc1d9..9fe51fd5ae9 100644
> > --- a/libphobos/libdruntime/MERGE
> > +++ b/libphobos/libdruntime/MERGE
> > @@ -1,4 +1,4 @@
> > -b43203a134fb5e259ffc1711cc061c6e869b56f6
> > +513652173d6f02206be3ddaa2b6ed0b191ea4e3d
> >
> >  The first line of this file holds the git revision number of the last
> >  merge done from the dlang/druntime repository.
> > diff --git a/libphobos/libdruntime/core/sys/posix/sys/stat.d 
> > b/libphobos/libdruntime/core/sys/posix/sys/stat.d
> > index ab1fcd7b164..963a241f076 100644
> > --- a/libphobos/libdruntime/core/sys/posix/sys/stat.d
> > +++ b/libphobos/libdruntime/core/sys/posix/sys/stat.d
> > @@ -709,10 +709,10 @@ version (CRuntime_Glibc)
> >  }
> >  int[2] __unused;
> >  }
> > -static if (__USE_FILE_OFFSET64)
> > +version (D_LP64)
> >  static assert(stat_t.sizeof == 128);
> >  else
> > -static assert(stat_t.sizeof == 128);
> > +static assert(stat_t.sizeof == 104);
>
> I can't be sure just from the context, but 104 looks suspicious.  Maybe
> that should be 64?
>

Don't think so.  GCC is agreeing with GDC at least on my aarch64-linux
phone, the `sizeof (struct stat)` does genuinely appear to be 104 when
-mabi=ilp32.

-- 
Iain


Re: [PATCH, libphobos] Committed added AArch64 Linux as a supported target.

2019-04-25 Thread Richard Earnshaw (lists)
On 24/04/2019 12:10, Iain Buclaw wrote:
> On Wed, 24 Apr 2019 at 09:33, Andreas Schwab  wrote:
>>
>> On Apr 24 2019, Iain Buclaw  wrote:
>>
>>> This patch adds arch64*-*-linux* as a supported libphobos target,
>>> something that has been passing the testsuite for a while now.
>>>
>>> Committed to trunk as r270524.
>>
>> That breaks -mabi=ilp32:
>>
>> /opt/gcc/gcc-20190424/libphobos/libdruntime/core/sys/posix/sys/stat.d:713:13:
>>  error: static assert  (104u == 128u) is false
>>   713 | static assert(stat_t.sizeof == 128);
>>   | ^
>> make[8]: *** [Makefile:2047: core/sys/posix/fcntl.lo] Error 1
>>
> 
> Confirmed, I've sent fix to upstream and committed as r270541.
> 
> Tested this on aarch64-linux-gnu, though as I don't have ilp32
> libraries on my arm64 phone, I can only see that all modules compile
> down to object code.
> 
> 
> druntime51365217.patch
> 
> diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE
> index 27dfc5fc1d9..9fe51fd5ae9 100644
> --- a/libphobos/libdruntime/MERGE
> +++ b/libphobos/libdruntime/MERGE
> @@ -1,4 +1,4 @@
> -b43203a134fb5e259ffc1711cc061c6e869b56f6
> +513652173d6f02206be3ddaa2b6ed0b191ea4e3d
>  
>  The first line of this file holds the git revision number of the last
>  merge done from the dlang/druntime repository.
> diff --git a/libphobos/libdruntime/core/sys/posix/sys/stat.d 
> b/libphobos/libdruntime/core/sys/posix/sys/stat.d
> index ab1fcd7b164..963a241f076 100644
> --- a/libphobos/libdruntime/core/sys/posix/sys/stat.d
> +++ b/libphobos/libdruntime/core/sys/posix/sys/stat.d
> @@ -709,10 +709,10 @@ version (CRuntime_Glibc)
>  }
>  int[2] __unused;
>  }
> -static if (__USE_FILE_OFFSET64)
> +version (D_LP64)
>  static assert(stat_t.sizeof == 128);
>  else
> -static assert(stat_t.sizeof == 128);
> +static assert(stat_t.sizeof == 104);

I can't be sure just from the context, but 104 looks suspicious.  Maybe
that should be 64?

R.

>  }
>  else version (SPARC64)
>  {
> 



Re: [PATCH, libphobos] Committed added AArch64 Linux as a supported target.

2019-04-24 Thread Iain Buclaw
On Wed, 24 Apr 2019 at 09:33, Andreas Schwab  wrote:
>
> On Apr 24 2019, Iain Buclaw  wrote:
>
> > This patch adds arch64*-*-linux* as a supported libphobos target,
> > something that has been passing the testsuite for a while now.
> >
> > Committed to trunk as r270524.
>
> That breaks -mabi=ilp32:
>
> /opt/gcc/gcc-20190424/libphobos/libdruntime/core/sys/posix/sys/stat.d:713:13: 
> error: static assert  (104u == 128u) is false
>   713 | static assert(stat_t.sizeof == 128);
>   | ^
> make[8]: *** [Makefile:2047: core/sys/posix/fcntl.lo] Error 1
>

Confirmed, I've sent fix to upstream and committed as r270541.

Tested this on aarch64-linux-gnu, though as I don't have ilp32
libraries on my arm64 phone, I can only see that all modules compile
down to object code.

-- 
Iain
---
diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE
index 27dfc5fc1d9..9fe51fd5ae9 100644
--- a/libphobos/libdruntime/MERGE
+++ b/libphobos/libdruntime/MERGE
@@ -1,4 +1,4 @@
-b43203a134fb5e259ffc1711cc061c6e869b56f6
+513652173d6f02206be3ddaa2b6ed0b191ea4e3d
 
 The first line of this file holds the git revision number of the last
 merge done from the dlang/druntime repository.
diff --git a/libphobos/libdruntime/core/sys/posix/sys/stat.d b/libphobos/libdruntime/core/sys/posix/sys/stat.d
index ab1fcd7b164..963a241f076 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/stat.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/stat.d
@@ -709,10 +709,10 @@ version (CRuntime_Glibc)
 }
 int[2] __unused;
 }
-static if (__USE_FILE_OFFSET64)
+version (D_LP64)
 static assert(stat_t.sizeof == 128);
 else
-static assert(stat_t.sizeof == 128);
+static assert(stat_t.sizeof == 104);
 }
 else version (SPARC64)
 {


Re: [PATCH, libphobos] Committed added AArch64 Linux as a supported target.

2019-04-24 Thread Andreas Schwab
On Apr 24 2019, Iain Buclaw  wrote:

> This patch adds arch64*-*-linux* as a supported libphobos target,
> something that has been passing the testsuite for a while now.
>
> Committed to trunk as r270524.

That breaks -mabi=ilp32:

/opt/gcc/gcc-20190424/libphobos/libdruntime/core/sys/posix/sys/stat.d:713:13: 
error: static assert  (104u == 128u) is false
  713 | static assert(stat_t.sizeof == 128);
  | ^
make[8]: *** [Makefile:2047: core/sys/posix/fcntl.lo] Error 1

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


[PATCH, libphobos] Committed added AArch64 Linux as a supported target.

2019-04-23 Thread Iain Buclaw
Hi,

This patch adds arch64*-*-linux* as a supported libphobos target,
something that has been passing the testsuite for a while now.

Committed to trunk as r270524.

-- 
Iain
---
libphobos/ChangeLog:

2019-04-24  Iain Buclaw  

* configure.tgt: Add aarch64*-*-linux* as a supported target.

---
diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt
index a53a3c3c3be..b2fe849752c 100644
--- a/libphobos/configure.tgt
+++ b/libphobos/configure.tgt
@@ -23,6 +23,9 @@
 # broken systems.  More targets shall be added after testing.
 LIBPHOBOS_SUPPORTED=no
 case "${target}" in
+  aarch64*-*-linux*)
+	LIBPHOBOS_SUPPORTED=yes
+	;;
   arm*-*-linux*)
 	LIBPHOBOS_SUPPORTED=yes
 	;;