Re: rs6000: add support for powerpc64le-unknown-freebsd

2021-09-10 Thread Piotr Kubaj via Gcc-patches
Hello again,

it looks like one simple patch got left out by accident. Would it be possible 
for you to commit it?

Thank you,
Piotr Kubaj.

On 20-12-28 06:37:23, Segher Boessenkool wrote:
> On Mon, Dec 28, 2020 at 12:44:15PM +0100, Gerald Pfeifer wrote:
> > On Wed, 16 Dec 2020, Segher Boessenkool wrote:
> > >> Any chance (one of you) can help and commit this?
> > > Done now.
> > > 
> > > Please remind me in a week or so to do the backports?
> > 
> > Thank you, Segher!
> > 
> > And thanks for pushing the backports, too, whenever you get to them,
> > holiday season and such.
> 
> Hey, if I can remember how ssh works ;-)
> 
> Done now (10 and 9).  Cheers!
> 
> 
> Segher

-- 
--- gcc/configure.orig  2021-04-29 10:19:44 UTC
+++ gcc/configure
@@ -29405,7 +29405,7 @@ $as_echo "#define HAVE_LD_PPC_GNU_ATTR_LONG_DOUBLE 1" 
 esac
 
 case "$target:$tm_file" in
-  powerpc64-*-freebsd* | powerpc64*-*-linux* | 
powerpc*-*-linux*rs6000/biarch64.h*)
+  powerpc64*-*-freebsd* | powerpc64*-*-linux* | 
powerpc*-*-linux*rs6000/biarch64.h*)
   case "$target" in
  *le-*-linux*)
  emul_name="-melf64lppc"


signature.asc
Description: PGP signature


Re: rs6000: add support for powerpc64le-unknown-freebsd

2021-04-29 Thread Piotr Kubaj via Gcc-patches
Hello again,

sorry to reopen this issue, but one part was skipped. It was just now found 
out, because it doesn't cause build issues, but only runtime issues (GCC fails 
to build binaries):
/usr/local/bin/ld: /usr/local/lib/gcc10/libgcc_s.so: undefined reference to 
`.__udivmodti4'
/usr/local/bin/ld: /usr/local/lib/gcc10/libgcc_s.so: undefined reference to 
`.__ctzdi2'
/usr/local/bin/ld: /usr/local/lib/gcc10/libgcc_s.so: undefined reference to 
`.__parityti2'
/usr/local/bin/ld: /usr/local/lib/gcc10/libgcc_s.so: undefined reference to 
`.__enable_execute_stack'

Could you commit the following patch:
--- gcc/configure.orig  2021-04-29 10:19:44 UTC
+++ gcc/configure
@@ -29405,7 +29405,7 @@ $as_echo "#define HAVE_LD_PPC_GNU_ATTR_LONG_DOUBLE 1"
 esac

 case "$target:$tm_file" in
-  powerpc64-*-freebsd* | powerpc64*-*-linux* | 
powerpc*-*-linux*rs6000/biarch64.h*)
+  powerpc64*-*-freebsd* | powerpc64*-*-linux* | 
powerpc*-*-linux*rs6000/biarch64.h*)
   case "$target" in
  *le-*-linux*)
  emul_name="-melf64lppc"
--- gcc/configure.ac.orig   2021-04-29 11:22:30 UTC
+++ gcc/configure.ac
@@ -5871,7 +5871,7 @@ EOF
 esac

 case "$target:$tm_file" in
-  powerpc64-*-freebsd* | powerpc64*-*-linux* | 
powerpc*-*-linux*rs6000/biarch64.h*)
+  powerpc64*-*-freebsd* | powerpc64*-*-linux* | 
powerpc*-*-linux*rs6000/biarch64.h*)
   case "$target" in
  *le-*-linux*)
  emul_name="-melf64lppc"

Thanks,
Piotr Kubaj.

On 20-12-16 16:23:09, Segher Boessenkool wrote:
> On Tue, Dec 15, 2020 at 12:52:05AM +0100, Piotr Kubaj wrote:
> > Yes, there is, thanks for noticing that!
> > 
> > Fixed patch attached.
> 
> Hi!
> 
> Could you send this as plain text?  It now is quoted-printable, which is
> really hard to handle.
> 
> Thanks!
> 
> Hrm, this is really short, I'll just try to fix it by hand...  Wish me
> luck :-)
> 
> 
> Segher

-- 


signature.asc
Description: PGP signature


Re: rs6000: add support for powerpc64le-unknown-freebsd

