Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <BL0PR2101MB10730CDC27981CA9D04DF969AABF9@BL0PR2101MB1073.namprd21.prod.outlook.com>
Date: Thu, 21 Oct 2021 16:09:30 +0000
From: Wesley Wiser <wesleywiser@...rosoft.com>
To: "musl@...ts.openwall.com" <musl@...ts.openwall.com>
Subject: [PATCH] fix: Use $srcdir in configure test for add-cfi script

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

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.