mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Wesley Wiser <wesleywiser@microsoft.com>
To: "musl@lists.openwall.com" <musl@lists.openwall.com>
Subject: [musl] [PATCH] fix: Use $srcdir in configure test for add-cfi script
Date: Thu, 21 Oct 2021 16:09:30 +0000	[thread overview]
Message-ID: <BL0PR2101MB10730CDC27981CA9D04DF969AABF9@BL0PR2101MB1073.namprd21.prod.outlook.com> (raw)

Hello,

I noticed while building musl with musl-cross-make[1] that adding --enable-debug to the MUSL_CONFIG variable did not enable CFI directives even though I was compiling for a supported platform (x86_64):

> checking whether assembler supports CFI directives... no

I believe the issue is that configure tests for "tools/add-cfi.$ARCH.awk" instead of "$srcdir/tools/add-cfi.$ARCH.awk". Changing configure as described resolves this and I've confirmed the debugging information is present in resulting binary.

> checking whether assembler supports CFI directives... yes

Below is a patch for this change. 

Regards,
Wesley Wiser

[1]: https://github.com/richfelker/musl-cross-make

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index e1aefed7..ca5cbc0b 100755
--- a/configure
+++ b/configure
@@ -409,7 +409,7 @@ test "$debug" = yes && CFLAGS_AUTO=-g
 #
 printf "checking whether we should preprocess assembly to add debugging information... "
 if fnmatch '-g*|*\ -g*' "$CFLAGS_AUTO $CFLAGS" &&
-   test -f "tools/add-cfi.$ARCH.awk" &&
+   test -f "$srcdir/tools/add-cfi.$ARCH.awk" &&
    printf ".file 1 \"srcfile.s\"\n.line 1\n.cfi_startproc\n.cfi_endproc" | $CC -g -x assembler -c -o /dev/null 2>/dev/null -
 then
   ADD_CFI=yes
--
2.30.2


             reply	other threads:[~2021-10-21 16:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21 16:09 Wesley Wiser [this message]
2022-01-07 18:02 ` [musl] " Wesley Wiser
2022-01-07 18:32   ` Rich Felker

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=BL0PR2101MB10730CDC27981CA9D04DF969AABF9@BL0PR2101MB1073.namprd21.prod.outlook.com \
    --to=wesleywiser@microsoft.com \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).