On 12/06/17 16:02, Steve Ellcey wrote:
> I recently noticed that the GCC 'resolver' attribute used for ifunc's is not
> on by default for aarch64 even though all the infrastructure to support it is
> in place.  I made memcpy an ifunc on aarch64 in glibc and am looking at
> possibly using it for libatomic too.  For this reason I would like to enable
> it by default.  Note that the memcpy ifunc works even when this is not enabled
> because glibc enables ifuncs by using the assembly language .type psuedo-op to
> set the resolver attribute when GCC cannot do it with an attribute.  Using
> an ifunc in libatomic does require this to be enabled and I do not see any
> reason not to have it enabled by default.
> 
> Tested with no regressions, OK to check in?
> 

this is not the right default for bionic, uclibc and musl

(gcc does not distinguish between supporting ifunc in the
compiler vs runtime, so when ifunc is enabled it is assumed
the c runtime will have support too, hence libatomic and
libgcc starts using ifuncs which breaks at runtime)

so don't change the default if target matches
*-*-*android*|*-*-*uclibc*|*-*-*musl*)

(i think the default should be kept "no" for these targets
independently of cpu arch, so the current logic that is
repeated many places in config.gcc is suboptimal.

and i think the attribute syntax should be always supported
and this setting should only mean that ifunc use is allowed
in the runtime libraries.)

Reply via email to