public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5763] build: Implement --with-multilib-list for avr target
@ 2021-12-03  2:53 Jeff Law
  0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2021-12-03  2:53 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:711084c9450c49b372e177d94ae99fc642e1cc73

commit r12-5763-g711084c9450c49b372e177d94ae99fc642e1cc73
Author: Matt Jacobson <mhjacobson@me.com>
Date:   Thu Dec 2 21:51:28 2021 -0500

    build: Implement --with-multilib-list for avr target
    
    gcc
    
            * config.gcc: For the AVR target, populate TM_MULTILIB_CONFIG.
            * config/avr/genmultilib.awk: Add ability to filter generated multilib
            list.
            * config/avr/t-avr: Pass TM_MULTILIB_CONFIG to genmultilib.awk.
            * configure.ac: Update help string for --with-multilib-list.
            * configure: Regenerate.

Diff:
---
 gcc/config.gcc                 |  7 +++++++
 gcc/config/avr/genmultilib.awk | 16 ++++++++++++++++
 gcc/config/avr/t-avr           |  1 +
 gcc/configure                  |  4 ++--
 gcc/configure.ac               |  2 +-
 5 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/gcc/config.gcc b/gcc/config.gcc
index edd12655c4a..1ca9d364ff0 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -4315,6 +4315,13 @@ case "${target}" in
 		fi
 		;;
 
+	avr-*-*)
+		# Handle --with-multilib-list.
+		if test "x${with_multilib_list}" != xdefault; then
+			TM_MULTILIB_CONFIG="${with_multilib_list}"
+		fi
+	;;
+
     csky-*-*)
 	supported_defaults="cpu endian float"
 	;;
diff --git a/gcc/config/avr/genmultilib.awk b/gcc/config/avr/genmultilib.awk
index efe41ddb560..c5f6ed0f3e3 100644
--- a/gcc/config/avr/genmultilib.awk
+++ b/gcc/config/avr/genmultilib.awk
@@ -67,6 +67,16 @@ BEGIN {
 
     dir_long_double = "long-double"   (96 - with_long_double)
     opt_long_double = "mlong-double=" (96 - with_long_double)
+
+    if (with_multilib_list != "")
+    {
+	split(with_multilib_list, multilib_list, ",")
+
+	for (i in multilib_list)
+	{
+	    multilibs[multilib_list[i]] = 1
+	}
+    }
 }
 
 ##################################################################
@@ -137,6 +147,9 @@ BEGIN {
 	if (core == "avr1")
 	    next
 
+	if (with_multilib_list != "" && !(core in multilibs))
+	    next
+
 	option[core] = "mmcu=" core
 
 	m_options  = m_options m_sep option[core]
@@ -150,6 +163,9 @@ BEGIN {
     if (core == "avr1")
 	next
 
+    if (with_multilib_list != "" && !(core in multilibs))
+	next
+
     opts = option[core]
 
     # split device specific feature list
diff --git a/gcc/config/avr/t-avr b/gcc/config/avr/t-avr
index 06a0a3a7618..3120b19df81 100644
--- a/gcc/config/avr/t-avr
+++ b/gcc/config/avr/t-avr
@@ -127,6 +127,7 @@ t-multilib-avr: $(srcdir)/config/avr/genmultilib.awk \
 		-v HAVE_LONG_DOUBLE64=$(HAVE_LONG_DOUBLE64) 		\
 		-v with_double=$(WITH_DOUBLE) 				\
 		-v with_long_double=$(WITH_LONG_DOUBLE)			\
+		-v with_multilib_list=$(TM_MULTILIB_CONFIG)		\
 		-f $< $< $(AVR_MCUS) > $@
 
 include t-multilib-avr
diff --git a/gcc/configure b/gcc/configure
index 665a0fceabe..de20e5d2629 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1831,8 +1831,8 @@ Optional Packages:
                           Root for documentation URLs
   --with-changes-root-url=URL
                           Root for GCC changes URLs
-  --with-multilib-list    select multilibs (AArch64, ARM, OR1K, RISC-V, SH and
-                          x86-64 only)
+  --with-multilib-list    select multilibs (AArch64, ARM, AVR, OR1K, RISC-V,
+                          SH and x86-64 only)
   --with-multilib-generator
                           Multi-libs configuration string (RISC-V only)
   --with-zstd=PATH        specify prefix directory for installed zstd library.
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 51f9022692a..2b4914b6ec1 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1171,7 +1171,7 @@ if test "x$enable_offload_defaulted" = xyes; then
 fi
 
 AC_ARG_WITH(multilib-list,
-[AS_HELP_STRING([--with-multilib-list], [select multilibs (AArch64, ARM, OR1K, RISC-V, SH and x86-64 only)])],
+[AS_HELP_STRING([--with-multilib-list], [select multilibs (AArch64, ARM, AVR, OR1K, RISC-V, SH and x86-64 only)])],
 :,
 with_multilib_list=default)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-03  2:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03  2:53 [gcc r12-5763] build: Implement --with-multilib-list for avr target Jeff Law

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