2020-12-28 Thread Segher Boessenkool
On Mon, Dec 28, 2020 at 12:44:15PM +0100, Gerald Pfeifer wrote:
> On Wed, 16 Dec 2020, Segher Boessenkool wrote:
> >> Any chance (one of you) can help and commit this?
> > Done now.
> > 
> > Please remind me in a week or so to do the backports?
> 
> Thank you, Segher!
> 
> And thanks for pushing the backports, too, whenever you get to them,
> holiday season and such.

Hey, if I can remember how ssh works ;-)

Done now (10 and 9).  Cheers!


Segher


Re: rs6000: add support for powerpc64le-unknown-freebsd

2020-12-28 Thread Gerald Pfeifer
On Wed, 16 Dec 2020, Segher Boessenkool wrote:
>> Any chance (one of you) can help and commit this?
> Done now.
> 
> Please remind me in a week or so to do the backports?

Thank you, Segher!

And thanks for pushing the backports, too, whenever you get to them,
holiday season and such.

Gerald


Re: rs6000: add support for powerpc64le-unknown-freebsd

2020-12-16 Thread Segher Boessenkool
On Tue, Dec 15, 2020 at 12:29:45AM +0100, Gerald Pfeifer wrote:
> > The patch looks fine.  Okay for trunk.  Also okay for any backports you 
> > want (after waiting to see if it creates problems on trunk, as usual).
> 
> Thank you! Segher doesn't have write access, and usually I'd help out,
> alas autoconf in GCC-land and me are, um, slightly divergent.

It's not you.  So because this is just three lines, I did manual
surgery.  Someone should fix the generated configure though, it is *not*
generated with 2.69, although it claims it is.

> Any chance (one of you) can help and commit this?

Done now.

Please remind me in a week or so to do the backports?

> To make this easier, I've created a proposal for a full ChangeLog 
> entry. :-)
> 
> 2020-12-15  Piotr Kubaj   
>  
>   * config.gcc (powerpc*le-*-freebsd*): Add. 
>   * configure.ac (powerpc*le-*-freebsd*): Ditto. 
>   * config/rs6000/freebsd64.h (ASM_SPEC_COMMON): Use ENDIAN_SELECT. 
>   (DEFAULT_ASM_ENDIAN): Add little endian support. 
>   (LINK_OS_FREEBSD_SPEC64): Ditto. 

I added an entry for configure, and a little blurb taken from the first
email.

Thanks to both of you,


Segher


Re: rs6000: add support for powerpc64le-unknown-freebsd

2020-12-16 Thread Segher Boessenkool
On Tue, Dec 15, 2020 at 12:52:05AM +0100, Piotr Kubaj wrote:
> Yes, there is, thanks for noticing that!
> 
> Fixed patch attached.

Hi!

Could you send this as plain text?  It now is quoted-printable, which is
really hard to handle.

Thanks!

Hrm, this is really short, I'll just try to fix it by hand...  Wish me
luck :-)


Segher


Re: rs6000: add support for powerpc64le-unknown-freebsd

2020-12-14 Thread Segher Boessenkool
On Tue, Dec 15, 2020 at 12:29:45AM +0100, Gerald Pfeifer wrote:
> On Mon, 14 Dec 2020, Segher Boessenkool wrote:
> >> +  powerpc*le-*-*)
> >> +  tm_file="${tm_file} rs6000/sysv4le.h" ;;
> >> +  esac
> > What an obvious filename ;-)
> 
> ;-)
> 
> > The patch looks fine.  Okay for trunk.  Also okay for any backports you 
> > want (after waiting to see if it creates problems on trunk, as usual).
> 
> Thank you! Segher doesn't have write access, and usually I'd help out,
> alas autoconf in GCC-land and me are, um, slightly divergent.

Piotr doesn't have write access, I think you mean :-)

> Any chance (one of you) can help and commit this?

I'll commit it tomorrow morning, it's too late right now for me to trust
myself doing a commit correctly.

> To make this easier, I've created a proposal for a full ChangeLog 
> entry. :-)

Thanks!  Even less work :-)


Segher


Re: rs6000: add support for powerpc64le-unknown-freebsd

2020-12-14 Thread Piotr Kubaj via Gcc-patches
Yes, there is, thanks for noticing that!

Fixed patch attached.

On 20-12-15 00:37:02, Gerald Pfeifer wrote:
> On Mon, 14 Dec 2020, Piotr Kubaj via Gcc-patches wrote:
> > --- gcc/configure.ac.orig   2020-12-14 15:22:23 UTC
> > +++ gcc/configure.ac
> > @@ -5874,6 +5874,8 @@ case "$target:$tm_file" in
> >  *-*-linux*)
> >  emul_name="-melf64ppc"
> >   ;;
> >+ *le-*-freebsd*)
> >+ emul_name="-melf64lppc_fbsd"
> >  *-*-freebsd*)
> >  emul_name="-melf64ppc_fbsd"
> >   ;;
> 
> Is there a ;; missing to terminate the *le-*-freebsd* entry?
> 
> (Or am I missing some subtlety of /bin/sh ?)
> 
> Gerald
> 

