svr4.h avoidance: rs6000/powerpc

David Edelsohn dje.gcc@gmail.com
Mon Dec 20 17:18:00 GMT 2010


On Wed, Dec 15, 2010 at 7:18 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> This patch in the series removing svr4.h from the headers used by
> particular targets in GCC stops powerpc*-* targets from using svr4.h.
>
> Sixteen config.gcc stanzas are involved.  They all use rs6000/sysv4.h
> after svr4.h, which means many macro definitions in svr4.h can be
> ignored because rs6000/sysv4.h overrides them, but when the remainder
> are added to sysv4.h it becomes necessary to allow for the three
> stanzas that use rs6000/sysv4.h without svr4.h: powerpc*-*-freebsd*
> powerpc-*-netbsd* powerpc-*-lynxos*.
>
> All affected targets can be presumed to use the GNU assembler, meaning
> that SVR4_ASM_SPEC can be presumed to be the empty string.  As for the
> other macros, the #undef of DBX_REGISTER_NUMBER affects the targets
> that used svr4.h, and when it moves into rs6000/sysv4.h it becomes
> necessary to redefine it for the three targets mentioned above in
> their own headers to avoid perturbing the configuration for those
> targets.  SIZE_TYPE is also used from svr4.h, but the three targets
> mentioned all already undefine and possibly redefine SIZE_TYPE so
> there is no problem with adding that macro to rs6000/sysv4.h
> (alongside PTRDIFF_TYPE which is already there).
>
> With this and the i386 changes
> (<http://gcc.gnu.org/ml/gcc-patches/2010-12/msg01155.html>, pending
> review) all remaining uses of svr4.h are eliminated.  Once both
> patches are in I'll prepare the final patch in the svr4.h series,
> removing the header and updating all comments referring to it.
>
> Tested building cc1 and xgcc for crosses to: powerpc-eabispe
> powerpc-eabisimaltivec powerpc-eabisim powerpc-elf powerpc-eabialtivec
> powerpc-xilinx-eabi powerpc-eabi powerpc-rtems powerpc-linux-gnu
> powerpc64-linux-gnu powerpc64-gnu powerpc-gnu-gnualtivec powerpc-gnu
> powerpc-wrs-vxworks powerpc-wrs-vxworksae powerpcle-elf
> powerpcle-eabisim powerpcle-eabi powerpc-freebsd8 powerpc-netbsd
> powerpc-lynxos.  OK to commit?
>
> (Like the i386 patch, this patch is relative to a tree with
> <http://gcc.gnu.org/ml/gcc-patches/2010-12/msg00672.html> (pending
> review) applied, but does not depend on that patch at all; it was used
> in testing simply because it is required for GNU Hurd targets to
> build.)
>
> 2010-12-15  Joseph Myers  <joseph@codesourcery.com>
>
>        * config/rs6000/freebsd.h (SVR4_ASM_SPEC): Don't define.
>        (DBX_REGISTER_NUMBER): Define.
>        * config/rs6000/lynx.h (DBX_REGISTER_NUMBER): Define.
>        * config/rs6000/netbsd.h (DBX_REGISTER_NUMBER): Define.
>        * config/rs6000/sysv4.h (SIZE_TYPE): Define.
>        (ASM_SPEC): Define without using SVR4_ASM_SPEC.
>        (DBX_REGISTER_NUMBER): Undefine.
>        * config.gcc (powerpc-*-eabispe*, powerpc-*-eabisimaltivec*,
>        powerpc-*-eabisim*, powerpc-*-elf*, powerpc-*-eabialtivec*,
>        powerpc-xilinx-eabi*, powerpc-*-eabi*, powerpc-*-rtems*,
>        powerpc-*-linux* | powerpc64-*-linux*, powerpc64-*-gnu*,
>        powerpc-*-gnu-gnualtivec*, powerpc-*-gnu*,
>        powerpc-wrs-vxworks|powerpc-wrs-vxworksae, powerpcle-*-elf*,
>        powerpcle-*-eabisim*, powerpcle-*-eabi*): Don't use svr4.h.

Okay.

Thanks for cleaning this up.

- David



More information about the Gcc-patches mailing list