From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7685 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] Build process uses script to add CFI directives to x86 asm Date: Mon, 18 May 2015 11:52:58 -0400 Message-ID: <20150518155258.GV17573@brightrain.aerifal.cx> References: <1431784471-24517-1-git-send-email-alexinbeijing@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1431964394 5966 80.91.229.3 (18 May 2015 15:53:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 May 2015 15:53:14 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7697-gllmg-musl=m.gmane.org@lists.openwall.com Mon May 18 17:53:14 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YuNLt-0003BF-Ds for gllmg-musl@m.gmane.org; Mon, 18 May 2015 17:53:13 +0200 Original-Received: (qmail 32176 invoked by uid 550); 18 May 2015 15:53:11 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 32149 invoked from network); 18 May 2015 15:53:11 -0000 Content-Disposition: inline In-Reply-To: <1431784471-24517-1-git-send-email-alexinbeijing@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7685 Archived-At: On Sat, May 16, 2015 at 03:54:31PM +0200, Alex Dowad wrote: > diff --git a/configure b/configure > index 143dc92..72349a2 100755 > --- a/configure > +++ b/configure > @@ -317,6 +317,18 @@ tryflag CFLAGS_MEMOPS -fno-tree-loop-distribute-patterns > test "$debug" = yes && CFLAGS_AUTO=-g > > # > +# Preprocess asm files to add extra debugging information if debug is > +# enabled, our assembler supports the needed directives, and the > +# preprocessing script has been written for our architecture. > +# > +if (test "$debug" = yes) && > + (test -f "tools/add-cfi.awk.$ARCH") && > + (echo ".cfi_startproc\n.cfi_endproc" | $CC -x assembler -c -o /dev/null -) > +then > + ADD_CFI=yes > +fi > + I think CFLAGS should be checked for -g rather than using $debug here. I'm not really a fan of --enable-debug despite having been the one who added it, and I usually just put -g in CFLAGS. Also, minor nit: it's best to avoid () in shell scripts when not needed, since it usually leads to forking. {} can be used for grouping but it's not needed here either as far as I can tell. > +END { > + if (in_function) > + print ".cfi_endproc" > +} > \ No newline at end of file Note that you still have a missing newline at the end of the awk script. Rich