This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix powerpc ifunc-sel.h build for -Os
- From: "Tulio Magno Quites Machado Filho" <tuliom at linux dot vnet dot ibm dot com>
- To: Joseph Myers <joseph at codesourcery dot com>, libc-alpha at sourceware dot org
- Cc:
- Date: Fri, 02 Mar 2018 19:20:59 -0300
- Subject: Re: Fix powerpc ifunc-sel.h build for -Os
- Authentication-results: sourceware.org; auth=none
- References: <alpine.DEB.2.20.1802271756170.14335@digraph.polyomino.org.uk>
Joseph Myers <joseph@codesourcery.com> writes:
> Compiling the testsuite for powerpc (multi-arch configurations) with
> -Os with GCC 7 fails with:
>
> In file included from ifuncmod1.c:7:0,
> from ifuncdep1.c:3:
> ../sysdeps/powerpc/ifunc-sel.h: In function 'ifunc_sel':
> ../sysdeps/powerpc/ifunc-sel.h:12:3: error: asm operand 2 probably doesn't match constraints [-Werror]
> __asm__ ("mflr 12\n\t"
> ^~~~~~~
> ../sysdeps/powerpc/ifunc-sel.h:12:3: error: asm operand 3 probably doesn't match constraints [-Werror]
> ../sysdeps/powerpc/ifunc-sel.h:12:3: error: asm operand 4 probably doesn't match constraints [-Werror]
> ../sysdeps/powerpc/ifunc-sel.h:12:3: error: impossible constraint in 'asm'
>
> The "i" constraints on function pointers require the function call to
> be inlined so the compiler can see the constant function pointer
> arguments passed to the asm. This patch marks the relevant functions
> as always_inline accordingly.
>
> Tested that this fixes the -Os testsuite build for
> powerpc-linux-gnu-power4, powerpc64-linux-gnu, powerpc64le-linux-gnu
> with build-many-glibcs.py.
I can complete a build after this patch using GCC 7, but there are some
math tests failing on powerpc64le:
FAIL: math/test-float128-catan
FAIL: math/test-float64x-catan
FAIL: math/test-ifloat128-catan
FAIL: math/test-ifloat64x-catan
FAIL: math/test-ildouble-sin
FAIL: math/test-ldouble-finite-sin
FAIL: math/test-ldouble-sin
FAIL: math/test-tgmath
For the record: I tried with GCC 8 rev. 257983 too, but it seems to ignore the
diagnostic pragma.
Anyway, the patch looks good to me.
Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
--
Tulio Magno