This patch changes the default on 64-bit PowerPC Linux systems for the
--enable-gnu-indirect-function configuration option (i.e. support for the ifunc
attribute) to mirror the x86_64/i386/s390x systems that assume the use of
glibcs that support it.

Since some of the embedded hosts use powerpc-*-linux<whatever>, I only set the
default if the target is a 64-bit PowerPC system.  I tested the compiler
manually to verify that ifunc support was enabled, and it was.  I did a
boostrap build/check cycle on a little endian power8 system and there were
regressions.  Can I install the patch on the trunk?

Note, the documentation for the --enable-gnu-indirect-option does not list
which systems current enable the option, so I did not modify the
documentation.

2016-11-23  Michael Meissner  <meiss...@linux.vnet.ibm.com>

        * config.gcc (powerpc*-*-linux*): Set gnu-indirect-function by
        default on Power server linux systems.

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.vnet.ibm.com, phone: +1 (978) 899-4797
Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc      (revision 242797)
+++ gcc/config.gcc      (working copy)
@@ -2443,6 +2443,15 @@ powerpc*-*-linux*)
        if test x${enable_secureplt} = xyes; then
                tm_file="rs6000/secureplt.h ${tm_file}"
        fi
+       # Assume modern glibc if not targeting Android nor uclibc and
+       # generating code for a Power server (64-bit) environment
+       case ${target} in
+           *-*-*android*|*-*-*uclibc*|*-*-*musl*)
+                   ;;
+           powerpc64*)
+               default_gnu_indirect_function=yes
+                   ;;
+       esac
        ;;
 powerpc-wrs-vxworks|powerpc-wrs-vxworksae|powerpc-wrs-vxworksmils)
        tm_file="${tm_file} elfos.h freebsd-spec.h rs6000/sysv4.h"

Reply via email to