From patchwork Tue Mar 26 15:14:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Ivchenko X-Patchwork-Id: 231255 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 9F69B2C007A for ; Wed, 27 Mar 2013 02:19:29 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:content-type; q=dns; s=default; b=X6AOLy5gZn/uNQMvhO9xr hYRTPmkIht+jQu9CJwWaHBXsvf2UN9s43Ft+aaqN4Dl2q6aos9rYrxM/b0k97wLO gztE0suu3YuywZSWHFCtOflVu77lFjXfXapKnn/qHixgUw6SWUi8cMXtj5ITq4rM AdrSgh6GF8VBd79y93b63c= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:content-type; s=default; bh=N7hG8MfZVb33TroigEkhz61o1yE =; b=vlMbU26VWY72Pb6VNj8ZtOWFS9z3MZ39REx7UBQv+w9FGKjB4yrU+lWN6Ln iE0DJ9ajVmSOUuSwecl5pAN/LtHspOepo5+kaHbIwNSt/DE7X2npR6vQWRiuHzfj 7Bp6GBWhvCr3xBtEAS8fiKt/y/V3y/yyyAyKf39Lr0bCpprY= Received: (qmail 30060 invoked by alias); 26 Mar 2013 15:15:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 29850 invoked by uid 89); 26 Mar 2013 15:14:59 -0000 X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from mail-pd0-f179.google.com (HELO mail-pd0-f179.google.com) (209.85.192.179) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 26 Mar 2013 15:14:55 +0000 Received: by mail-pd0-f179.google.com with SMTP id x11so170662pdj.10 for ; Tue, 26 Mar 2013 08:14:51 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.66.157.195 with SMTP id wo3mr24428533pab.79.1364310891287; Tue, 26 Mar 2013 08:14:51 -0700 (PDT) Received: by 10.68.229.137 with HTTP; Tue, 26 Mar 2013 08:14:50 -0700 (PDT) In-Reply-To: <3818B8BE-E9E4-42A9-A23E-D0B70118978E@gmail.com> References: <28659BFC-706C-4478-BAFA-142383271369@codesourcery.com> <96A7A77D-8593-447D-97CC-BD0D56CD8AE9@gmail.com> <3818B8BE-E9E4-42A9-A23E-D0B70118978E@gmail.com> Date: Tue, 26 Mar 2013 19:14:50 +0400 Message-ID: Subject: Re: [RFC PATCH] Implementing ifunc target hook From: Alexander Ivchenko To: Maxim Kuvyrkov , GCC Patches X-Virus-Found: No Hi, Since almost three months have passed I feel that I need to recheck the patch before commiting it. I fixed what Maxim mentioned and also I fixed: the support of IFUNC and the build of compiler could be broken. Now we define HAVE_GNU_INDIRECT_FUNCTION as 0 in those cases. ok for trunk? thanks, Alexander 2013/1/15 Maxim Kuvyrkov : > On 15/01/2013, at 4:55 AM, Alexander Ivchenko wrote: > >> thank you very much for your review! >> >> I fixed the arm build and all other issues that you raised. >> >> the patch is attached. Bootstrap and tested on x86-64 linux > > > The patch is OK with the cleanups mentioned below (no need to resubmit for review). Unfortunately, you will have to wait for Stage 1 to commit your patch. > > >> --- a/gcc/config.gcc >> +++ b/gcc/config.gcc >> @@ -636,6 +636,11 @@ case ${target} in >> native_system_header_dir=/include >> ;; >> esac >> + case $target in >> + *linux*) >> + tm_p_file="${tm_p_file} linux-protos.h" >> + ;; >> + esac >> # glibc / uclibc / bionic switch. >> # uclibc and bionic aren't usable for GNU/Hurd and neither for GNU/k*BSD. >> case $target in > > Can we merge this above hunk into subsequent "case $target" statement ... > >> @@ -661,8 +666,10 @@ case ${target} in >> # Add Android userspace support to Linux targets. >> case $target in >> *linux*) >> + tmake_file="${tmake_file} t-linux-android" >> tm_file="$tm_file linux-android.h" >> extra_options="$extra_options linux-android.opt" >> + extra_objs="$extra_objs linux-android.o" >> ;; >> esac > > ... here? > >> # Enable compilation for Android by default for *android* targets. >> @@ -863,7 +870,9 @@ arm*-*-netbsdelf*) >> tmake_file="${tmake_file} arm/t-arm" >> ;; >> arm*-*-linux-*) # ARM GNU/Linux with ELF >> + tmake_file="${tmake_file} t-linux-android" > > Merge this with tmake_file= setting a couple of lines down. Put t-linux-android last on the line. > >> tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" >> + extra_objs="$extra_objs linux-android.o" > > Please push extra_objs= setting a couple of lines down so that addition of t-linux-android and linux-android.o are side-by-side. > >> case $target in >> arm*b-*-linux*) >> tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" >> diff --git a/gcc/config/linux-android.c b/gcc/config/linux-android.c >> new file mode 100644 >> index 0000000..f3d82a5 >> --- /dev/null >> +++ b/gcc/config/linux-android.c >> @@ -0,0 +1,34 @@ >> +/* Functions for Linux Android as target machine for GNU C compiler. >> + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2010, 2011, >> + 2012, 2013. > > Should be "Copyright (C) 2013." The copyright dates start with the year in which a file was added. > > Also, for any file that your changes touch please add 2013 to the list of copyright years. This is an annoying chore that committers have to do at the beginning of each year. > >> diff --git a/gcc/config/linux-protos.h b/gcc/config/linux-protos.h >> new file mode 100644 >> index 0000000..aae1d28 >> --- /dev/null >> +++ b/gcc/config/linux-protos.h >> @@ -0,0 +1,22 @@ >> +/* Prototypes. >> + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2010, 2011, >> + 2012, 2013 > > "Copyright (C) 2013." > >> --- /dev/null >> +++ b/gcc/config/t-linux-android >> @@ -0,0 +1,23 @@ >> +# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 > > "Copyright (C) 2013." > > Thanks! > > -- > Maxim Kuvyrkov > diff --git a/gcc/configure b/gcc/configure old mode 100755 new mode 100644 index eac96cd..928693a --- a/gcc/configure +++ b/gcc/configure @@ -22055,11 +22055,14 @@ else enable_gnu_indirect_function="$default_gnu_indirect_function" fi -if test x$enable_gnu_indirect_function = xyes; then -$as_echo "#define HAVE_GNU_INDIRECT_FUNCTION 1" >>confdefs.h +gif=`if test $enable_gnu_indirect_function == yes; then echo 1; else echo 0; fi` + +cat >>confdefs.h <<_ACEOF +#define HAVE_GNU_INDIRECT_FUNCTION $gif +_ACEOF + -fi if test $in_tree_ld != yes ; then ld_ver=`$gcc_cv_ld --version 2>/dev/null | sed 1q` diff --git a/gcc/configure.ac b/gcc/configure.ac index 40a1af7..51d334c 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -2299,10 +2299,11 @@ AC_ARG_ENABLE(gnu-indirect-function, Valid choices are 'yes' and 'no'.]) ;; esac], [enable_gnu_indirect_function="$default_gnu_indirect_function"]) -if test x$enable_gnu_indirect_function = xyes; then - AC_DEFINE(HAVE_GNU_INDIRECT_FUNCTION, 1, - [Define if your system supports gnu indirect functions.]) -fi + +gif=`if test $enable_gnu_indirect_function == yes; then echo 1; else echo 0; fi` +AC_DEFINE_UNQUOTED(HAVE_GNU_INDIRECT_FUNCTION, $gif, +[Define if your system supports gnu indirect functions.]) + HAVE_GNU_INDIRECT_FUNCTION was not defined on targets that don't have