From patchwork Fri Mar 10 08:07:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Neyman X-Patchwork-Id: 737321 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vffxb1gQLz9s7y for ; Fri, 10 Mar 2017 19:07:15 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="XerlVL2v"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type; q=dns; s=default; b=ImBI iIP96EKZVct8HkF0/fbgKOQP9OjtjjD2kZpJFCY/xpBCVzeUpDaZ5M7NkUTjRVuK ii/1dTffy3skAf3xv9GwiZBYCn2JQ2oE4LELHCZWFrp8oTQymNSrf4WzshUuMJe7 LhDJc1EY21oHaiclCk4I2sOSMh2NB9uDEiQop0k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type; s=default; bh=Nl72IVnlvp sXbJkU/NZkEatKmi0=; b=XerlVL2vpUiLCWR3BDe89RjQ0NKwyHg+R3k3TCUrAo 69zVJNzGNYoKbWLLJmFuzOLtBnDLOHpwJ67l+vDzQj+7GrIPekq2mOlagNORUOeU nD5KGwpnBN/9BfBzjqPm1TsQPZNpN3lmA/2u92KBX3magiG/wpkLtoQF8JQIh0Vn U= Received: (qmail 16528 invoked by alias); 10 Mar 2017 08:07:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 16497 invoked by uid 89); 10 Mar 2017 08:07:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:sk:nm10-vm, HX-HELO:sk:nm10-vm, H*RU:sk:nm10-vm X-HELO: nm10-vm2.access.bullet.mail.bf1.yahoo.com X-Yahoo-SMTP: 0h0Q7euswBD_g.kcEqbzJWRFfrba801gq1M1 Subject: Re: [PATCH v2] configure.ac: Avoid empty subexpression in grep To: Paul Eggert , libc-alpha@sourceware.org References: <8370e47b-8475-a19d-def9-2cac565eb48c@att.net> <12572e7c-59f0-7c00-640a-b84c9f488491@cs.ucla.edu> From: Alexey Neyman Message-ID: <8a9f9b71-d05b-578f-e2fc-b85bd001d56a@att.net> Date: Fri, 10 Mar 2017 00:07:03 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: On 03/10/2017 12:03 AM, Alexey Neyman wrote: > > > On 03/09/2017 01:50 PM, Paul Eggert wrote: >> On 03/09/2017 08:12 AM, Alexey Neyman wrote: >>> - if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > >>> /dev/null; then >>> + if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > >>> /dev/null; then >> >> Neither the old nor the new code is portable, as POSIX does not >> require support for '\|'. Instead, how about something like this? >> >> if $READELF -S conftest.so | grep -F -e '.rel.dyn' -e '.rela.dyn' >> > /dev/null; then > > Yes, that works too. Updated patch attached. Oops, wrong one attached to the last email. Resend with the right patch. Regards, Alexey. From ea96431563a0a9abf60f1db92a513d6130755bf1 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Wed, 8 Mar 2017 14:31:10 -0800 Subject: [PATCH v2] Fix combreloc test with BSD grep The test for "-z combreloc" fails when cross-compiling on a machine that uses BSD grep (e.g. on macos). grep complains about empty subexpression and exits with non-zero status, which is interpreted by configure as "not found". As a result, support for "-z combreloc" (HAVE_Z_COMBRELOC) is not detected, leading to link failure on SPARC. * configure.ac: Avoid empty subexpression in grep. Signed-off-by: Alexey Neyman --- ChangeLog | 5 +++++ configure | 2 +- configure.ac | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ba57667..0ed7d3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-03-08 Alexey Neyman + + * configure.ac: Avoid empty subexpression in grep. + * configure: Regenerate. + 2017-03-08 Yury Norov Zack Weinberg diff --git a/configure.ac b/configure.ac index 4a77411..6dc9bac 100644 --- a/configure.ac +++ b/configure.ac @@ -1391,7 +1391,7 @@ dnl cross-platform since the gcc used can be a cross compiler. Without dnl introducing new options this is not easily doable. Instead use a tool dnl which always is cross-platform: readelf. To detect whether -z combreloc dnl look for a section named .rel.dyn. - if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then + if $READELF -S conftest.so | grep -F -e '.rel.dyn' -e '.rela.dyn' > /dev/null; then libc_cv_z_combreloc=yes else libc_cv_z_combreloc=no -- 2.9.3