[PATCH 1/8] Use gcc attribute ifunc in libc_ifunc macro instead of inline assembly due to false debuginfo.
Stefan Liebler
stli@linux.vnet.ibm.com
Fri Aug 5 06:46:00 GMT 2016
On 08/03/2016 05:49 PM, Joseph Myers wrote:
> On Wed, 3 Aug 2016, Florian Weimer wrote:
>
>> On 08/02/2016 04:07 PM, Stefan Liebler wrote:
>>> Okay. Then I can add an extra configure check to test the gcc attribute
>>> ifunc support. If there is no support, a fallback ifunc-macro which uses
>>> the old behaviour could be used. Then it won't break the build but the
>>> debuginfo is not correct, too. Perhaps this fallback can be removed in
>>> future. Do you know if gcc in Ubuntu 16.04 has ifunc support for ppc64le?
>>
>> I would prefer if we could bump the minimum GCC and binutils version instead.
>
> Is GCC 4.8 recent enough? (We required 4.7 for glibc 2.23, so moving to a
> requirement of 4.8 for glibc 2.25 would be reasonable on the basis of
> time-based updates to version requirements. Binutils 2.24 would be
> required on the same basis and is already required for x86_64.)
>
Requiring a specific gcc / binutils version does not work. E.g. on s390x
a gcc 4.7.4 has attribute ifunc support.
According to <gcc-src>/gcc/configure.ac there is an option
--enable-gnu-indirect-function. If it is not specified it defaults to
default_gnu_indirect_function variable. This is set to yes in
<gcc-src>/gcc/config.gcc for intel / s390. Otherwise it is no.
According to the fedora / CentOS gcc.spec file ifunc is also enabled on
e.g. power:
%ifarch %{ix86} x86_64 ppc ppc64 ppc64le ppc64p7 s390 s390x %{arm} aarch64
%global attr_ifunc 1
%else
%global attr_ifunc 0
%endif
%if 0%{?fedora} >= 21 || 0%{?rhel} >= 7
%if %{attr_ifunc}
--enable-gnu-indirect-function \
%endif
%endif
I don't know how other distros handle this ifunc feature.
There is already a configure-check for binutils support which sets
HAVE_IFUNC and the libc_ifunc-macro is only used if HAVE_IFUNC is set.
As already proposed I add a configure check to test gcc if attribute
ifunc is supported and use it in libc_ifunc macro if available. As
fallback, the old behaviour is used.
See my latest patch update.
Bye
Stefan
More information about the Libc-alpha
mailing list