public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* rs6000: add support for powerpc64le-unknown-freebsd
@ 2020-12-14 15:35 Piotr Kubaj
  2020-12-14 16:46 ` Segher Boessenkool
  2020-12-14 23:37 ` Gerald Pfeifer
  0 siblings, 2 replies; 12+ messages in thread
From: Piotr Kubaj @ 2020-12-14 15:35 UTC (permalink / raw)
  To: gcc-patches, David Edelsohn, Segher Boessenkool, Andreas Tobler


[-- Attachment #1.1: Type: text/plain, Size: 480 bytes --]

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  <pkubaj@FreeBSD.org>

        * config.gcc: add support for powerpc64le-unknown-freebsd

[-- Attachment #1.2: gcc-powerpc64le-freebsd.patch --]
[-- Type: text/x-diff, Size: 1935 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-09-10 23:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-14 15:35 rs6000: add support for powerpc64le-unknown-freebsd Piotr Kubaj
2020-12-14 16:46 ` Segher Boessenkool
2020-12-14 23:29   ` Gerald Pfeifer
2020-12-15  0:30     ` Segher Boessenkool
2020-12-16 22:58     ` Segher Boessenkool
2020-12-28 11:44       ` Gerald Pfeifer
2020-12-28 12:37         ` Segher Boessenkool
2021-09-10 23:26           ` Piotr Kubaj
2020-12-14 23:37 ` Gerald Pfeifer
2020-12-14 23:52   ` Piotr Kubaj
2020-12-16 22:23     ` Segher Boessenkool
2021-04-29 11:37       ` Piotr Kubaj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).