delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/07/17/14:41:15

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3F16ED96.E6D64B20@phekda.freeserve.co.uk>
Date: Thu, 17 Jul 2003 19:40:22 +0100
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: GCC 3.3 & LIBC - build process change (attempt #2)
References: <000001c34ac0$6cc19cb0$0101a8c0 AT acp42g>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Andrew Cottrell wrote:
> 
> This is the second attempt at a patch the LIBC build process to allow GCC
> 3.3 to build the CVS source (the updated source files were patched a few
> weeks ago to support GCC 3.3).

Looks good, apart from:

[snip]
> *** \djgppcvs\src\noprofpp.sed  Thu Jan  1 10:00:00 1970
> --- src\noprofpp.sed    Tue Jul 15 19:38:46 2003
> ***************
> *** 0 ****
> --- 1,22 ----
> + # Copyright (C) 2003 DJ Delorie, see COPYING.DJ for details
> + # Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details
> + #
> + # For building the profiling support code (src/libc/crt0/mcount.c),
> + # strip out profiling options, to avoid a chicken-and-egg problem
> + # in a profiling version of libc (the profiling support code calling
> + # profiling support code).
> + #
> + s:^-a$::
> + s:^-ax$::
> + s:^-finstrument-functions$::
> + s:^-fprofile-arcs$::
> + s:^-ftest-coverage$::
> + s:^-p$::
> + s:^-pg$::
> +
> + # For building the GPP support option file code strip out
> + # C options that are not allowed for C++ source
> + #
> + s:-Wbad-function-cast::g
> + s:-Wmissing-declarations::g
> +
> 
> *** \djgppcvs\src\makefile.inc  Wed Feb 26 21:04:30 2003
> --- src\makefile.inc    Tue Jul 15 20:36:06 2003
[snip]
> *************** endif
> *** 72,77 ****
> --- 76,82 ----
>   # profiling support code).
>   #
>   XNOPGGCC = $(CROSS_GCC) $(shell sed -f $(TOP)/../noprof.sed
> $(TOP)/../gcc.opt) -I. -I- -isystem $(TOP)/../../include $(CFLAGS)
> + XNOPGGPP = $(CROSS_GCC) $(shell sed -f $(TOP)/../noprofpp.sed
> $(TOP)/../gcc.opt) -I. -I- -isystem $(TOP)/../../include $(CFLAGS)
> 
>   MISC = $(TOP)/../misc.exe
> 
[snip]
> *************** $(HOSTBIN)/%.exe : %
> *** 155,160 ****
> --- 160,168 ----
>   all :: $(OBJS) $(EXTRA_OBJS) $(EXTRA_FILES)
>         $(NOP)
> 
> + $(TOP)/../gpp.opt : $(TOP)/../gcc.opt
> +       sed -f $(TOP)/../gpp_opt.sed $< > $@
> +
>   ifneq ($(MAKEFILE_LIB),1)
>   all :: makefile.oh
>   makefile.oh : makefile
> 
[snip]

I don't like the idea of including all the anti-profiling lines in yet another
file. We'll have to keep two files synchronised.

You can use sed's -f option multiple times. Below is with sed 3.0.28:

bash-2.04$ echo 's:foo::' > t.sed
bash-2.04$ echo 's:bar::' > t2.sed
bash-2.04$ echo -e "foo\nbar\nbaz" | sed -f t.sed -f t2.sed


baz

Actually, why don't you use gpp.opt in XNOPGGPP instead of gcc.opt? Then you
wouldn't need noprofpp.sed. I guess your solution allows us to cope with C &
C++ having different profiling options, but is that likely?

I'd also prefer the name gpp.sed to gpp_opt.sed, but that's really picky, so
feel free to ignore me there. ;)

Bye, Rich =]

-- 
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019