diff mbox series

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

Message ID CABOHX+eZSNyot-vVjxnGTajAFTnS_GwewsBizJ_AhhBGe0P9LQ@mail.gmail.com
State New
Headers show
Series [libphobos] Committed added AArch64 Linux as a supported target. | expand

Commit Message

Iain Buclaw April 23, 2019, 10:59 p.m. UTC
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.

Comments

Andreas Schwab April 24, 2019, 7:32 a.m. UTC | #1
On Apr 24 2019, Iain Buclaw <ibuclaw@gdcproject.org> 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.
Iain Buclaw April 24, 2019, 11:10 a.m. UTC | #2
On Wed, 24 Apr 2019 at 09:33, Andreas Schwab <schwab@linux-m68k.org> wrote:
>
> On Apr 24 2019, Iain Buclaw <ibuclaw@gdcproject.org> 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.
Richard Earnshaw \(lists\) April 25, 2019, 2:32 p.m. UTC | #3
On 24/04/2019 12:10, Iain Buclaw wrote:
> On Wed, 24 Apr 2019 at 09:33, Andreas Schwab <schwab@linux-m68k.org> wrote:
>>
>> On Apr 24 2019, Iain Buclaw <ibuclaw@gdcproject.org> 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)
>      {
>
Iain Buclaw April 25, 2019, 2:45 p.m. UTC | #4
On Thu, 25 Apr 2019 at 16:32, Richard Earnshaw (lists)
<Richard.Earnshaw@arm.com> wrote:
>
> On 24/04/2019 12:10, Iain Buclaw wrote:
> > On Wed, 24 Apr 2019 at 09:33, Andreas Schwab <schwab@linux-m68k.org> wrote:
> >>
> >> On Apr 24 2019, Iain Buclaw <ibuclaw@gdcproject.org> 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.
Jakub Jelinek April 25, 2019, 3:45 p.m. UTC | #5
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
Richard Earnshaw \(lists\) April 25, 2019, 4:25 p.m. UTC | #6
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.
diff mbox series

Patch

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
 	;;