-- 
--- gcc/config.gcc.orig	2020-12-07 03:00:29 UTC
+++ gcc/config.gcc
@@ -2868,6 +2868,10 @@ powerpc*-*-freebsd*)
 	extra_options="${extra_options} rs6000/sysv4.opt"
 	tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
 	case ${target} in
+	powerpc*le-*-*)
+		tm_file="${tm_file} rs6000/sysv4le.h" ;;
+	esac
+	case ${target} in
 	 powerpc64*)
 		tm_file="${tm_file} rs6000/default64.h rs6000/freebsd64.h"
 		tmake_file="${tmake_file} rs6000/t-freebsd64"
--- gcc/config/rs6000/freebsd64.h.orig	2020-07-23 06:35:17 UTC
+++ gcc/config/rs6000/freebsd64.h
@@ -158,8 +157,8 @@ extern int dot_symbols;
 #define ASM_SPEC64 "-a64"
 
 #define ASM_SPEC_COMMON "%(asm_cpu) \
-%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \
-%{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian}"
+%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}}" \
+  ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
 
 #undef	SUBSUBTARGET_EXTRA_SPECS
 #define SUBSUBTARGET_EXTRA_SPECS	\
@@ -181,9 +180,15 @@ extern int dot_symbols;
 %{static:-Bstatic}} \
   %{symbolic:-Bsymbolic}"
 
+#undef  DEFAULT_ASM_ENDIAN
 #define LINK_OS_FREEBSD_SPEC32 "-melf32ppc_fbsd " LINK_OS_FREEBSD_SPEC_DEF
-  
+#if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
+#define DEFAULT_ASM_ENDIAN " -mlittle"
+#define LINK_OS_FREEBSD_SPEC64 "-melf64lppc_fbsd " LINK_OS_FREEBSD_SPEC_DEF
+#else
+#define DEFAULT_ASM_ENDIAN " -mbig"
 #define LINK_OS_FREEBSD_SPEC64 "-melf64ppc_fbsd " LINK_OS_FREEBSD_SPEC_DEF
+#endif
 
 #undef	MULTILIB_DEFAULTS
 #define MULTILIB_DEFAULTS { "m64" }
--- gcc/configure.ac.orig	2020-12-14 15:22:23 UTC
+++ gcc/configure.ac
@@ -5874,6 +5874,9 @@ case "$target:$tm_file" in
  *-*-linux*)
  emul_name="-melf64ppc"
   ;;
+ *le-*-freebsd*)
+ emul_name="-melf64lppc_fbsd"
+  ;;
  *-*-freebsd*)
  emul_name="-melf64ppc_fbsd"
   ;;


signature.asc
Description: PGP signature


Re: rs6000: add support for powerpc64le-unknown-freebsd

2020-12-14 Thread Gerald Pfeifer
On Mon, 14 Dec 2020, Piotr Kubaj via Gcc-patches wrote:
> --- gcc/configure.ac.orig   2020-12-14 15:22:23 UTC
> +++ gcc/configure.ac
> @@ -5874,6 +5874,8 @@ case "$target:$tm_file" in
>  *-*-linux*)
>  emul_name="-melf64ppc"
>   ;;
>+ *le-*-freebsd*)
>+ emul_name="-melf64lppc_fbsd"
>  *-*-freebsd*)
>  emul_name="-melf64ppc_fbsd"
>   ;;

Is there a ;; missing to terminate the *le-*-freebsd* entry?

(Or am I missing some subtlety of /bin/sh ?)

Gerald



Re: rs6000: add support for powerpc64le-unknown-freebsd

2020-12-14 Thread Gerald Pfeifer
On Mon, 14 Dec 2020, Segher Boessenkool wrote:
>> +powerpc*le-*-*)
>> +tm_file="${tm_file} rs6000/sysv4le.h" ;;
>> +esac
> What an obvious filename ;-)

;-)

> The patch looks fine.  Okay for trunk.  Also okay for any backports you 
> want (after waiting to see if it creates problems on trunk, as usual).

Thank you! Segher doesn't have write access, and usually I'd help out,
alas autoconf in GCC-land and me are, um, slightly divergent.

Any chance (one of you) can help and commit this?


To make this easier, I've created a proposal for a full ChangeLog 
entry. :-)

2020-12-15  Piotr Kubaj   
 
* config.gcc (powerpc*le-*-freebsd*): Add. 
* configure.ac (powerpc*le-*-freebsd*): Ditto. 
* config/rs6000/freebsd64.h (ASM_SPEC_COMMON): Use ENDIAN_SELECT. 
(DEFAULT_ASM_ENDIAN): Add little endian support. 
(LINK_OS_FREEBSD_SPEC64): Ditto. 

