mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] [PATCH] fix: Use $srcdir in configure test for add-cfi script
@ 2021-10-21 16:09 Wesley Wiser
  0 siblings, 0 replies; only message in thread
From: Wesley Wiser @ 2021-10-21 16:09 UTC (permalink / raw)
  To: musl


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. 

Wesley Wiser


 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 -

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-21 16:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21 16:09 [musl] [PATCH] fix: Use $srcdir in configure test for add-cfi script Wesley Wiser

Code repositories for project(s) associated with this inbox:

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).