From f72d7f7c2cac61612a70d22e03cb95ed47f3a4d4 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Thu, 22 Oct 2020 02:32:04 -0300 Subject: [PATCH] aarch64-* and ppc*-linux-gnu long long float/long double mismatch Some platforms have failed to build because long long float is mapped to double rather than long double, and then the attempts to import intrinsics for long double in Aux_Long_Long_Float raise warnings turned into errors. This patch is a work around for the mismatch, arranging for Aux_Long_Long_Float to map to Aux_Long_Float. for gcc/ada/ChangeLog * Makefile.rtl (LIBGNAT_TARGET_PAIRS): Use a-nallfl__wraplf.ads on aarch64-* and ppc*-linux-gnu targets. * libgnat/a-nallfl__wraplf.ads: New. --- gcc/ada/Makefile.rtl | 6 ++ gcc/ada/libgnat/a-nallfl__wraplf.ads | 87 ++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 gcc/ada/libgnat/a-nallfl__wraplf.ads diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl index 898eb5d7d76..87ee3e94192 100644 --- a/gcc/ada/Makefile.rtl +++ b/gcc/ada/Makefile.rtl @@ -1402,6 +1402,7 @@ ifeq ($(strip $(filter-out aarch64 arm% coff wrs vx%,$(target_cpu) $(target_vend VX=vxworks7 EH_MECHANISM=-gcc SIGTRAMP_OBJ=sigtramp-vxworks.o + LIBGNAT_TARGET_PAIRS += a-nallfl.ads. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This package provides the basic computational interface for the +-- generic elementary functions. The functions in this unit are +-- wrappers for those in the Long Float package. + +with Ada.Numerics.Aux_Long_Float; + +package Ada.Numerics.Aux_Long_Long_Float is + pragma Pure; + + subtype T is Long_Long_Float; + package Aux renames Ada.Numerics.Aux_Long_Float; + subtype W is Aux.T; + + -- Use the Aux implementation. + + function Sin (X : T) return T + is (T (Aux.Sin (W (X)))); + + function Cos (X : T) return T + is (T (Aux.Cos (W (X)))); + + function Tan (X : T) return T + is (T (Aux.Tan (W (X)))); + + function Exp (X : T) return T + is (T (Aux.Exp (W (X)))); + + function Sqrt (X : T) return T + is (T (Aux.Sqrt (W (X)))); + + function Log (X : T) return T + is (T (Aux.Log (W (X)))); + + function Acos (X : T) return T + is (T (Aux.Acos (W (X)))); + + function Asin (X : T) return T + is (T (Aux.Asin (W (X)))); + + function Atan (X : T) return T + is (T (Aux.Atan (W (X)))); + + function Sinh (X : T) return T + is (T (Aux.Sinh (W (X)))); + + function Cosh (X : T) return T + is (T (Aux.Cosh (W (X)))); + + function Tanh (X : T) return T + is (T (Aux.Tanh (W (X)))); + + function Pow (X, Y : T) return T + is (T (Aux.Pow (W (X), W (Y)))); + +end Ada.Numerics.Aux_Long_Long_Float; -- 2.30.2