Thank you,
Gerald


Re: rs6000: add support for powerpc64le-unknown-freebsd

2020-12-14 Thread Segher Boessenkool
Hi!

On Mon, Dec 14, 2020 at 04:35:38PM +0100, Piotr Kubaj wrote:
> this patch implements support for powerpc64le architecture on FreeBSD. Since 
> we don't have powerpcle (32-bit), I did not add support for powerpcle here. 
> This remains to be changed if there is powerpcle support in the future.
> 
> Patch implements similar endian detection to what linux64.h uses.
> 
> Would it be ok to backport it to at least GCC 10?

> --- gcc/config.gcc.orig   2020-12-07 03:00:29 UTC
> +++ gcc/config.gcc
> @@ -2868,6 +2868,10 @@ powerpc*-*-freebsd*)
>   extra_options="${extra_options} rs6000/sysv4.opt"
>   tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} 
> rs6000/t-ppccomm"
>   case ${target} in
> + powerpc*le-*-*)
> + tm_file="${tm_file} rs6000/sysv4le.h" ;;
> + esac

What an obvious filename ;-)

I guess we should put all these header files together into one again,
but that is hard to do without regressing things (I suspect this is
where the mystery power4 stems from as well, fwiw).

The patch looks fine.  Okay for trunk.  Also okay for any backports you
want (after waiting to see if it creates problems on trunk, as usual).

Thanks!


Segher


rs6000: add support for powerpc64le-unknown-freebsd

2020-12-14 Thread Piotr Kubaj via Gcc-patches
Hello,

this patch implements support for powerpc64le architecture on FreeBSD. Since we 
don't have powerpcle (32-bit), I did not add support for powerpcle here. This 
remains to be changed if there is powerpcle support in the future.

Patch implements similar endian detection to what linux64.h uses.

Would it be ok to backport it to at least GCC 10?

gcc/Changelog:
2020-12-14  Piotr Kubaj  

* config.gcc: add support for powerpc64le-unknown-freebsd
--- gcc/config.gcc.orig	2020-12-07 03:00:29 UTC
+++ gcc/config.gcc
@@ -2868,6 +2868,10 @@ powerpc*-*-freebsd*)
 	extra_options="${extra_options} rs6000/sysv4.opt"
 	tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
 	case ${target} in
+	powerpc*le-*-*)
+		tm_file="${tm_file} rs6000/sysv4le.h" ;;
+	esac
+	case ${target} in
 	 powerpc64*)
 		tm_file="${tm_file} rs6000/default64.h rs6000/freebsd64.h"
 		tmake_file="${tmake_file} rs6000/t-freebsd64"
--- gcc/config/rs6000/freebsd64.h.orig	2020-07-23 06:35:17 UTC
+++ gcc/config/rs6000/freebsd64.h
@@ -158,8 +157,8 @@ extern int dot_symbols;
 #define ASM_SPEC64 "-a64"
 
 #define ASM_SPEC_COMMON "%(asm_cpu) \
-%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \
-%{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian}"
+%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}}" \
+  ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
 
 #undef	SUBSUBTARGET_EXTRA_SPECS
 #define SUBSUBTARGET_EXTRA_SPECS	\
@@ -181,9 +180,15 @@ extern int dot_symbols;
 %{static:-Bstatic}} \
   %{symbolic:-Bsymbolic}"
 
+#undef  DEFAULT_ASM_ENDIAN
 #define LINK_OS_FREEBSD_SPEC32 "-melf32ppc_fbsd " LINK_OS_FREEBSD_SPEC_DEF
-  
+#if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
+#define DEFAULT_ASM_ENDIAN " -mlittle"
+#define LINK_OS_FREEBSD_SPEC64 "-melf64lppc_fbsd " LINK_OS_FREEBSD_SPEC_DEF
+#else
+#define DEFAULT_ASM_ENDIAN " -mbig"
 #define LINK_OS_FREEBSD_SPEC64 "-melf64ppc_fbsd " LINK_OS_FREEBSD_SPEC_DEF
+#endif
 
 #undef	MULTILIB_DEFAULTS
 #define MULTILIB_DEFAULTS { "m64" }
--- gcc/configure.ac.orig	2020-12-14 15:22:23 UTC
+++ gcc/configure.ac
@@ -5874,6 +5874,8 @@ case "$target:$tm_file" in
  *-*-linux*)
  emul_name="-melf64ppc"
   ;;
+ *le-*-freebsd*)
+ emul_name="-melf64lppc_fbsd"
  *-*-freebsd*)
  emul_name="-melf64ppc_fbsd"
   ;;


signature.asc
Description: PGP signature