diff mbox series

[Ping^2,avr,2/3] Support 64-bit (long) double: The libgcc changes.

Message ID 5E1331B7.10409@gcc.gnu.org
State New
Headers show
Series Support 64-bit (long) double. | expand

Commit Message

Georg-Johann Lay Jan. 6, 2020, 1:10 p.m. UTC
Ping #2

Georg-Johann Lay schrieb:
> Am 16.12.19 um 17:40 schrieb Georg-Johann Lay:
> 
> Patch 2/3 is the libgcc additions:
> 
> --with-libf7 selects which makefile-snips from libf7 to use.
> 
> libgcc/
>     * config.host (tmake_file) [target=avr]: Add t-libf7,
>     t-libf7-math, t-libf7-math-symbols as specified by --with-libf7=.
>     * config/avr/t-avrlibc: Don't copy libgcc.a if there are modules
>     depending on sizeof (double) or sizeof (long double).
>     * config/avr/libf7: New folder.
>
diff mbox series

Patch

Index: libgcc/config.host
===================================================================
--- libgcc/config.host	(revision 278552)
+++ libgcc/config.host	(working copy)
@@ -514,6 +514,29 @@  arm*-*-eabi* | arm*-*-symbianelf* | arm*
 avr-*-*)
 	# Make HImode functions for AVR
 	tmake_file="${cpu_type}/t-avr t-fpbit"
+	# Make some DFmode functions from libf7, part of avr-libgcc.
+	# This must be prior to adding t-avrlibc.
+	case "y${with_libf7}" in
+	    yno)
+	        # No libf7 support.
+	        ;;
+	    ylibgcc)
+		tmake_file="$tmake_file ${cpu_type}/libf7/t-libf7"
+		;;
+	    ymath)
+		tmake_file="$tmake_file ${cpu_type}/libf7/t-libf7-math"
+		tmake_file="$tmake_file ${cpu_type}/libf7/t-libf7"
+		;;
+	    ymath-symbols | yyes | y)
+		tmake_file="$tmake_file ${cpu_type}/libf7/t-libf7-math-symbols"
+		tmake_file="$tmake_file ${cpu_type}/libf7/t-libf7-math"
+		tmake_file="$tmake_file ${cpu_type}/libf7/t-libf7"
+		;;
+	    *)
+		echo "Error: --with-libf7=${with_libf7} but can only be used with: 'libgcc', 'math', 'math-symbols', 'yes', 'no'" 1>&2
+		exit 1
+		;;
+	esac
 	if test x${with_avrlibc} != xno; then
 	    tmake_file="$tmake_file ${cpu_type}/t-avrlibc"
 	fi
Index: libgcc/config/avr/t-avrlibc
===================================================================
--- libgcc/config/avr/t-avrlibc	(revision 278992)
+++ libgcc/config/avr/t-avrlibc	(working copy)
@@ -65,6 +65,12 @@  LIB2FUNCS_EXCLUDE += \
 	_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.
@@ -95,3 +101,4 @@  Makefile: t-copy-libgcc.dep
 
 endif
 endif
+endif