diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2007-02-09 13:47:25 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2007-02-09 13:47:25 +0000 |
commit | 10e96df47c9067b69bde01f173a3869896ab388e (patch) | |
tree | 4527096677ae7ba2446c6bd23836879869baca44 /gcc/config | |
parent | b44e7f07c5a8b8dfe7549583d3504f1a39208b03 (diff) | |
download | gcc-10e96df47c9067b69bde01f173a3869896ab388e.zip gcc-10e96df47c9067b69bde01f173a3869896ab388e.tar.gz gcc-10e96df47c9067b69bde01f173a3869896ab388e.tar.bz2 |
200x-xx-xx Nathan Sidwell <nathan@codesourcery.com> Richard Sandiford <richard@codesourcery.com>
gcc/
200x-xx-xx Nathan Sidwell <nathan@codesourcery.com>
Richard Sandiford <richard@codesourcery.com>
* config.gcc (m68010-*-netbsdelf*, m68k*-*-netbsdelf*)
(m68k*-*-openbsd*, m68k-*-linux*): Set default_cf_cpu.
(m68k-*-aout*, m68k-*-coff*, m68k-*-uclinux*, m68k-*-rtems*): Add
m68k/t-mlib to tmake_file.
(m68020-*-elf*, m68k-*-elf*): Likewise. Add t-m68kbare as well.
(m68k*-*-*): Use --with-arch to pick a default for --with-cpu.
(m680[012]0-*-*, m68k*-*-*): Add support for --with-arch.
Allow it to be cf or m68k. Set m68k_arch_family. If that
variable is not empty, add t-$m68k_arch_family to tmake_file.
Add t-mlibs to tmake_file.
* doc/install.texi: Document --with-arch=m68k and --with-arch=cf.
* config/m68k/t-cf: New file.
* config/m68k/t-m68k: Likewise.
* config/m68k/t-mlibs: Likewise.
* config/m68k/t-m68kbare (MULTILIB_OPTIONS, MULTILIB_DIRNAMES)
(MULTILIB_MATCHES, MULTILIB_EXCEPTIONS): Delete.
(M68K_MLIB_DIRNAMES, M68K_MLIB_OPTIONS): Define.
* config/m68k/t-m68kelf (MULTILIB_OPTIONS, MULTILIB_DIRNAMES)
(MULTILIB_MATCHES, MULTILIB_EXCEPTIONS, LIBGCC, INSTALL_LIBGCC):
Delete.
* config/m68k/t-openbsd (MULTILIB_OPTIONS, LIBGCC): Delete.
(INSTALL_LIBGCC): Delete.
(M68K_MLIB_DIRNAMES, M68K_MLIB_OPTIONS): Define.
* config/m68k/t-rtems (MULTILIB_OPTIONS, MULTILIB_DIRNAMES)
(MULTILIB_MATCHES, MULTILIB_EXCEPTIONS): Delete.
(M68K_MLIB_CPU): Define.
* config/m68k/t-uclinux (MULTILIB_OPTIONS, MULTILIB_DIRNAMES)
(MULTILIB_MATCHES, MULTILIB_EXCEPTIONS): Delete.
(M68K_MLIB_CPU, M68K_MLIB_OPTIONS, M68K_MLIB_DIRNAMES): Define.
Co-Authored-By: Richard Sandiford <richard@codesourcery.com>
From-SVN: r121743
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/m68k/t-cf | 4 | ||||
-rw-r--r-- | gcc/config/m68k/t-m68k | 4 | ||||
-rw-r--r-- | gcc/config/m68k/t-m68kbare | 9 | ||||
-rw-r--r-- | gcc/config/m68k/t-m68kelf | 12 | ||||
-rw-r--r-- | gcc/config/m68k/t-mlibs | 97 | ||||
-rw-r--r-- | gcc/config/m68k/t-openbsd | 5 | ||||
-rw-r--r-- | gcc/config/m68k/t-rtems | 9 | ||||
-rw-r--r-- | gcc/config/m68k/t-uclinux | 11 |
8 files changed, 118 insertions, 33 deletions
diff --git a/gcc/config/m68k/t-cf b/gcc/config/m68k/t-cf new file mode 100644 index 0000000..6979466 --- /dev/null +++ b/gcc/config/m68k/t-cf @@ -0,0 +1,4 @@ +# Select only ColdFire-specific CPUs. + +M68K_MLIB_CPU += && (CPU ~ "^mcf") +M68K_ARCH := cf diff --git a/gcc/config/m68k/t-m68k b/gcc/config/m68k/t-m68k new file mode 100644 index 0000000..cbff34d --- /dev/null +++ b/gcc/config/m68k/t-m68k @@ -0,0 +1,4 @@ +# Select only 680x0-specific CPUs. + +M68K_MLIB_CPU += && (CPU !~ "^mcf") +M68K_ARCH := m68k diff --git a/gcc/config/m68k/t-m68kbare b/gcc/config/m68k/t-m68kbare index 7a93d620..0cbaead 100644 --- a/gcc/config/m68k/t-m68kbare +++ b/gcc/config/m68k/t-m68kbare @@ -1,7 +1,4 @@ -MULTILIB_OPTIONS = m68000/m68020/m5200/mcpu32/m68040/m68060 m68881/msoft-float -MULTILIB_DIRNAMES = -MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 mcpu32=m68332 m68020=mc68020 -MULTILIB_EXCEPTIONS = m68000/msoft-float m5200/m68881 m5200/msoft-float mcpu32/m68881 mcpu32/msoft-float m68040/m68881 m68060/m68881 +# Add soft-float multilibs. +M68K_MLIB_DIRNAMES += softfp +M68K_MLIB_OPTIONS += msoft-float -LIBGCC = stmp-multilib -INSTALL_LIBGCC = install-multilib diff --git a/gcc/config/m68k/t-m68kelf b/gcc/config/m68k/t-m68kelf index a88d323..bea01dc 100644 --- a/gcc/config/m68k/t-m68kelf +++ b/gcc/config/m68k/t-m68kelf @@ -1,15 +1,3 @@ -MULTILIB_OPTIONS = m68000/m68020/m5200/m5206e/m528x/m5307/m5407/mcfv4e/mcpu32/m68040/m68060 m68881/msoft-float -MULTILIB_DIRNAMES = -MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 mcpu32=m68332 m68020=mc68020 m5206e=m5272 -MULTILIB_EXCEPTIONS = m68000/msoft-float m5200/m68881 m5200/msoft-float \ - m5206e/m68881 m5206e/msoft-float m528x/m68881 m528x/msoft-float \ - m5307/m68881 m5307/msoft-float m5407/m68881 m5407/msoft-float \ - mcpu32/m68881 mcpu32/msoft-float m68040/m68881 m68040/msoft-float \ - m68060/m68881 m68060/msoft-float \ - mcfv4e/msoft-float mcfv4e/m68881 -LIBGCC = stmp-multilib -INSTALL_LIBGCC = install-multilib - # from ../t-svr4 EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o # no pic for now diff --git a/gcc/config/m68k/t-mlibs b/gcc/config/m68k/t-mlibs new file mode 100644 index 0000000..6ce35a1 --- /dev/null +++ b/gcc/config/m68k/t-mlibs @@ -0,0 +1,97 @@ +# multilibs -*- mode:Makefile -*- + +# An awk command to extract lines from the m68k-devices.def file that +# match $1 and then print the string defined by $2. Leading and +# trailing whitespace is removed. $1 & $2 can make use of +# CPU -- the cpu identifier (has leading 'm'/'mcf') +# FLAGS -- the cpu capability flags +# CPU_NAME -- the cpu name (has no leading m/mcf) +# MLIB -- the multilib cpu name (no leading m/mcf) +# This is intended to be used as $(call M68K_AWK,predicate,string) +M68K_AWK = $(strip $(shell $(AWK) 'BEGIN { FS="[ \t]*[,()][ \t]*"; ORS=" " }; \ + /^M68K_DEVICE/ { CPU=$$3; FLAGS=$$8; \ + CPU_NAME=substr($$2,2,length($$2)-2); \ + MLIB=substr($$5,2,length($$5)-2); \ + if ($1) print $2 }' $(srcdir)/config/m68k/m68k-devices.def)) + +# Add a multilib for each distinct architecture. M68K_MLIB_CPU, if defined, +# adds additional restrictions. +M68K_MLIB_CPUS := $(call M68K_AWK,\ + (CPU_NAME == MLIB) $(M68K_MLIB_CPU), \ + "m"MLIB) + +# Make the default cpu the default multilib. +M68K_MLIB_DEFAULT := $(call M68K_AWK, CPU == "$(target_cpu_default)", MLIB) + +ifeq ($(filter m$(M68K_MLIB_DEFAULT),$(M68K_MLIB_CPUS)),) +$(error Error default cpu '$(target_cpu_default)' is not in multilib set '$(M68K_MLIB_CPUS)') +endif + +# Sed arguments that convert mcpu=* arguments into canonical forms. +# We want to use the legacy m68* options instead of the new -mcpu=68* +# options when compiling multilibs because the former are recognised +# by older binutils. +CANONICALIZE_OPTIONS = -e 's|mcpu=68|m68|g' -e 's|mcpu=cpu32|mcpu32|g' + +MULTILIB_DIRNAMES := $(filter-out m$(M68K_MLIB_DEFAULT),$(M68K_MLIB_CPUS)) +MULTILIB_OPTIONS := $(shell echo $(MULTILIB_DIRNAMES:m%=mcpu=%) \ + | sed -e 's| |/|g' $(CANONICALIZE_OPTIONS)) + +# Add subtarget specific options & dirs. +MULTILIB_DIRNAMES += $(M68K_MLIB_DIRNAMES) +MULTILIB_OPTIONS += $(M68K_MLIB_OPTIONS) + +MULTILIB_MATCHES := + +ifneq ($(M68K_ARCH),cf) +# Map the new-style options to the legacy m68k ones. +MULTILIB_MATCHES += m68000=mcpu?68000 m68000=march?68000 m68000=mc68000 \ + m68000=m68302 \ + m68020=mcpu?68020 m68020=march?68020 m68020=mc68020 \ + m68030=mcpu?68030 m68030=march?68030 \ + m68040=mcpu?68040 m68040=march?68040 \ + m68060=mcpu?68060 m68060=march?68060 \ + mcpu32=mcpu?cpu32 mcpu32=march?cpu32 mcpu32=m68332 +endif + +ifneq ($(M68K_ARCH),m68k) +# Map the legacy ColdFire options to the new ones. +MULTILIB_MATCHES += mcpu?5206=m5200 mcpu?5206e=m5206e mcpu?5208=m528x \ + mcpu?5307=m5300 mcpu?5307=m5307 \ + mcpu?5407=m5400 mcpu?5407=m5407 \ + mcpu?5475=mcfv4e +# Map -march=* options to the representative -mcpu=* option. +MULTILIB_MATCHES += mcpu?5206e=march?isaa mcpu?5208=march?isaaplus \ + mcpu?5407=march?isab +endif + +# Match non-representative -mcpu options to their representative option. +MULTILIB_MATCHES += \ + $(call M68K_AWK, \ + (CPU_NAME != MLIB) $(M68K_MLIB_CPU), \ + (match(MLIB, "^68") || MLIB == "cpu32" \ + ? "m"MLIB"=mcpu?"CPU_NAME \ + : "mcpu?"MLIB"=mcpu?"CPU_NAME)) + +MULTILIB_EXCEPTIONS := + +ifeq ($(firstword $(M68K_MLIB_OPTIONS)),msoft-float) +# Exclude soft-float multilibs for targets that default to soft-float anyway. +MULTILIB_EXCEPTIONS += $(call M68K_AWK,\ + (CPU_NAME == MLIB) $(M68K_MLIB_CPU) \ + && (((CPU ~ "^mcf") && !match(FLAGS, "FL_CF_FPU")) \ + || CPU == "cpu32" \ + || CPU == "m68000"), \ + "mcpu="MLIB"/msoft-float*") +endif + +# Remove the default CPU from the explicit exceptions. +MULTILIB_EXCEPTIONS := \ + $(patsubst mcpu=$(M68K_MLIB_DEFAULT)/%,%,$(MULTILIB_EXCEPTIONS)) + +# Convert all options to canonical form. +MULTILIB_EXCEPTIONS := $(shell echo $(MULTILIB_EXCEPTIONS) | \ + sed $(CANONICALIZE_OPTIONS)) + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib diff --git a/gcc/config/m68k/t-openbsd b/gcc/config/m68k/t-openbsd index 24f9a43..b295608 100644 --- a/gcc/config/m68k/t-openbsd +++ b/gcc/config/m68k/t-openbsd @@ -1,5 +1,4 @@ # gdb gets confused if pic code is linked with non pic # We cope by building all variants of libgcc. -MULTILIB_OPTIONS = fpic/fPIC -LIBGCC = stmp-multilib -INSTALL_LIBGCC = install-multilib +M68K_MLIB_OPTIONS += fpic/fPIC +M68K_MLIB_DIRNAMES += fpic fPIC diff --git a/gcc/config/m68k/t-rtems b/gcc/config/m68k/t-rtems index e660da2..1cf45f5 100644 --- a/gcc/config/m68k/t-rtems +++ b/gcc/config/m68k/t-rtems @@ -1,7 +1,4 @@ # Custom multilibs for RTEMS - -MULTILIB_OPTIONS = m68000/m68020/m5200/mcpu32/m68030/m68040/m68060 m68881/msoft-float -MULTILIB_DIRNAMES = -MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 mcpu32=m68332 m68020=mc68020 m68030=mc68030 -MULTILIB_MATCHES += m5200=m528x -MULTILIB_EXCEPTIONS = m68000/msoft-float m5200/m68881 m5200/msoft-float mcpu32/m68881 mcpu32/msoft-float m68040/m68881 m68060/m68881 +M68K_MLIB_CPU += && (match(MLIB, "^68") \ + || MLIB == "cpu32" \ + || MLIB == "5206") diff --git a/gcc/config/m68k/t-uclinux b/gcc/config/m68k/t-uclinux index bebae9c..f705364 100644 --- a/gcc/config/m68k/t-uclinux +++ b/gcc/config/m68k/t-uclinux @@ -1,10 +1,9 @@ # crti and crtn are provided by uClibc. EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o -MULTILIB_OPTIONS = m68000/m5200/m5206e/m528x/m5307/m5407/mcpu32 msep-data/mid-shared-library -MULTILIB_DIRNAMES = -MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 mcpu32=m68332 m5206e=m5272 -MULTILIB_EXCEPTIONS = m68000/msep-data* m68000/mid-shared-library* msep-data* mid-shared-library* +# Only include multilibs for the 68020 and for CPUs without an MMU. +M68K_MLIB_CPU += && (MLIB == "68020" || !match(FLAGS, "FL_MMU")) -LIBGCC = stmp-multilib -INSTALL_LIBGCC = install-multilib +# Add multilibs for execute-in-place and shared-library code. +M68K_MLIB_OPTIONS += msep-data/mid-shared-library +M68K_MLIB_DIRNAMES += msep-data mid-shared-library |