From: Ralf Corsepius Date: Thu, 30 Jan 2003 14:03:42 +0000 (+0000) Subject: re PR target/9316 (powerpc-rtems/extending multilibs) X-Git-Tag: releases/gcc-3.2.2~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1400c26485036052b5dba5fa42ccc6dec18e219a;p=thirdparty%2Fgcc.git re PR target/9316 (powerpc-rtems/extending multilibs) 2003-01-30 Ralf Corsepius PR target/9316 * config/rs6000/rtems.h: Add CPP_OS_DEFAULT_SPEC. * config/rs6000/sysv4.h: Add CPP_OS_RTEMS_SPEC. * config/rs6000/t-rtems: New file. multilib variants to match OS. * config.gcc (powerpc-*-rtems*): Use rs6000/t-rtems instead of rs6000/t-ppcgas so we get the desired multilibs. From-SVN: r62136 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 33a731e83cde..ee67df950a37 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2003-01-30 Ralf Corsepius + + PR target/9316 + * config/rs6000/rtems.h: Add CPP_OS_DEFAULT_SPEC. + * config/rs6000/sysv4.h: Add CPP_OS_RTEMS_SPEC. + * config/rs6000/t-rtems: New file. multilib variants to match OS. + * config.gcc (powerpc-*-rtems*): Use rs6000/t-rtems instead of + rs6000/t-ppcgas so we get the desired multilibs. + 2003-01-29 Joel Sherrill * gthr-rtems.h: Define __GTHREAD_MUTEX_INIT. Apparently no code diff --git a/gcc/config.gcc b/gcc/config.gcc index 8971702a9cfa..bb71f51a3ec9 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1,5 +1,5 @@ # GCC build-, host- and target-specific configuration file. -# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. #This file is part of GCC. @@ -2839,7 +2839,7 @@ powerpc-*-eabi*) powerpc-*-rtems*) xm_defines=POSIX tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/rtems.h rtems.h" - tmake_file="rs6000/t-ppcgas t-rtems rs6000/t-ppccomm" + tmake_file="rs6000/t-rtems t-rtems rs6000/t-ppccomm" if test x$enable_threads = xyes; then thread_file='rtems' fi diff --git a/gcc/config/rs6000/rtems.h b/gcc/config/rs6000/rtems.h index aa68130ba17e..cc8295af8672 100644 --- a/gcc/config/rs6000/rtems.h +++ b/gcc/config/rs6000/rtems.h @@ -1,5 +1,5 @@ /* Definitions for rtems targeting a PowerPC using elf. - Copyright (C) 1996, 1997, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Joel Sherrill (joel@OARcorp.com). This file is part of GNU CC. @@ -22,5 +22,8 @@ Boston, MA 02111-1307, USA. */ /* Specify predefined symbols in preprocessor. */ #undef CPP_PREDEFINES -#define CPP_PREDEFINES "-DPPC -D__rtems__ \ +#define CPP_PREDEFINES "-DPPC -D__rtems__ -D__USE_INIT_FINI__ \ -Asystem=rtems -Acpu=powerpc -Amachine=powerpc" + +#undef CPP_OS_DEFAULT_SPEC +#define CPP_OS_DEFAULT_SPEC "%(cpp_os_rtems)" diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h index 635e926f8c83..ecc37ee25ed5 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -1,5 +1,5 @@ /* Target definitions for GNU compiler for PowerPC running System V.4 - Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -1318,6 +1318,21 @@ ncrtn.o%s" #define CPP_OS_NETBSD_SPEC "\ -D__powerpc__ -D__NetBSD__ -D__ELF__ -D__KPRINTF_ATTRIBUTE__" +/* RTEMS support. */ + +#define CPP_OS_RTEMS_SPEC "\ +%{!mcpu*: %{!Dppc*: %{!Dmpc*: -Dmpc750} } }\ +%{mcpu=403: %{!Dppc*: %{!Dmpc*: -Dppc403} } } \ +%{mcpu=505: %{!Dppc*: %{!Dmpc*: -Dmpc505} } } \ +%{mcpu=601: %{!Dppc*: %{!Dmpc*: -Dppc601} } } \ +%{mcpu=602: %{!Dppc*: %{!Dmpc*: -Dppc602} } } \ +%{mcpu=603: %{!Dppc*: %{!Dmpc*: -Dppc603} } } \ +%{mcpu=603e: %{!Dppc*: %{!Dmpc*: -Dppc603e} } } \ +%{mcpu=604: %{!Dppc*: %{!Dmpc*: -Dmpc604} } } \ +%{mcpu=750: %{!Dppc*: %{!Dmpc*: -Dmpc750} } } \ +%{mcpu=821: %{!Dppc*: %{!Dmpc*: -Dmpc821} } } \ +%{mcpu=860: %{!Dppc*: %{!Dmpc*: -Dmpc860} } }" + /* VxWorks support. */ /* VxWorks does all the library stuff itself. */ #define LIB_VXWORKS_SPEC "" @@ -1439,6 +1454,7 @@ ncrtn.o%s" { "cpp_os_linux", CPP_OS_LINUX_SPEC }, \ { "cpp_os_netbsd", CPP_OS_NETBSD_SPEC }, \ { "cpp_os_vxworks", CPP_OS_VXWORKS_SPEC }, \ + { "cpp_os_rtems", CPP_OS_RTEMS_SPEC }, \ { "cpp_os_default", CPP_OS_DEFAULT_SPEC }, /* Define this macro as a C expression for the initializer of an diff --git a/gcc/config/rs6000/t-rtems b/gcc/config/rs6000/t-rtems new file mode 100644 index 000000000000..364a22d22783 --- /dev/null +++ b/gcc/config/rs6000/t-rtems @@ -0,0 +1,86 @@ +# Multilibs for powerpc RTEMS targets. + +MULTILIB_OPTIONS = \ +mcpu=403/mcpu=505/mcpu=601/mcpu=602/mcpu=603/mcpu=603e/mcpu=604/mcpu=750/mcpu=821/mcpu=860 \ +Dmpc509/Dmpc8260 \ +D_OLD_EXCEPTIONS \ +msoft-float + +MULTILIB_DIRNAMES = \ +m403 m505 m601 m602 m603 m603e m604 m750 m821 m860 \ +mpc509 \ +mpc8260 \ +roe \ +nof + +MULTILIB_EXTRA_OPTS = mrelocatable-lib mno-eabi mstrict-align + +# MULTILIB_MATCHES = ${MULTILIB_MATCHES_FLOAT} +MULTILIB_MATCHES = ${MULTILIB_MATCHES_ENDIAN} \ + ${MULTILIB_MATCHES_SYSV} \ + mcpu?505/Dmpc505=mcpu?505/Dmpc509 + +# +# RTEMS old/new-exceptions handling +# +# old-exception processing is depredicated, therefore +# +# * Cpu-variants supporting new exception processing are build +# with new exception processing only +# * Cpu-variants not having been ported to new exception processing are +# build with old and new exception processing +# + +# Cpu-variants supporting new exception processing only +MULTILIB_NEW_EXCEPTIONS_ONLY = \ +*mcpu=604*/*D_OLD_EXCEPTIONS* \ +*mcpu=750*/*D_OLD_EXCEPTIONS* \ +*mcpu=821*/*D_OLD_EXCEPTIONS* \ +*Dmpc8260*/*D_OLD_EXCEPTIONS* \ +*mcpu=860*/*D_OLD_EXCEPTIONS* + +# Soft-float only, default implies msoft-float +# NOTE: Must match with MULTILIB_MATCHES_FLOAT and MULTILIB_MATCHES +MULTILIB_SOFTFLOAT_ONLY = \ +mcpu=403/*msoft-float* \ +mcpu=821/*msoft-float* \ +mcpu=860/*msoft-float* + +# Hard-float only, take out msoft-float +MULTILIB_HARDFLOAT_ONLY = \ +mcpu=505/*msoft-float* + +MULTILIB_EXCEPTIONS = + +# Disallow -D_OLD_EXCEPTIONS without other options +MULTILIB_EXCEPTIONS += D_OLD_EXCEPTIONS* + +# Disallow -Dppc and -Dmpc without other options +MULTILIB_EXCEPTIONS += Dppc* Dmpc* + +MULTILIB_EXCEPTIONS += \ +${MULTILIB_NEW_EXCEPTIONS_ONLY} \ +${MULTILIB_SOFTFLOAT_ONLY} \ +${MULTILIB_HARDFLOAT_ONLY} + +# Special rules +# Take out all variants we don't want +MULTILIB_EXCEPTIONS += mcpu=403/Dmpc509* +MULTILIB_EXCEPTIONS += mcpu=403/Dmpc8260* +MULTILIB_EXCEPTIONS += mcpu=505/Dmpc509* +MULTILIB_EXCEPTIONS += mcpu=505/Dmpc8260* +MULTILIB_EXCEPTIONS += mcpu=601/Dmpc509* +MULTILIB_EXCEPTIONS += mcpu=601/Dmpc8260* +MULTILIB_EXCEPTIONS += mcpu=602/Dmpc509* +MULTILIB_EXCEPTIONS += mcpu=602/Dmpc8260* +MULTILIB_EXCEPTIONS += mcpu=603/Dmpc509* +MULTILIB_EXCEPTIONS += mcpu=603/Dmpc8260* +MULTILIB_EXCEPTIONS += mcpu=603e/Dmpc509* +MULTILIB_EXCEPTIONS += mcpu=604/Dmpc509* +MULTILIB_EXCEPTIONS += mcpu=604/Dmpc8260* +MULTILIB_EXCEPTIONS += mcpu=750/Dmpc509* +MULTILIB_EXCEPTIONS += mcpu=750/Dmpc8260* +MULTILIB_EXCEPTIONS += mcpu=821/Dmpc509* +MULTILIB_EXCEPTIONS += mcpu=821/Dmpc8260* +MULTILIB_EXCEPTIONS += mcpu=860/Dmpc509* +MULTILIB_EXCEPTIONS += mcpu=860/Dmpc8260*