https://gcc.gnu.org/g:9da901fe21b2327b7a3c45549289623be8392680
commit 9da901fe21b2327b7a3c45549289623be8392680 Author: Alexandre Oliva <[email protected]> Date: Wed May 14 01:03:59 2025 -0300 [rs6000] add os-missing-powerpc64.h for powerpc-elf Disable the implicit enabling of -mpowerpc64 upon -mcpu=<ppc64-supporting>, instead of assuming the embedded operating system can save and restore all 64 bits of registers, which has ABI implications. Compiling with -mpowerpc64 explicitly restores current behavior, in case the operating system can indeed deal with this unusual scenario. for gcc/ChangeLog * config/rs6000/os-missing-powerpc64.h: New. * config.gcc <powerpc-*-elf*>: Add it. Diff: --- gcc/config.gcc | 2 +- gcc/config/rs6000/os-missing-powerpc64.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index 14b1e9b87e36..f0196f753491 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -3107,7 +3107,7 @@ powerpc-*-eabisim*) use_gcc_stdint=wrap ;; powerpc-*-elf*) - tm_file="${tm_file} elfos.h gnu-user.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h" + tm_file="${tm_file} elfos.h gnu-user.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/os-missing-powerpc64.h" extra_options="${extra_options} rs6000/sysv4.opt" tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" ;; diff --git a/gcc/config/rs6000/os-missing-powerpc64.h b/gcc/config/rs6000/os-missing-powerpc64.h new file mode 100644 index 000000000000..0e9fd34868da --- /dev/null +++ b/gcc/config/rs6000/os-missing-powerpc64.h @@ -0,0 +1,28 @@ +/* Adjust for operating systems without 64-bit support. + Copyright (C) 2025 Free Software Foundation, Inc. + Contributed by Richard Kenner ([email protected]) + + 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. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + <http://www.gnu.org/licenses/>. */ + +/* This setting arranges for the compiler to *not* enable -mpowerpc64 + implicitly when a 64-bit CPU is selected while building in 32-bit mode. */ +#define OS_MISSING_POWERPC64 !TARGET_64BIT
