public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] mips: Fix up mips*-sde-elf* build [PR112300]
@ 2023-11-24 15:53 Jakub Jelinek
  2023-11-27  7:25 ` YunQiang Su
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2023-11-24 15:53 UTC (permalink / raw)
  To: YunQiang Su, Jeff Law; +Cc: gcc-patches

Hi!

As reported in the PR, mipsisa64r2-sde-elf doesn't build because HEAP_TRAMPOLINES_INIT
macro isn't defined anywhere.
It is normally defined by
# Figure out if we need to enable heap trampolines by default
case ${target} in
*-*-darwin2*)
  # Currently, we do this for macOS 11 and above.
  tm_defines="$tm_defines HEAP_TRAMPOLINES_INIT=1"
  ;;
*)
  tm_defines="$tm_defines HEAP_TRAMPOLINES_INIT=0"
  ;;
esac
in config.gcc, but mips*-sde-elf* is the only target which overwrites
tm_defines shell variable rather than just appending to it (or in one case
prepending), all other targets append something to it, including other
mips* triplets.
I believe (just from looking at config.gcc) that the difference is that
LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4 HEAP_TRAMPOLINES_INIT=0
isn't defined without the patch and is with the patch.

I think defining those first 4 shouldn't cause any harm and defining the
last one is required for it to actually build at all.

Ok for trunk?

Totally untested though...

2023-11-24  Jakub Jelinek  <jakub@redhat.com>

	PR target/112300
	* config.gcc (mips*-sde-elf*): Append to tm_defines rather than
	overwriting them.

--- gcc/config.gcc.jj	2023-11-18 09:35:20.625089143 +0100
+++ gcc/config.gcc	2023-11-24 16:41:39.194495079 +0100
@@ -2682,22 +2682,22 @@ mips*-sde-elf*)
 	esac
 	case ${target} in
 	  mipsisa32r6*)
-	    tm_defines="MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R6 MIPS_ABI_DEFAULT=ABI_32"
+	    tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R6 MIPS_ABI_DEFAULT=ABI_32"
 	    ;;
 	  mipsisa32r2*)
-	    tm_defines="MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R2 MIPS_ABI_DEFAULT=ABI_32"
+	    tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R2 MIPS_ABI_DEFAULT=ABI_32"
 	    ;;
 	  mipsisa32*)
-	    tm_defines="MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32 MIPS_ABI_DEFAULT=ABI_32"
+	    tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32 MIPS_ABI_DEFAULT=ABI_32"
 	    ;;
 	  mipsisa64r6*)
-	    tm_defines="MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64R6 MIPS_ABI_DEFAULT=ABI_N32"
+	    tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64R6 MIPS_ABI_DEFAULT=ABI_N32"
 	    ;;
 	  mipsisa64r2*)
-	    tm_defines="MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64R2 MIPS_ABI_DEFAULT=ABI_N32"
+	    tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64R2 MIPS_ABI_DEFAULT=ABI_N32"
 	    ;;
 	  mipsisa64*)
-	    tm_defines="MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64 MIPS_ABI_DEFAULT=ABI_N32"
+	    tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64 MIPS_ABI_DEFAULT=ABI_N32"
 	    ;;
 	esac
 	;;

	Jakub


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

* Re: [PATCH] mips: Fix up mips*-sde-elf* build [PR112300]
  2023-11-24 15:53 [PATCH] mips: Fix up mips*-sde-elf* build [PR112300] Jakub Jelinek
@ 2023-11-27  7:25 ` YunQiang Su
  0 siblings, 0 replies; 2+ messages in thread
From: YunQiang Su @ 2023-11-27  7:25 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: YunQiang Su, Jeff Law, gcc-patches

Jakub Jelinek <jakub@redhat.com> 于2023年11月24日周五 23:54写道:
>
> Hi!
>
> As reported in the PR, mipsisa64r2-sde-elf doesn't build because HEAP_TRAMPOLINES_INIT
> macro isn't defined anywhere.
> It is normally defined by
> # Figure out if we need to enable heap trampolines by default
> case ${target} in
> *-*-darwin2*)
>   # Currently, we do this for macOS 11 and above.
>   tm_defines="$tm_defines HEAP_TRAMPOLINES_INIT=1"
>   ;;
> *)
>   tm_defines="$tm_defines HEAP_TRAMPOLINES_INIT=0"
>   ;;
> esac
> in config.gcc, but mips*-sde-elf* is the only target which overwrites
> tm_defines shell variable rather than just appending to it (or in one case
> prepending), all other targets append something to it, including other
> mips* triplets.

Maybe it was some mistake. And in fact mips*-sde-elf* is an quite old triple,
so I guess that nobody tested the mipsisa32/64rN ones.
It was replaced by mips*-mti-elf later.

> I believe (just from looking at config.gcc) that the difference is that
> LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4 HEAP_TRAMPOLINES_INIT=0
> isn't defined without the patch and is with the patch.
>
> I think defining those first 4 shouldn't cause any harm and defining the
> last one is required for it to actually build at all.
>
> Ok for trunk?
>

Anyway, this patch won't break anything.
So, approve it.

> Totally untested though...
>
> 2023-11-24  Jakub Jelinek  <jakub@redhat.com>
>
>         PR target/112300
>         * config.gcc (mips*-sde-elf*): Append to tm_defines rather than
>         overwriting them.
>
> --- gcc/config.gcc.jj   2023-11-18 09:35:20.625089143 +0100
> +++ gcc/config.gcc      2023-11-24 16:41:39.194495079 +0100
> @@ -2682,22 +2682,22 @@ mips*-sde-elf*)
>         esac
>         case ${target} in
>           mipsisa32r6*)
> -           tm_defines="MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R6 MIPS_ABI_DEFAULT=ABI_32"
> +           tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R6 MIPS_ABI_DEFAULT=ABI_32"
>             ;;
>           mipsisa32r2*)
> -           tm_defines="MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R2 MIPS_ABI_DEFAULT=ABI_32"
> +           tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R2 MIPS_ABI_DEFAULT=ABI_32"
>             ;;
>           mipsisa32*)
> -           tm_defines="MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32 MIPS_ABI_DEFAULT=ABI_32"
> +           tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32 MIPS_ABI_DEFAULT=ABI_32"
>             ;;
>           mipsisa64r6*)
> -           tm_defines="MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64R6 MIPS_ABI_DEFAULT=ABI_N32"
> +           tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64R6 MIPS_ABI_DEFAULT=ABI_N32"
>             ;;
>           mipsisa64r2*)
> -           tm_defines="MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64R2 MIPS_ABI_DEFAULT=ABI_N32"
> +           tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64R2 MIPS_ABI_DEFAULT=ABI_N32"
>             ;;
>           mipsisa64*)
> -           tm_defines="MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64 MIPS_ABI_DEFAULT=ABI_N32"
> +           tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64 MIPS_ABI_DEFAULT=ABI_N32"
>             ;;
>         esac
>         ;;
>
>         Jakub
>


-- 
YunQiang Su

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

end of thread, other threads:[~2023-11-27  7:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-24 15:53 [PATCH] mips: Fix up mips*-sde-elf* build [PR112300] Jakub Jelinek
2023-11-27  7:25 ` YunQiang Su

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).