This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] fix include files to support non-GNU compilers
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: Mikulas Patocka <mpatocka at redhat dot com>, Richard Henderson <rth at twiddle dot net>, Andreas Schwab <schwab at suse dot de>, <libc-alpha at sourceware dot org>
- Date: Mon, 9 Mar 2015 15:54:22 +0000
- Subject: Re: [PATCH] fix include files to support non-GNU compilers
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LRH dot 2 dot 02 dot 1408311629460 dot 27738 at file01 dot intranet dot prod dot int dot rdu2 dot redhat dot com> <Pine dot LNX dot 4 dot 64 dot 1409011646360 dot 14636 at digraph dot polyomino dot org dot uk> <alpine dot LRH dot 2 dot 02 dot 1409011849480 dot 311 at file01 dot intranet dot prod dot int dot rdu2 dot redhat dot com> <20150307210148 dot GO12857 at vapier>
On Sat, 7 Mar 2015, Mike Frysinger wrote:
> > --- glibc.orig/math/math.h
> > +++ glibc/math/math.h
> >
> > # undef __MATHDECL_1
> > -# define __MATHDECL_2(type, function,suffix, args, alias) \
> > +# ifdef __REDIRECT_NTH
> > +# define __MATHDECL_2(type, function,suffix, args, alias) \
> > extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \
> > args, alias)
> > +# else
> > +# define __MATHDECL_2(type, function,suffix, args, alias) \
> > + struct __empty__declaration__
> > +# endif
> > # define __MATHDECL_1(type, function,suffix, args) \
> > __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix))
>
> i don't think this is correct. i think you need to bracket the whole thing by
> an ifdef __REDIRECT_NTH check. Joseph would know best here though.
Indeed - the normal approach for such conditionals is to use #define when
redirection isn't supported, but that's not possible in this case where
the function declarations themselves come from macros. So anyone with
such a compiler that doesn't support redirection, and also has long double
= double in a configuration where wider long double is the current default
but -mlong-double-64 is also a supported configuration, will have to use
libnldbl.a to get the versions of the long double functions, under their
long double names, that are built for the -mlong-double-64 ABI and just
wrap the double functions. (I'm not sure libnldbl.a is documented
anywhere, but that's my understanding of its intended use.)
--
Joseph S. Myers
joseph@codesourcery.com