Re: [PATCH] netbsd EABI support

2019-06-14 Thread Richard Earnshaw (lists)
On 12/06/2019 17:19, co...@sdf.org wrote:
> I think copyright assignment is done. Thanks for bearing with me.
> 
> I noticed the version I submitted in April is missing some changes we
> discussed on October 2018.
> 
> I took the patch from then and removed -matpcs too, the unnecessary
> change to libgcc t-netbsd (which is the OABI configuration anyway), and
> some whitespace git warned about.
> 
> Added the change to libatomic ifunc usage, since we recently claim ifunc
> support on netbsd.
> (Got lost in https://gcc.gnu.org/ml/gcc-patches/2019-04/msg00290.html -
> that one is my fault for submitting patches badly)
> 
> 
> Matt Thomas 
> matthew green 
> Nick Hudson 
> Maya Rashish 
> 

Thanks.  I've made a couple of minor tweaks and committed the attached.
 Thanks for posting all this and thanks for bearing with us while we
sorted out the copyright issues.

R.

> gcc/ChangeLog:
> 
>   * config.gcc (arm*-*-netbsdelf*) Add support for EABI configuration
>   * config.host (arm*-*-netbsd*): Build driver-arm.o
>   * config/arm/netbsd-eabi.h: New file.
>   * config/arm/netbsd-elf.h: Don't pass -matpcs unconditionally.
>   * config/netbsd-elf.h: Define SUBTARGET_EXTRA_SPECS.
> 
> libgcc/ChangeLog:
> 
>   * config.host (arm*-*-netbsdelf*): Add support for EABI configuration
>   * config/arm/t-netbsd: LIB1ASMFUNCS: Append to existing set.
>HOST_LIBGCC2_CFLAGS: workaround possible bug
>   * config/arm/t-netbsd-eabi: New file.
> 
> libatomic/ChangeLog:
> * configure.tgt: Exclude arm*-*-netbsd* from try_ifunc.
> 
> 
> 
> ---
>  gcc/config.gcc  | 29 +-
>  gcc/config.host |  2 +-
>  gcc/config/arm/netbsd-eabi.h| 97 +
>  gcc/config/arm/netbsd-elf.h |  3 +-
>  gcc/config/netbsd-elf.h | 14 +
>  libatomic/configure.tgt |  2 +-
>  libgcc/config.host  | 11 +++-
>  libgcc/config/arm/t-netbsd  |  8 +++
>  libgcc/config/arm/t-netbsd-eabi | 18 ++
>  9 files changed, 177 insertions(+), 7 deletions(-)
>  create mode 100644 gcc/config/arm/netbsd-eabi.h
>  create mode 100644 libgcc/config/arm/t-netbsd-eabi
> 
> diff --git a/gcc/config.gcc b/gcc/config.gcc
> index 6b00c387247..9fe57f4c7de 100644
> --- a/gcc/config.gcc
> +++ b/gcc/config.gcc
> @@ -1159,10 +1159,33 @@ arm*-*-freebsd*)# ARM FreeBSD EABI
>   with_tls=${with_tls:-gnu}
>   ;;
>  arm*-*-netbsdelf*)
> - tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h arm/aout.h 
> ${tm_file} arm/netbsd-elf.h"
> - extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
> - tmake_file="${tmake_file} arm/t-arm"
>   target_cpu_cname="strongarm"
> + tmake_file="${tmake_file} arm/t-arm"
> + tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h"
> + extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
> + case ${target} in
> + arm*eb-*) tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" ;;
> + esac
> + case ${target} in
> + arm*-*-netbsdelf-*eabi*)
> + tm_file="$tm_file arm/bpabi.h arm/netbsd-elf.h arm/netbsd-eabi.h"
> + tmake_file="$tmake_file arm/t-bpabi arm/t-netbsdeabi"
> + ;;
> + *)
> + tm_file="$tm_file arm/netbsd-elf.h"
> + tmake_file="$tmake_file arm/t-netbsd"
> + ;;
> + esac
> + tm_file="${tm_file} arm/aout.h arm/arm.h"
> + case ${target} in
> + arm*-*-netbsdelf-*eabihf*)
> + tm_defines="${tm_defines} 
> TARGET_DEFAULT_FLOAT_ABI=ARM_FLOAT_ABI_HARD"
> + ;;
> + esac
> + case ${target} in
> + armv6*) target_cpu_cname="arm1176jzf-s";;
> + armv7*) target_cpu_cname="generic-armv7-a";;
> + esac
>   ;;
>  arm*-*-linux-*)  # ARM GNU/Linux with ELF
>   tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h 
> glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
> diff --git a/gcc/config.host b/gcc/config.host
> index 2213404dd0e..82409e32f96 100644
> --- a/gcc/config.host
> +++ b/gcc/config.host
> @@ -107,7 +107,7 @@ case ${host} in
>   ;;
>  esac
>  ;;
> -  arm*-*-freebsd* | arm*-*-linux* | arm*-*-fuchsia*)
> +  arm*-*-freebsd* | arm*-*-netbsd* | arm*-*-linux* | arm*-*-fuchsia*)
>  case ${target} in
>arm*-*-*)
>   host_extra_gcc_objs="driver-arm.o"
> diff --git a/gcc/config/arm/netbsd-eabi.h b/gcc/config/arm/netbsd-eabi.h
> new file mode 100644
> index 000..5cbfcc92a59
> --- /dev/null
> +++ b/gcc/config/arm/netbsd-eabi.h
> @@ -0,0 +1,97 @@
> +/* Definitions of target machine for GNU compiler, NetBSD/arm ELF version.
> +   Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
> +   Contributed by Wasabi Systems, Inc.
> +
> +   This file is part of GCC.
> +
> +   GCC is free software; you can redistribute it and/or modify it
> +   under the terms of the GNU General Public License as published
> +   by the Free Software Foundation; 

Re: [PATCH] netbsd EABI support

2019-06-12 Thread coypu
I think copyright assignment is done. Thanks for bearing with me.

I noticed the version I submitted in April is missing some changes we
discussed on October 2018.

I took the patch from then and removed -matpcs too, the unnecessary
change to libgcc t-netbsd (which is the OABI configuration anyway), and
some whitespace git warned about.

Added the change to libatomic ifunc usage, since we recently claim ifunc
support on netbsd.
(Got lost in https://gcc.gnu.org/ml/gcc-patches/2019-04/msg00290.html -
that one is my fault for submitting patches badly)


Matt Thomas 
matthew green 
Nick Hudson 
Maya Rashish 

gcc/ChangeLog:

* config.gcc (arm*-*-netbsdelf*) Add support for EABI configuration
* config.host (arm*-*-netbsd*): Build driver-arm.o
* config/arm/netbsd-eabi.h: New file.
* config/arm/netbsd-elf.h: Don't pass -matpcs unconditionally.
* config/netbsd-elf.h: Define SUBTARGET_EXTRA_SPECS.

libgcc/ChangeLog:

* config.host (arm*-*-netbsdelf*): Add support for EABI configuration
* config/arm/t-netbsd: LIB1ASMFUNCS: Append to existing set.
 HOST_LIBGCC2_CFLAGS: workaround possible bug
* config/arm/t-netbsd-eabi: New file.

libatomic/ChangeLog:
* configure.tgt: Exclude arm*-*-netbsd* from try_ifunc.



---
 gcc/config.gcc  | 29 +-
 gcc/config.host |  2 +-
 gcc/config/arm/netbsd-eabi.h| 97 +
 gcc/config/arm/netbsd-elf.h |  3 +-
 gcc/config/netbsd-elf.h | 14 +
 libatomic/configure.tgt |  2 +-
 libgcc/config.host  | 11 +++-
 libgcc/config/arm/t-netbsd  |  8 +++
 libgcc/config/arm/t-netbsd-eabi | 18 ++
 9 files changed, 177 insertions(+), 7 deletions(-)
 create mode 100644 gcc/config/arm/netbsd-eabi.h
 create mode 100644 libgcc/config/arm/t-netbsd-eabi

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 6b00c387247..9fe57f4c7de 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1159,10 +1159,33 @@ arm*-*-freebsd*)# ARM FreeBSD EABI
with_tls=${with_tls:-gnu}
;;
 arm*-*-netbsdelf*)
-   tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h arm/aout.h 
${tm_file} arm/netbsd-elf.h"
-   extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
-   tmake_file="${tmake_file} arm/t-arm"
target_cpu_cname="strongarm"
+   tmake_file="${tmake_file} arm/t-arm"
+   tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h"
+   extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+   case ${target} in
+   arm*eb-*) tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" ;;
+   esac
+   case ${target} in
+   arm*-*-netbsdelf-*eabi*)
+   tm_file="$tm_file arm/bpabi.h arm/netbsd-elf.h arm/netbsd-eabi.h"
+   tmake_file="$tmake_file arm/t-bpabi arm/t-netbsdeabi"
+   ;;
+   *)
+   tm_file="$tm_file arm/netbsd-elf.h"
+   tmake_file="$tmake_file arm/t-netbsd"
+   ;;
+   esac
+   tm_file="${tm_file} arm/aout.h arm/arm.h"
+   case ${target} in
+   arm*-*-netbsdelf-*eabihf*)
+   tm_defines="${tm_defines} 
TARGET_DEFAULT_FLOAT_ABI=ARM_FLOAT_ABI_HARD"
+   ;;
+   esac
+   case ${target} in
+   armv6*) target_cpu_cname="arm1176jzf-s";;
+   armv7*) target_cpu_cname="generic-armv7-a";;
+   esac
;;
 arm*-*-linux-*)# ARM GNU/Linux with ELF
tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h 
glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
diff --git a/gcc/config.host b/gcc/config.host
index 2213404dd0e..82409e32f96 100644
--- a/gcc/config.host
+++ b/gcc/config.host
@@ -107,7 +107,7 @@ case ${host} in
;;
 esac
 ;;
-  arm*-*-freebsd* | arm*-*-linux* | arm*-*-fuchsia*)
+  arm*-*-freebsd* | arm*-*-netbsd* | arm*-*-linux* | arm*-*-fuchsia*)
 case ${target} in
   arm*-*-*)
host_extra_gcc_objs="driver-arm.o"
diff --git a/gcc/config/arm/netbsd-eabi.h b/gcc/config/arm/netbsd-eabi.h
new file mode 100644
index 000..5cbfcc92a59
--- /dev/null
+++ b/gcc/config/arm/netbsd-eabi.h
@@ -0,0 +1,97 @@
+/* Definitions of target machine for GNU compiler, NetBSD/arm ELF version.
+   Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+   Contributed by Wasabi Systems, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along 

Re: [PATCH] netbsd EABI support

2019-05-23 Thread coypu
On Thu, May 23, 2019 at 05:11:30PM +0100, Richard Earnshaw (lists) wrote:
> On 23/05/2019 17:01, Richard Earnshaw (lists) wrote:
> > On 23/05/2019 15:11, Richard Earnshaw (lists) wrote:
> >> On 23/05/2019 15:03, Richard Earnshaw (lists) wrote:
> >>> On 20/05/2019 20:24, Jeff Law wrote:
>  On 4/9/19 10:36 AM, Richard Earnshaw (lists) wrote:
> > On 09/04/2019 16:04, Jeff Law wrote:
> >> On 4/8/19 9:17 AM, co...@sdf.org wrote:
> >>> Pinging again in the hope of getting the patch in, I'd like to have
> >>> less outstanding patches :) (I have quite a few and new releases
> >>> can become painful!)
> >>>
> >>> gcc/ChangeLog
> >>>
> >>> config.gcc (arm*-*-netbsdelf*) Add support for EABI configuration
> >>> config.host (arm*-*-netbsd*): Build driver-arm.o
> >>> config/arm/netbsd-eabi.h: New file.
> >>> config/arm/netbsd-elf.h
> >>> config/netbsd-elf.h: Define SUBTARGET_EXTRA_SPECS.
> >>>
> >>> libgcc/ChangeLog
> >>>
> >>> config.host (arm*-*-netbsdelf*): Add support for EABI configuration
> >>> config/arm/t-netbsd: LIB1ASMFUNCS: Append to existing set.
> >>>HOST_LIBGCC2_CFLAGS: workaround possible bug
> >>> config/arm/t-netbsd-eabi: New file.
> >> So we're well into stage4 which means technically it's too late for
> >> something like this.  However, given it's limited scope I won't object
> >> if the ARM port maintainers want to go forward.  Otherwise I'll queue 
> >> it
> >> for gcc-10.
> >>
> >> jeff
> >>
> >
> > I was about to approve this (modulo removing the now obsolete
> > FPU_DEFAULT macro), until I noticed that it also modifies the generic
> > NetBSD code as well.  I'm certainly not willing to approve that myself
> > at this late stage, but if one of the NetBSD OS maintainers wants to
> > step up and do so, I'll happily take the Arm back-end code as that's not
> > a primary or secondary target.
>  So is removal of the FPUTYPE_DEFAULT stuff all that's needed for this to
>  go forward now that Jason T has chimed in?
> 
>  jeff
> 
> 
> >>>
> >>> Very close.  I was just doing a last pass through the patch to make that
> >>> small edit when I noticed this in config/arm/netbsd-eabi.h:
> >>>
> >>>
> >>> #define SUBTARGET_EXTRA_ASM_SPEC  \
> >>>   "-matpcs ..."
> >>>
> >>> Why is the assembler unconditionally passed -matpcs for an eabi
> >>> configuration?  That sounds broken.
> >>>
> >>> R.
> >>>
> >>
> >>
> >> Looking at what GAS does with this flag, it simply causes the assembler
> >> to create an empty .arm.atpcs debug section.  On that basis, I would
> >> expect that it's then safe (and correct) to remove this: the EABI is not
> >> the ATPCS.
> >>
> >> R.
> >>
> > 
> > 
> > Finally, I need the names of the authors and their email addresses in a
> > format suitable for the ChangeLog file.  As far as I can tell, that means:
> > 
> > Yourself
> > Matt Thomas
> > Matthew Green
> > Nick Hudson
> > 
> > R.
> > 
> 
> Argh, there's a final issue.  We can't find a copyright assignment
> against your email address.  Do you have one?
> 
> R.

Unfortunately no :-(
How do I do it?


Re: [PATCH] netbsd EABI support

2019-05-23 Thread Richard Earnshaw (lists)
On 23/05/2019 17:01, Richard Earnshaw (lists) wrote:
> On 23/05/2019 15:11, Richard Earnshaw (lists) wrote:
>> On 23/05/2019 15:03, Richard Earnshaw (lists) wrote:
>>> On 20/05/2019 20:24, Jeff Law wrote:
 On 4/9/19 10:36 AM, Richard Earnshaw (lists) wrote:
> On 09/04/2019 16:04, Jeff Law wrote:
>> On 4/8/19 9:17 AM, co...@sdf.org wrote:
>>> Pinging again in the hope of getting the patch in, I'd like to have
>>> less outstanding patches :) (I have quite a few and new releases
>>> can become painful!)
>>>
>>> gcc/ChangeLog
>>>
>>> config.gcc (arm*-*-netbsdelf*) Add support for EABI configuration
>>> config.host (arm*-*-netbsd*): Build driver-arm.o
>>> config/arm/netbsd-eabi.h: New file.
>>> config/arm/netbsd-elf.h
>>> config/netbsd-elf.h: Define SUBTARGET_EXTRA_SPECS.
>>>
>>> libgcc/ChangeLog
>>>
>>> config.host (arm*-*-netbsdelf*): Add support for EABI configuration
>>> config/arm/t-netbsd: LIB1ASMFUNCS: Append to existing set.
>>>  HOST_LIBGCC2_CFLAGS: workaround possible bug
>>> config/arm/t-netbsd-eabi: New file.
>> So we're well into stage4 which means technically it's too late for
>> something like this.  However, given it's limited scope I won't object
>> if the ARM port maintainers want to go forward.  Otherwise I'll queue it
>> for gcc-10.
>>
>> jeff
>>
>
> I was about to approve this (modulo removing the now obsolete
> FPU_DEFAULT macro), until I noticed that it also modifies the generic
> NetBSD code as well.  I'm certainly not willing to approve that myself
> at this late stage, but if one of the NetBSD OS maintainers wants to
> step up and do so, I'll happily take the Arm back-end code as that's not
> a primary or secondary target.
 So is removal of the FPUTYPE_DEFAULT stuff all that's needed for this to
 go forward now that Jason T has chimed in?

 jeff


>>>
>>> Very close.  I was just doing a last pass through the patch to make that
>>> small edit when I noticed this in config/arm/netbsd-eabi.h:
>>>
>>>
>>> #define SUBTARGET_EXTRA_ASM_SPEC\
>>>   "-matpcs ..."
>>>
>>> Why is the assembler unconditionally passed -matpcs for an eabi
>>> configuration?  That sounds broken.
>>>
>>> R.
>>>
>>
>>
>> Looking at what GAS does with this flag, it simply causes the assembler
>> to create an empty .arm.atpcs debug section.  On that basis, I would
>> expect that it's then safe (and correct) to remove this: the EABI is not
>> the ATPCS.
>>
>> R.
>>
> 
> 
> Finally, I need the names of the authors and their email addresses in a
> format suitable for the ChangeLog file.  As far as I can tell, that means:
> 
> Yourself
> Matt Thomas
> Matthew Green
> Nick Hudson
> 
> R.
> 

Argh, there's a final issue.  We can't find a copyright assignment
against your email address.  Do you have one?

R.



Re: [PATCH] netbsd EABI support

2019-05-23 Thread Ramana Radhakrishnan
On Thu, May 23, 2019 at 3:12 PM Richard Earnshaw (lists)
 wrote:
>
> On 23/05/2019 15:03, Richard Earnshaw (lists) wrote:
> > On 20/05/2019 20:24, Jeff Law wrote:
> >> On 4/9/19 10:36 AM, Richard Earnshaw (lists) wrote:
> >>> On 09/04/2019 16:04, Jeff Law wrote:
>  On 4/8/19 9:17 AM, co...@sdf.org wrote:
> > Pinging again in the hope of getting the patch in, I'd like to have
> > less outstanding patches :) (I have quite a few and new releases
> > can become painful!)
> >
> > gcc/ChangeLog
> >
> > config.gcc (arm*-*-netbsdelf*) Add support for EABI configuration
> > config.host (arm*-*-netbsd*): Build driver-arm.o
> > config/arm/netbsd-eabi.h: New file.
> > config/arm/netbsd-elf.h
> > config/netbsd-elf.h: Define SUBTARGET_EXTRA_SPECS.
> >
> > libgcc/ChangeLog
> >
> > config.host (arm*-*-netbsdelf*): Add support for EABI configuration
> > config/arm/t-netbsd: LIB1ASMFUNCS: Append to existing set.
> >HOST_LIBGCC2_CFLAGS: workaround possible bug
> > config/arm/t-netbsd-eabi: New file.
>  So we're well into stage4 which means technically it's too late for
>  something like this.  However, given it's limited scope I won't object
>  if the ARM port maintainers want to go forward.  Otherwise I'll queue it
>  for gcc-10.
> 
>  jeff
> 
> >>>
> >>> I was about to approve this (modulo removing the now obsolete
> >>> FPU_DEFAULT macro), until I noticed that it also modifies the generic
> >>> NetBSD code as well.  I'm certainly not willing to approve that myself
> >>> at this late stage, but if one of the NetBSD OS maintainers wants to
> >>> step up and do so, I'll happily take the Arm back-end code as that's not
> >>> a primary or secondary target.
> >> So is removal of the FPUTYPE_DEFAULT stuff all that's needed for this to
> >> go forward now that Jason T has chimed in?
> >>
> >> jeff
> >>
> >>
> >
> > Very close.  I was just doing a last pass through the patch to make that
> > small edit when I noticed this in config/arm/netbsd-eabi.h:
> >
> >
> > #define SUBTARGET_EXTRA_ASM_SPEC  \
> >   "-matpcs ..."
> >
> > Why is the assembler unconditionally passed -matpcs for an eabi
> > configuration?  That sounds broken.
> >
> > R.
> >
>
>
> Looking at what GAS does with this flag, it simply causes the assembler
> to create an empty .arm.atpcs debug section.  On that basis, I would
> expect that it's then safe (and correct) to remove this: the EABI is not
> the ATPCS.
>

I'm not sure if this has been asked. Do you and the other authors have
a copyright assignment on file with the FSF ? I don't see any one with
the email co...@sdf.org on the copyright file . I think this has been
asked in terms of the vax netbsd patches.

regards
Ramana


> R.
>


Re: [PATCH] netbsd EABI support

2019-05-23 Thread Richard Earnshaw (lists)
On 23/05/2019 15:11, Richard Earnshaw (lists) wrote:
> On 23/05/2019 15:03, Richard Earnshaw (lists) wrote:
>> On 20/05/2019 20:24, Jeff Law wrote:
>>> On 4/9/19 10:36 AM, Richard Earnshaw (lists) wrote:
 On 09/04/2019 16:04, Jeff Law wrote:
> On 4/8/19 9:17 AM, co...@sdf.org wrote:
>> Pinging again in the hope of getting the patch in, I'd like to have
>> less outstanding patches :) (I have quite a few and new releases
>> can become painful!)
>>
>> gcc/ChangeLog
>>
>> config.gcc (arm*-*-netbsdelf*) Add support for EABI configuration
>> config.host (arm*-*-netbsd*): Build driver-arm.o
>> config/arm/netbsd-eabi.h: New file.
>> config/arm/netbsd-elf.h
>> config/netbsd-elf.h: Define SUBTARGET_EXTRA_SPECS.
>>
>> libgcc/ChangeLog
>>
>> config.host (arm*-*-netbsdelf*): Add support for EABI configuration
>> config/arm/t-netbsd: LIB1ASMFUNCS: Append to existing set.
>>   HOST_LIBGCC2_CFLAGS: workaround possible bug
>> config/arm/t-netbsd-eabi: New file.
> So we're well into stage4 which means technically it's too late for
> something like this.  However, given it's limited scope I won't object
> if the ARM port maintainers want to go forward.  Otherwise I'll queue it
> for gcc-10.
>
> jeff
>

 I was about to approve this (modulo removing the now obsolete
 FPU_DEFAULT macro), until I noticed that it also modifies the generic
 NetBSD code as well.  I'm certainly not willing to approve that myself
 at this late stage, but if one of the NetBSD OS maintainers wants to
 step up and do so, I'll happily take the Arm back-end code as that's not
 a primary or secondary target.
>>> So is removal of the FPUTYPE_DEFAULT stuff all that's needed for this to
>>> go forward now that Jason T has chimed in?
>>>
>>> jeff
>>>
>>>
>>
>> Very close.  I was just doing a last pass through the patch to make that
>> small edit when I noticed this in config/arm/netbsd-eabi.h:
>>
>>
>> #define SUBTARGET_EXTRA_ASM_SPEC \
>>   "-matpcs ..."
>>
>> Why is the assembler unconditionally passed -matpcs for an eabi
>> configuration?  That sounds broken.
>>
>> R.
>>
> 
> 
> Looking at what GAS does with this flag, it simply causes the assembler
> to create an empty .arm.atpcs debug section.  On that basis, I would
> expect that it's then safe (and correct) to remove this: the EABI is not
> the ATPCS.
> 
> R.
> 


Finally, I need the names of the authors and their email addresses in a
format suitable for the ChangeLog file.  As far as I can tell, that means:

Yourself
Matt Thomas
Matthew Green
Nick Hudson

R.



Re: [PATCH] netbsd EABI support

2019-05-23 Thread Richard Earnshaw (lists)
On 23/05/2019 15:03, Richard Earnshaw (lists) wrote:
> On 20/05/2019 20:24, Jeff Law wrote:
>> On 4/9/19 10:36 AM, Richard Earnshaw (lists) wrote:
>>> On 09/04/2019 16:04, Jeff Law wrote:
 On 4/8/19 9:17 AM, co...@sdf.org wrote:
> Pinging again in the hope of getting the patch in, I'd like to have
> less outstanding patches :) (I have quite a few and new releases
> can become painful!)
>
> gcc/ChangeLog
>
> config.gcc (arm*-*-netbsdelf*) Add support for EABI configuration
> config.host (arm*-*-netbsd*): Build driver-arm.o
> config/arm/netbsd-eabi.h: New file.
> config/arm/netbsd-elf.h
> config/netbsd-elf.h: Define SUBTARGET_EXTRA_SPECS.
>
> libgcc/ChangeLog
>
> config.host (arm*-*-netbsdelf*): Add support for EABI configuration
> config/arm/t-netbsd: LIB1ASMFUNCS: Append to existing set.
>HOST_LIBGCC2_CFLAGS: workaround possible bug
> config/arm/t-netbsd-eabi: New file.
 So we're well into stage4 which means technically it's too late for
 something like this.  However, given it's limited scope I won't object
 if the ARM port maintainers want to go forward.  Otherwise I'll queue it
 for gcc-10.

 jeff

>>>
>>> I was about to approve this (modulo removing the now obsolete
>>> FPU_DEFAULT macro), until I noticed that it also modifies the generic
>>> NetBSD code as well.  I'm certainly not willing to approve that myself
>>> at this late stage, but if one of the NetBSD OS maintainers wants to
>>> step up and do so, I'll happily take the Arm back-end code as that's not
>>> a primary or secondary target.
>> So is removal of the FPUTYPE_DEFAULT stuff all that's needed for this to
>> go forward now that Jason T has chimed in?
>>
>> jeff
>>
>>
> 
> Very close.  I was just doing a last pass through the patch to make that
> small edit when I noticed this in config/arm/netbsd-eabi.h:
> 
> 
> #define SUBTARGET_EXTRA_ASM_SPEC  \
>   "-matpcs ..."
> 
> Why is the assembler unconditionally passed -matpcs for an eabi
> configuration?  That sounds broken.
> 
> R.
> 


Looking at what GAS does with this flag, it simply causes the assembler
to create an empty .arm.atpcs debug section.  On that basis, I would
expect that it's then safe (and correct) to remove this: the EABI is not
the ATPCS.

R.



Re: [PATCH] netbsd EABI support

2019-05-23 Thread Richard Earnshaw (lists)
On 20/05/2019 20:24, Jeff Law wrote:
> On 4/9/19 10:36 AM, Richard Earnshaw (lists) wrote:
>> On 09/04/2019 16:04, Jeff Law wrote:
>>> On 4/8/19 9:17 AM, co...@sdf.org wrote:
 Pinging again in the hope of getting the patch in, I'd like to have
 less outstanding patches :) (I have quite a few and new releases
 can become painful!)

 gcc/ChangeLog

 config.gcc (arm*-*-netbsdelf*) Add support for EABI configuration
 config.host (arm*-*-netbsd*): Build driver-arm.o
 config/arm/netbsd-eabi.h: New file.
 config/arm/netbsd-elf.h
 config/netbsd-elf.h: Define SUBTARGET_EXTRA_SPECS.

 libgcc/ChangeLog

 config.host (arm*-*-netbsdelf*): Add support for EABI configuration
 config/arm/t-netbsd: LIB1ASMFUNCS: Append to existing set.
 HOST_LIBGCC2_CFLAGS: workaround possible bug
 config/arm/t-netbsd-eabi: New file.
>>> So we're well into stage4 which means technically it's too late for
>>> something like this.  However, given it's limited scope I won't object
>>> if the ARM port maintainers want to go forward.  Otherwise I'll queue it
>>> for gcc-10.
>>>
>>> jeff
>>>
>>
>> I was about to approve this (modulo removing the now obsolete
>> FPU_DEFAULT macro), until I noticed that it also modifies the generic
>> NetBSD code as well.  I'm certainly not willing to approve that myself
>> at this late stage, but if one of the NetBSD OS maintainers wants to
>> step up and do so, I'll happily take the Arm back-end code as that's not
>> a primary or secondary target.
> So is removal of the FPUTYPE_DEFAULT stuff all that's needed for this to
> go forward now that Jason T has chimed in?
> 
> jeff
> 
> 

Very close.  I was just doing a last pass through the patch to make that
small edit when I noticed this in config/arm/netbsd-eabi.h:


#define SUBTARGET_EXTRA_ASM_SPEC\
  "-matpcs ..."

Why is the assembler unconditionally passed -matpcs for an eabi
configuration?  That sounds broken.

R.


Re: [PATCH] netbsd EABI support

2019-05-20 Thread Jeff Law
On 4/9/19 10:36 AM, Richard Earnshaw (lists) wrote:
> On 09/04/2019 16:04, Jeff Law wrote:
>> On 4/8/19 9:17 AM, co...@sdf.org wrote:
>>> Pinging again in the hope of getting the patch in, I'd like to have
>>> less outstanding patches :) (I have quite a few and new releases
>>> can become painful!)
>>>
>>> gcc/ChangeLog
>>>
>>> config.gcc (arm*-*-netbsdelf*) Add support for EABI configuration
>>> config.host (arm*-*-netbsd*): Build driver-arm.o
>>> config/arm/netbsd-eabi.h: New file.
>>> config/arm/netbsd-elf.h
>>> config/netbsd-elf.h: Define SUBTARGET_EXTRA_SPECS.
>>>
>>> libgcc/ChangeLog
>>>
>>> config.host (arm*-*-netbsdelf*): Add support for EABI configuration
>>> config/arm/t-netbsd: LIB1ASMFUNCS: Append to existing set.
>>>  HOST_LIBGCC2_CFLAGS: workaround possible bug
>>> config/arm/t-netbsd-eabi: New file.
>> So we're well into stage4 which means technically it's too late for
>> something like this.  However, given it's limited scope I won't object
>> if the ARM port maintainers want to go forward.  Otherwise I'll queue it
>> for gcc-10.
>>
>> jeff
>>
> 
> I was about to approve this (modulo removing the now obsolete
> FPU_DEFAULT macro), until I noticed that it also modifies the generic
> NetBSD code as well.  I'm certainly not willing to approve that myself
> at this late stage, but if one of the NetBSD OS maintainers wants to
> step up and do so, I'll happily take the Arm back-end code as that's not
> a primary or secondary target.
So is removal of the FPUTYPE_DEFAULT stuff all that's needed for this to
go forward now that Jason T has chimed in?

jeff




Re: [PATCH] netbsd EABI support

2019-05-10 Thread coypu
On Fri, May 10, 2019 at 11:44:28AM +0100, Richard Earnshaw (lists) wrote:
> I was hoping to get a comment from one of the netbsd port maintainers on
> the changes to the common NetBSD code.  Are they no-longer active?

Jason Thorpe said he can't contribute to GCC because of where he works.
Krister Walfridsson is slow to respond but does eventually and knows a
lot about GCC.


Re: [PATCH] netbsd EABI support

2019-05-10 Thread Richard Earnshaw (lists)
On 10/05/2019 00:33, co...@sdf.org wrote:
> On Tue, Apr 09, 2019 at 05:36:47PM +0100, Richard Earnshaw (lists) wrote:
>>> So we're well into stage4 which means technically it's too late for
>>> something like this.  However, given it's limited scope I won't object
>>> if the ARM port maintainers want to go forward.  Otherwise I'll queue it
>>> for gcc-10.
>>>
>>> jeff
>>>
>>
>> I was about to approve this (modulo removing the now obsolete
>> FPU_DEFAULT macro), until I noticed that it also modifies the generic
>> NetBSD code as well.  I'm certainly not willing to approve that myself
>> at this late stage, but if one of the NetBSD OS maintainers wants to
>> step up and do so, I'll happily take the Arm back-end code as that's not
>> a primary or secondary target.
>>
>> R.
> 
> Congrats on a new release :-)
> ping
> 

I was hoping to get a comment from one of the netbsd port maintainers on
the changes to the common NetBSD code.  Are they no-longer active?

R.


Re: [PATCH] netbsd EABI support

2019-05-09 Thread coypu
On Tue, Apr 09, 2019 at 05:36:47PM +0100, Richard Earnshaw (lists) wrote:
> > So we're well into stage4 which means technically it's too late for
> > something like this.  However, given it's limited scope I won't object
> > if the ARM port maintainers want to go forward.  Otherwise I'll queue it
> > for gcc-10.
> > 
> > jeff
> > 
> 
> I was about to approve this (modulo removing the now obsolete
> FPU_DEFAULT macro), until I noticed that it also modifies the generic
> NetBSD code as well.  I'm certainly not willing to approve that myself
> at this late stage, but if one of the NetBSD OS maintainers wants to
> step up and do so, I'll happily take the Arm back-end code as that's not
> a primary or secondary target.
> 
> R.

Congrats on a new release :-)
ping


Re: [PATCH] netbsd EABI support

2019-04-09 Thread Richard Earnshaw (lists)
On 09/04/2019 16:04, Jeff Law wrote:
> On 4/8/19 9:17 AM, co...@sdf.org wrote:
>> Pinging again in the hope of getting the patch in, I'd like to have
>> less outstanding patches :) (I have quite a few and new releases
>> can become painful!)
>>
>> gcc/ChangeLog
>>
>> config.gcc (arm*-*-netbsdelf*) Add support for EABI configuration
>> config.host (arm*-*-netbsd*): Build driver-arm.o
>> config/arm/netbsd-eabi.h: New file.
>> config/arm/netbsd-elf.h
>> config/netbsd-elf.h: Define SUBTARGET_EXTRA_SPECS.
>>
>> libgcc/ChangeLog
>>
>> config.host (arm*-*-netbsdelf*): Add support for EABI configuration
>> config/arm/t-netbsd: LIB1ASMFUNCS: Append to existing set.
>>   HOST_LIBGCC2_CFLAGS: workaround possible bug
>> config/arm/t-netbsd-eabi: New file.
> So we're well into stage4 which means technically it's too late for
> something like this.  However, given it's limited scope I won't object
> if the ARM port maintainers want to go forward.  Otherwise I'll queue it
> for gcc-10.
> 
> jeff
> 

I was about to approve this (modulo removing the now obsolete
FPU_DEFAULT macro), until I noticed that it also modifies the generic
NetBSD code as well.  I'm certainly not willing to approve that myself
at this late stage, but if one of the NetBSD OS maintainers wants to
step up and do so, I'll happily take the Arm back-end code as that's not
a primary or secondary target.

R.


Re: [PATCH] netbsd EABI support

2019-04-09 Thread Jeff Law
On 4/8/19 9:17 AM, co...@sdf.org wrote:
> Pinging again in the hope of getting the patch in, I'd like to have
> less outstanding patches :) (I have quite a few and new releases
> can become painful!)
> 
> gcc/ChangeLog
> 
> config.gcc (arm*-*-netbsdelf*) Add support for EABI configuration
> config.host (arm*-*-netbsd*): Build driver-arm.o
> config/arm/netbsd-eabi.h: New file.
> config/arm/netbsd-elf.h
> config/netbsd-elf.h: Define SUBTARGET_EXTRA_SPECS.
> 
> libgcc/ChangeLog
> 
> config.host (arm*-*-netbsdelf*): Add support for EABI configuration
> config/arm/t-netbsd: LIB1ASMFUNCS: Append to existing set.
>HOST_LIBGCC2_CFLAGS: workaround possible bug
> config/arm/t-netbsd-eabi: New file.
So we're well into stage4 which means technically it's too late for
something like this.  However, given it's limited scope I won't object
if the ARM port maintainers want to go forward.  Otherwise I'll queue it
for gcc-10.

jeff


[PATCH] netbsd EABI support

2019-04-08 Thread coypu
Pinging again in the hope of getting the patch in, I'd like to have
less outstanding patches :) (I have quite a few and new releases
can become painful!)

gcc/ChangeLog

config.gcc (arm*-*-netbsdelf*) Add support for EABI configuration
config.host (arm*-*-netbsd*): Build driver-arm.o
config/arm/netbsd-eabi.h: New file.
config/arm/netbsd-elf.h
config/netbsd-elf.h: Define SUBTARGET_EXTRA_SPECS.

libgcc/ChangeLog

config.host (arm*-*-netbsdelf*): Add support for EABI configuration
config/arm/t-netbsd: LIB1ASMFUNCS: Append to existing set.
 HOST_LIBGCC2_CFLAGS: workaround possible bug
config/arm/t-netbsd-eabi: New file.

---
 gcc/config.gcc  | 29 +-
 gcc/config.host |  2 +-
 gcc/config/arm/netbsd-eabi.h| 97 +
 gcc/config/arm/netbsd-elf.h | 10 
 gcc/config/netbsd-elf.h | 15 +
 libgcc/config.host  | 10 +++-
 libgcc/config/arm/t-netbsd  | 10 +++-
 libgcc/config/arm/t-netbsd-eabi | 18 ++
 8 files changed, 184 insertions(+), 7 deletions(-)
 create mode 100644 gcc/config/arm/netbsd-eabi.h
 create mode 100644 libgcc/config/arm/t-netbsd-eabi

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 3ee31c5993d..736b2163a24 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1161,10 +1161,33 @@ arm*-*-freebsd*)# ARM FreeBSD EABI
with_tls=${with_tls:-gnu}
;;
 arm*-*-netbsdelf*)
-   tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h arm/aout.h 
${tm_file} arm/netbsd-elf.h"
-   extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
-   tmake_file="${tmake_file} arm/t-arm"
target_cpu_cname="strongarm"
+   tmake_file="${tmake_file} arm/t-arm"
+   tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h"
+   extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+   case ${target} in
+   arm*eb-*) tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" ;;
+   esac
+   case ${target} in
+   arm*-*-netbsdelf-*eabi*)
+   tm_file="$tm_file arm/bpabi.h arm/netbsd-elf.h arm/netbsd-eabi.h"
+   tmake_file="$tmake_file arm/t-bpabi arm/t-netbsdeabi"
+   ;;
+   *)
+   tm_file="$tm_file arm/netbsd-elf.h"
+   tmake_file="$tmake_file arm/t-netbsd"
+   ;;
+   esac
+   tm_file="${tm_file} arm/aout.h arm/arm.h"
+   case ${target} in
+   arm*-*-netbsdelf-*eabihf*)
+   tm_defines="${tm_defines} 
TARGET_DEFAULT_FLOAT_ABI=ARM_FLOAT_ABI_HARD"
+   ;;
+   esac
+   case ${target} in
+   armv6*) target_cpu_cname="arm1176jzf-s";;
+   armv7*) target_cpu_cname="generic-armv7-a";;
+   esac
;;
 arm*-*-linux-*)# ARM GNU/Linux with ELF
tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h 
glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
diff --git a/gcc/config.host b/gcc/config.host
index 816a0f06cb7..5077c0ee33a 100644
--- a/gcc/config.host
+++ b/gcc/config.host
@@ -107,7 +107,7 @@ case ${host} in
;;
 esac
 ;;
-  arm*-*-freebsd* | arm*-*-linux* | arm*-*-fuchsia*)
+  arm*-*-freebsd* | arm*-*-netbsd* | arm*-*-linux* | arm*-*-fuchsia*)
 case ${target} in
   arm*-*-*)
host_extra_gcc_objs="driver-arm.o"
diff --git a/gcc/config/arm/netbsd-eabi.h b/gcc/config/arm/netbsd-eabi.h
new file mode 100644
index 000..13bc274175d
--- /dev/null
+++ b/gcc/config/arm/netbsd-eabi.h
@@ -0,0 +1,97 @@
+/* Definitions of target machine for GNU compiler, NetBSD/arm ELF version.
+   Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+   Contributed by Wasabi Systems, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   .  */
+
+/* Run-time Target Specification.  */
+#undef MULTILIB_DEFAULTS
+#define MULTILIB_DEFAULTS { "mabi=aapcs-linux" }
+
+#define TARGET_LINKER_EABI_SUFFIX \
+(TARGET_DEFAULT_FLOAT_ABI == ARM_FLOAT_ABI_SOFT \
+ ? "%{!mabi=apcs-gnu:%{!mabi=atpcs:%{mfloat-abi=hard:_eabihf;:_eabi}}}" \
+ : "%{!mabi=apcs-gnu:%{!mabi=atpcs:%{mfloat-abi=soft:_eabi;:_eabihf}}}")
+#define TARGET_LINKER_BIG_EMULATION "armelfb_nbsd%(linker_eabi_suffix)"
+#define TARGET_LINKER_LITTLE_EMULATION "armelf_nbsd%(linker_eabi_suffix)"
+
+/* TARGET_BIG_ENDIAN_DEFAULT is set in
+   config.gcc for big endian configurations.  */
+#undef