public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Gerald Pfeifer <gerald@pfeifer.com>
Cc: Tom de Vries <tdevries@suse.de>, Ian Lance Taylor <ian@airs.com>,
	       gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 4/4][libbacktrace] Add tests for unused formats
Date: Wed, 02 Jan 2019 13:20:00 -0000	[thread overview]
Message-ID: <yddk1jnp56a.fsf@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <alpine.LSU.2.21.1812281416240.15084@anthias.pfeifer.com> (Gerald	Pfeifer's message of "Fri, 28 Dec 2018 20:40:42 -1000 (-10)")

Gerald Pfeifer <gerald@pfeifer.com> writes:

> On Fri, 23 Nov 2018, Tom de Vries wrote:
>> When building libbacktrace, we typically use elf.c, and don't build 
>> pecoff.c, xcoff.c or unknown.c
>> 
>> Add testcases that use unused format to ensure that we also build and
>> test those on a typical development setup.
>
> This is a good idea!
>
>> Bootstrapped and reg-tested on x86_64.
>
> Unfortunately, on i586-unknown-freebsd11 I'm now seeing the likes of
>
>   gmake[3]: *** [Makefile:1086: xcoff_32.lo] Error 1
>   xcoff_64.c:54:29: error: extra tokens at end of #undef directive [-Werror]
>      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
>
> The reason is that GNU sed supports \n in the replacement pattern
>
>   % echo "abc" | sed -E 's:b:\n:' 
>   a
>   c
>
> whereas BSD sed does not
>
>   % echo "abc" | sed -E 's:b:\n:' 
>   anc
>
> so the following in libbacktrace/Makefile.am doesn't work:
>
>   xcoff_%.c: xcoff.c
>  	SEARCH='#error "Unknown BACKTRACE_XCOFF_SIZE"'; \
> 	REPLACE='#undef BACKTRACE_XCOFF_SIZE\n#define BACKTRACE_XCOFF_SIZE'; \
>  	$(SED) "s/^$$SEARCH\$$/$$REPLACE $*/" \
>  		$(srcdir)/xcoff.c \
>  		> $@
>
>
> I believe that in addition to FreeBSD this probably also fails on
> Solaris and Darwin.

I cannot test Darwin right now, 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.

Your patch does indeed fix the problem with Solaris 10 /bin/sed.

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.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

  parent reply	other threads:[~2019-01-02 13:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-23 20:56 Tom de Vries
2018-11-28 12:33 ` Tom de Vries
2018-11-29 18:28 ` Ian Lance Taylor via gcc-patches
2018-11-30  9:06   ` Tom de Vries
2018-11-30 14:46     ` Ian Lance Taylor via gcc-patches
2018-12-29 13:13 ` Gerald Pfeifer
2018-12-29 20:44   ` Gerald Pfeifer
2018-12-30  9:06   ` Tom de Vries
2018-12-30 16:07     ` Gerald Pfeifer
2019-01-02 13:20   ` Rainer Orth [this message]
2019-01-02 13:26     ` Iain Sandoe
2019-01-03 11:49       ` Iain Sandoe
2019-01-03 23:10         ` Ian Lance Taylor via gcc-patches
2019-01-07 19:30           ` Iain Sandoe
2019-01-03 12:49     ` Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yddk1jnp56a.fsf@CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gerald@pfeifer.com \
    --cc=ian@airs.com \
    --cc=tdevries@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).