From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 330 invoked by alias); 12 Nov 2014 10:02:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 317 invoked by uid 89); 12 Nov 2014 10:02:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vc0-f169.google.com Received: from mail-vc0-f169.google.com (HELO mail-vc0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 12 Nov 2014 10:02:32 +0000 Received: by mail-vc0-f169.google.com with SMTP id hy4so5240613vcb.14 for ; Wed, 12 Nov 2014 02:02:30 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.52.145.36 with SMTP id sr4mr12042963vdb.39.1415786550142; Wed, 12 Nov 2014 02:02:30 -0800 (PST) Received: by 10.31.55.3 with HTTP; Wed, 12 Nov 2014 02:02:30 -0800 (PST) Date: Wed, 12 Nov 2014 10:03:00 -0000 Message-ID: Subject: [Android] Enable ifuncs on Android From: Alexander Ivchenko To: GCC Patches Cc: enh , Andrew Hsieh Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-11/txt/msg01152.txt.bz2 Hi, Bionic - Android libc - supports indirect functions right now, but they are disabled in gcc; We cannot do the configure-time check for that, because there is only one version of each compiler shipped in ndk for all Android platforms. On the other hand, having different runtime targets like -mandroid-19, -mandroid-20 would be a nightmare. But, keeping in mind that the last version of Android is a priority, I think that enabling ifuncs unconditionally would be the right thing. Is the patch ok? Bootstrapped/regtested on x86_64-unknown-linux-gnu + checked that the behavior of i686-linux-android is correct. diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eac19cf..9932323 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-11-11 Alexander Ivchenko + + * config/linux.c (linux_has_ifunc_p): Remove. + * config/linux.h (TARGET_HAS_IFUNC_P): Use the default version. + 2014-11-11 Uros Bizjak * sreal.c (sreal::to_int): Use INTTYPE_MAXIMUM (int64_t) diff --git a/gcc/config/linux.c b/gcc/config/linux.c index 6242e11..15df213 100644 --- a/gcc/config/linux.c +++ b/gcc/config/linux.c @@ -23,14 +23,6 @@ along with GCC; see the file COPYING3. If not see #include "tm.h" #include "linux-protos.h" -/* Android does not support GNU indirect functions. */ - -bool -linux_has_ifunc_p (void) -{ - return OPTION_BIONIC ? false : HAVE_GNU_INDIRECT_FUNCTION; -} - bool linux_libc_has_function (enum function_class fn_class) { diff --git a/gcc/config/linux.h b/gcc/config/linux.h index d38ef81..6ccacff 100644 --- a/gcc/config/linux.h +++ b/gcc/config/linux.h @@ -117,10 +117,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #else /* !uClinux, i.e., normal Linux */ -/* IFUNCs are supported by glibc, but not by uClibc or Bionic. */ -# undef TARGET_HAS_IFUNC_P -# define TARGET_HAS_IFUNC_P linux_has_ifunc_p - /* Determine what functions are present at the runtime; this includes full c99 runtime and sincos. */ # undef TARGET_LIBC_HAS_FUNCTION --Alexander