From patchwork Wed Sep 15 18:16:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 64879 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]) by ozlabs.org (Postfix) with SMTP id DCD87B6F11 for ; Thu, 16 Sep 2010 04:16:33 +1000 (EST) Received: (qmail 21677 invoked by alias); 15 Sep 2010 18:16:31 -0000 Received: (qmail 21647 invoked by uid 22791); 15 Sep 2010 18:16:27 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 15 Sep 2010 18:16:21 +0000 Received: (qmail 24223 invoked from network); 15 Sep 2010 18:16:18 -0000 Received: from unknown (HELO ?192.168.44.102?) (nathan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 15 Sep 2010 18:16:18 -0000 Message-ID: <4C910D67.3050809@codesourcery.com> Date: Wed, 15 Sep 2010 19:16:07 +0100 From: Nathan Sidwell User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.12) Gecko/20100826 Thunderbird/3.0.7 MIME-Version: 1.0 To: Jack Howarth CC: gcc-patches@gcc.gnu.org, mikestump@comcast.net Subject: Re: [PATCH] eliminate UNRESOLVED errors on attr-ifunc-1.[c,C] References: <20100914101611.GA8313@bromo.med.uc.edu> In-Reply-To: <20100914101611.GA8313@bromo.med.uc.edu> 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 On 09/14/10 11:16, Jack Howarth wrote: > Currently on targets like darwin which lack weak alias support in their > object format, the gcc.dg/attr-ifunc-1.c and g++.dg/ext/attr-ifunc-1.C produce > UNRESOLVED testsuite results... Would you like to try this patch? It correctly enables ifunc testing on my i686-pc-linux-gnu glibc 2.11 system nathan 2010-09-15 Nathan Sidwell * lib/target-supports-dg.exp (dg-require_ifunc): Remove remnants of dg-require-alias. * lib/target-supports.exp (check_ifunc_available): Check known good GLIBC version. Remove check_alias_available remnants. Index: lib/target-supports-dg.exp =================================================================== --- lib/target-supports-dg.exp (revision 164285) +++ lib/target-supports-dg.exp (working copy) @@ -94,12 +94,7 @@ # test. proc dg-require-ifunc { args } { - set ifunc_available [ check_ifunc_available ] - if { $ifunc_available == -1 } { - upvar name name - unresolved "$name" - } - if { $ifunc_available < 2 } { + if { ![ check_ifunc_available ] } { upvar dg-do-what dg-do-what set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] } Index: lib/target-supports.exp =================================================================== --- lib/target-supports.exp (revision 164285) +++ lib/target-supports.exp (working copy) @@ -372,12 +372,10 @@ # proc check_ifunc_available { } ############################### -# Determine if the target toolchain supports the alias attribute. +# Determine if the target toolchain supports the ifunc attribute. -# Returns 2 if the target supports aliases. Returns 1 if the target -# only supports weak aliased. Returns 0 if the target does not -# support aliases at all. Returns -1 if support for aliases could not -# be determined. +# Returns 1 if the target supports ifunc. Returns 0 if the target +# does not support ifunc. proc check_ifunc_available { } { global ifunc_available_saved @@ -390,26 +388,22 @@ set obj ifunc[pid].o verbose "check_ifunc_available compiling testfile $src" 2 set f [open $src "w"] - # Compile a small test program. The definition of "g" is - # necessary to keep the Solaris assembler from complaining - # about the program. - puts $f "#ifdef __cplusplus\nextern \"C\"\n#endif\n" - puts $f "void g() {} void f() __attribute__((ifunc(\"g\")));" + puts $f "#include " + puts $f "#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 11)" + puts $f "#error FOO" + puts $f "#endif" + puts $f "#ifdef __cplusplus\nextern \"C\"\n#endif" + puts $f "void g() {}" + puts $f "void f() __attribute__((ifunc(\"g\")));" close $f set lines [${tool}_target_compile $src $obj object ""] file delete $src remote_file build delete $obj if [string match "" $lines] then { - # No error messages, everything is OK. - set ifunc_available_saved 2 + set ifunc_available_saved 1 } else { - if [regexp "ifunc is not supported" $lines] { - verbose "check_ifunc_available target does not support ifunc" 2 - set ifunc_available_saved 0 - } else { - set ifunc_available_saved -1 - } + set ifunc_available_saved 0 } verbose "check_ifunc_available returning $ifunc_available_saved" 2