* Michael Meissner via Gcc-patches:

> On Wed, Feb 24, 2021 at 11:12:54PM +0000, Joseph Myers wrote:
>> This change appears to have broken builds for powerpc in a configuration 
>> that bootstraps a cross toolchain starting with a GCC build with no libc 
>> available.
>> 
>> Specifically, such a bootstrap build uses --disable-decimal-float among 
>> other options (in the first GCC build before libc has been built), to 
>> disable GCC target library code that has any dependence on libc or libc 
>> headers - dfp-bit.c uses libc headers, without an inhibit_libc 
>> conditional, so cannot be used in such a bootstrap configuration.  Most of 
>> the DFP code in libgcc is disabled by --disable-decimal-float, but it 
>> seems the new conversions are not.  This results in errors of the form:
>> 
>> In file included from 
>> /scratch/jmyers/glibc-bot/src/gcc/libgcc/config/rs6000/_kf_to_sd.c:37:
>> /scratch/jmyers/glibc-bot/src/gcc/libgcc/dfp-bit.c:32:10: fatal error: 
>> stdio.h: No such file or directory
>>    32 | #include <stdio.h>
>>       |          ^~~~~~~~~
>> compilation terminated.
>> 
>> The appropriate fix is not to build any of these new conversions in the 
>> --disable-decimal-float case.  (That clearly makes sense anyway, even in 
>> the absence of the bootstrap issue.)
>> 
>> https://sourceware.org/pipermail/libc-testresults/2021q1/007576.html
>
> Thanks.  I agree if --disable-decimal-float is used we should not build the
> conversions.  And we want to eliminate the stdio.h dependency.  I will look at
> it unless somebody has already fixed it.

This issue is still present.

What about the patch below?

Thanks,
Florian

rs6000: Do not build _Float128/Decimal routines with --disable-decimal-float

Fixes commit 781183595acba67a37c66f59a0c1d9b5fee7e248 ("Add conversions
between _Float128 and Decimal.).

libgcc/
        * config/rs6000/t-float128 (fp128_ppc_funcs): Add decimal floating
        point functions for $(decimal_float) only.

diff --git a/libgcc/config/rs6000/t-float128 b/libgcc/config/rs6000/t-float128
index 6fb1a3d871b..b1f00accdf1 100644
--- a/libgcc/config/rs6000/t-float128
+++ b/libgcc/config/rs6000/t-float128
@@ -37,8 +37,11 @@ ibm128_dec_funcs     = _tf_to_sd _tf_to_dd _tf_to_td \
 # New functions for software emulation
 fp128_ppc_funcs                = floattikf floatuntikf fixkfti fixunskfti \
                          extendkftf2-sw trunctfkf2-sw \
-                         sfp-exceptions _mulkc3 _divkc3 _powikf2 \
-                         $(fp128_dec_funcs) $(fp128_decstr_funcs)
+                         sfp-exceptions _mulkc3 _divkc3 _powikf2
+
+ifeq ($(decimal_float),yes)
+fp128_ppc_funcs        += $(fp128_dec_funcs) $(fp128_decstr_funcs)
+endif
 
 fp128_ppc_src          = $(addprefix $(srcdir)/config/rs6000/,$(addsuffix \
                                .c,$(fp128_ppc_funcs)))

Reply via email to