Remove the hack where libgcc's t-avrlibc makefile snippet
copies a multilib variant when it concludes that the variant's
target code doesn't depend on -m[long-]double=.

The hack was only used in the specific case when GCC was
configured with some non-default values for --with-libf7=.
It had been introduced to save some build time.

The patch restores the usual way to build multilibs.
In particular, it no more copies around multilibs by
hand, even in the case where the target code in the
multilib is the same.

Applied to trunk.

Johann

--

        PR target/127071
libgcc/
        * config/avr/t-copy-libgcc: Remove file.
        * config/avr/t-avrlibc: Remove code to pull in t-copy-libgcc.

libgcc/config/avr/libf7/
        * t-libf7-math-symbols: Adjust comment.
diff --git a/libgcc/config/avr/libf7/t-libf7-math-symbols b/libgcc/config/avr/libf7/t-libf7-math-symbols
index c79e2b6ca71..4bba08ecfb7 100644
--- a/libgcc/config/avr/libf7/t-libf7-math-symbols
+++ b/libgcc/config/avr/libf7/t-libf7-math-symbols
@@ -1,10 +1,7 @@
 # Triggered by --with-libf7=math-symbols
 #
-# We have at least one module in libgcc that depends on __SIZEOF_DOUBLE__
-# or __SIZEOF_LONG_DOUBLE__ which means that t-avrlibc must not copy
-# double32/64 or long-double32/64 variants from the vanilla one.
-# This occurs when some module(s) define(s) weak aliases for functions
-# that usually live in libm.
+# Add weak aliases for the math.h functions, like sin for __f7_sin
+# when double is a 64-bit type, and similar for sinl and long double.
 
 WITH_LIBF7_MATH_SYMBOLS = 1
 
diff --git a/libgcc/config/avr/t-avrlibc b/libgcc/config/avr/t-avrlibc
index 661a518c0fd..d2c8b870aab 100644
--- a/libgcc/config/avr/t-avrlibc
+++ b/libgcc/config/avr/t-avrlibc
@@ -64,41 +64,3 @@ LIB2FUNCS_EXCLUDE += \
 	_fixunssfsi _fixsfdi \
 	_fixunssfdi \
 	_floatdisf _floatundisf
-
-ifeq (,$(WITH_LIBF7_MATH_SYMBOLS))
-
-# No modules depend on __SIZEOF_LONG_DOUBLE__ or __SIZEOF_DOUBLE__
-# which means we might have an opportunity to copy libgcc.a.
-# WITH_LIBF7_MATH_SYMBOLS is set by libf7/t-libf7-math-symbols.
-
-ifneq (,$(findstring avr,$(MULTISUBDIR)))
-
-# We are not in the avr2 (default) subdir, hence copying will work.
-# In default dir, copying won'twork because the default multilib is
-# built after all the others.
-
-ifneq (,$(findstring double,$(MULTISUBDIR)))
-
-# We are in double{32|64}/libgcc or long-double{32|64}/libgcc:
-# Just copy from the [long ]double=float multilib; we would remove any DFmode
-# bits from this multilib variant, anyway, because the current assumption
-# is that avr-libc hosts *all* the IEEE-double stuff.
-
-LIB2FUNCS_EXCLUDE := %
-LIB1ASMFUNCS :=
-libgcc-objects :=
-libgcov-objects :=
-objects :=
-
-t-copy-libgcc.dep: $(srcdir)/config/avr/t-copy-libgcc
-	-rm -f libgcc.a
-	-rm -f libgcov.a
-	cp $< $@
-
-libgcc.a libgcov.a libgcc_tm.h: t-copy-libgcc.dep
-
-Makefile: t-copy-libgcc.dep
-
-endif
-endif
-endif
diff --git a/libgcc/config/avr/t-copy-libgcc b/libgcc/config/avr/t-copy-libgcc
deleted file mode 100644
index d34cbde731b..00000000000
--- a/libgcc/config/avr/t-copy-libgcc
+++ /dev/null
@@ -1,13 +0,0 @@
-# Only used with --with-avrlibc & (-mlong-double=64 | -mdouble=64)
-#
-# Inserted at the end of Makefile by magic[tm].
-# We need this *after* Makefile's rules so we can override them.
-
-libgcc.a: ../../libgcc/libgcc.a
-	cp $< $@
-
-libgcov.a: ../../libgcc/libgcov.a
-	@:
-ifeq ($(enable_gcov),yes)
-	cp $< $@
-endif

Reply via email to