This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] nldbl-compat.c: Include math.h before nldbl-compat.h.
- From: Zack Weinberg <zackw at panix dot com>
- To: libc-alpha at sourceware dot org
- Cc: law at redhat dot com, joseph at codesourcery dot com
- Date: Sun, 11 Mar 2018 14:25:23 -0400
- Subject: [PATCH] nldbl-compat.c: Include math.h before nldbl-compat.h.
- Authentication-results: sourceware.org; auth=none
Jeff Law noticed that native PowerPC builds were broken by my having
made math_ldbl_opt.h not include math.h. nldbl-compat.c formerly got
math.h via libioP.h and math_ldbl_opt.h, *without* __NO_LONG_DOUBLE_MATH;
after my change it got it via nldbl-compat.h *with* __NO_LONG_DOUBLE_MATH,
but __NO_LONG_DOUBLE_MATH mode is forbidden on hosts that define
__HAVE_DISTINCT_FLOAT128, so the build breaks. I don't know why this
didn't come up in a build-many-glibcs cycle.
I pushed this as a quick fix, but there's a deeper problem: presumably
nldbl-compat.h defines __NO_LONG_DOUBLE_MATH for a reason, but if we
can't use __NO_LONG_DOUBLE_MATH on any architecture that supports
_Float128, then nldbl-compat.h needs to find some other way to achieve
its goal. Or maybe it's vestigial and we could just stop doing it?
Do we still need __NO_LONG_DOUBLE_MATH at all? I leave these questions
to people more versed in the intricacies of long double.
* sysdeps/ieee754/ldbl-opt/nldbl-compat.c: Include math.h
before nldbl-compat.h.
---
sysdeps/ieee754/ldbl-opt/nldbl-compat.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
index bf54090d4f..ffb5fabebe 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
@@ -20,6 +20,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <libioP.h>
+#include <math.h>
#include <wchar.h>
#include <printf.h>
#include <monetary.h>
--
2.16.2