Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150518155258.GV17573@brightrain.aerifal.cx>
Date: Mon, 18 May 2015 11:52:58 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] Build process uses script to add CFI directives
 to x86 asm

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.