From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51901 invoked by alias); 2 Jan 2019 13:26:13 -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 51479 invoked by uid 89); 2 Jan 2019 13:26:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm1-f65.google.com Received: from mail-wm1-f65.google.com (HELO mail-wm1-f65.google.com) (209.85.128.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 02 Jan 2019 13:26:11 +0000 Received: by mail-wm1-f65.google.com with SMTP id f81so27563370wmd.4 for ; Wed, 02 Jan 2019 05:26:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=goc0fia7OkXHBqT6hpDz3LB8/qcwCEbEuDjAyicJw88=; b=SFpS/9SW5ZSDDGC2P7Q8A1ziTlisFPOBBBHIYK9TbRumaqursbNOJOcNdLc5hlKhGo sHiDQaugzkdPpXU/uCakVb78g+kfqkTsilN50BtpJKPwj2CshuZAdsmpopiyiQOjMWC3 ja/QsZ8GoPAUXeUOwG8Hq22ZOxXDTCkyrwdmiox0xS845zSkkkJSzd2Y83KQSPMH33Ag QSxD4hb3BMX9SClhV64HY/3oY8COa1ZpopBRWnae0Fw0ry3msP+6uCmb/sp3iw8RwRLt IWYsWMRFRQftdZwtVL1Old4nlACKDH99NCLNCm5lm/XiRAETFzQMl2moIbs5jqlvMF5H oOLw== Return-Path: Received: from euterpe-sie.home (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.googlemail.com with ESMTPSA id l14sm108802178wrp.55.2019.01.02.05.26.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Jan 2019 05:26:08 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH 4/4][libbacktrace] Add tests for unused formats From: Iain Sandoe In-Reply-To: Date: Wed, 02 Jan 2019 13:26:00 -0000 Cc: Gerald Pfeifer , Ian Lance Taylor , gcc-patches , Rainer Orth Content-Transfer-Encoding: quoted-printable Message-Id: References: <20181123205612.GA3609@delia> To: Tom de Vries X-SW-Source: 2019-01/txt/msg00045.txt.bz2 > On 2 Jan 2019, at 13:20, Rainer Orth wrote: >=20 > Gerald Pfeifer writes: >=20 >> On Fri, 23 Nov 2018, Tom de Vries wrote: >>> When building libbacktrace, we typically use elf.c, and don't build=20 >>> pecoff.c, xcoff.c or unknown.c >>>=20 >>> Add testcases that use unused format to ensure that we also build and >>> test those on a typical development setup. >>=20 >> This is a good idea! >>=20 >>> Bootstrapped and reg-tested on x86_64. >>=20 >> Unfortunately, on i586-unknown-freebsd11 I'm now seeing the likes of >>=20 >> gmake[3]: *** [Makefile:1086: xcoff_32.lo] Error 1 >> xcoff_64.c:54:29: error: extra tokens at end of #undef directive [-Werr= or] >> 54 | #undef BACKTRACE_XCOFF_SIZEn#define BACKTRACE_XCOFF_SIZE 64 >> | ^ >> xcoff_64.c:54:29: warning: extra tokens at end of #undef directive >> 54 | #undef BACKTRACE_XCOFF_SIZEn#define BACKTRACE_XCOFF_SIZE 64 >> | ^ >> cc1: all warnings being treated as errors >> gmake[3]: *** [Makefile:1086: xcoff_64.lo] Error 1 >>=20 >> The reason is that GNU sed supports \n in the replacement pattern >>=20 >> % echo "abc" | sed -E 's:b:\n:'=20 >> a >> c >>=20 >> whereas BSD sed does not >>=20 >> % echo "abc" | sed -E 's:b:\n:'=20 >> anc >>=20 >> so the following in libbacktrace/Makefile.am doesn't work: >>=20 >> xcoff_%.c: xcoff.c >> SEARCH=3D'#error "Unknown BACKTRACE_XCOFF_SIZE"'; \ >> REPLACE=3D'#undef BACKTRACE_XCOFF_SIZE\n#define BACKTRACE_XCOFF_SIZE'; \ >> $(SED) "s/^$$SEARCH\$$/$$REPLACE $*/" \ >> $(srcdir)/xcoff.c \ >> > $@ >>=20 >>=20 >> I believe that in addition to FreeBSD this probably also fails on >> Solaris and Darwin. >=20 > I cannot test Darwin right now, I have builds running on a number of versions, will take a look=20 - is it missing a =E2=80=9Cmacho_xx.c=E2=80=9D implementation, anyway ? > but Solaris sed is indeed affected. On > Solaris 10 where there's only /usr/bin/sed (and /usr/xpg4/bin/sed which > has the same issue), the failure does occur. On Solaris 11 where I have > GNU sed earlier in PATH, the issue is hidden. >=20 > Your patch does indeed fix the problem with Solaris 10 /bin/sed. >=20 > Unfortunately, libbacktrace is one of those libraries that don't produce > Dejagnu-style .sum and .log files, so test failures are buried in the > make check output and very easily overlooked. >=20 > Rainer >=20 > --=20 > -------------------------------------------------------------------------= ---- > Rainer Orth, Center for Biotechnology, Bielefeld University