]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
build: Implement --with-multilib-list for avr target
authorMatt Jacobson <mhjacobson@me.com>
Fri, 3 Dec 2021 02:51:28 +0000 (21:51 -0500)
committerJeff Law <jeffreyalaw@gmail.com>
Fri, 3 Dec 2021 02:53:13 +0000 (21:53 -0500)
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.

gcc/config.gcc
gcc/config/avr/genmultilib.awk
gcc/config/avr/t-avr
gcc/configure
gcc/configure.ac

index edd12655c4a1e6feb09aabbee77eacd9f66b4171..1ca9d364ff07d01d6d6570feb413c34f12d20525 100644 (file)
@@ -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"
        ;;
index efe41ddb560109c3c73bd5ded820ff3ef1876034..c5f6ed0f3e336f64807cb11d7124f3a09f85592c 100644 (file)
@@ -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
index 06a0a3a76180e27986c3ae71eb07212b7a0a76c8..3120b19df81e2b573eef84c154e7ab4ba21fdf97 100644 (file)
@@ -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
index 665a0fceabe47d3bcaa2642a037461470ab72648..de20e5d26293baeb9babe3a7e3f6449bab79c511 100755 (executable)
@@ -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.
index 51f9022692a9ea569c8a9e26c43c7500f2aa34e1..2b4914b6ec199d0f4bdcd9119af7bf6f270be829 100644 (file)
@@ -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)