[PATCH] math: Don't declare __XXX math functions [BZ #32418]

H.J. Lu hjl.tools@gmail.com
Thu Dec 5 10:36:55 GMT 2024


On Thu, Dec 5, 2024 at 6:25 PM Joseph Myers <josmyers@redhat.com> wrote:
>
> On Thu, 5 Dec 2024, H.J. Lu wrote:
>
> > Since libm doesn't export __XXX math functions, don't declare them by
> > updating __MATHDECLX to remove
> >
> > __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib)
>
> Please always give details of how a patch was tested.
>
> I'd like to understand how this patch works without breaking the build,
> given all the internal references (from one libm function to another) to
> functions under the __* names - where do they now get declared for
> internal use, if not from <math.h>?  (It's certainly true that ideally
> declarations for internal use would not be present when not building libm
> itself, or libc for the limited number of functions also present there.)
>
> Note also that this patch fails to update the comment explaining how both
> versions are declared.
>
> /* The file <bits/mathcalls.h> contains the prototypes for all the
>    actual math functions.  These macros are used for those prototypes,
>    so we can easily declare each function as both `name' and `__name',
>    and can declare the float versions `namef' and `__namef'.  */
>
> --
> Joseph S. Myers
> josmyers@redhat.com
>

It is used in glibc build for some targets:

FAIL: glibcs-powerpc-linux-gnu build
FAIL: glibcs-powerpc-linux-gnu-power4 build
FAIL: glibcs-powerpc64le-linux-gnu build
FAIL: glibcs-powerpc-linux-gnu-soft build
FAIL: glibcs-powerpc64-linux-gnu build
FAIL: glibcs-powerpc64le-linux-gnu-disable-multi-arch build
FAIL: glibcs-sparcv9-linux-gnu build
FAIL: glibcs-sparc64-linux-gnu build

But they shouldn't be declared in the installed header.

-- 
H.J.


More information about the Libc-alpha mailing list