[PATCH] Enable --noexecstack with -g for clang

Yunlian Jiang yunlian at google.com
Fri Nov 13 18:43:29 CET 2015


modify the configuration a little bit.

When I try to build libgcrypt with clang, the --noexecstack is not
used with CFLAGS="-g". This is a similar bug to
 https://sourceware.org/bugzilla/show_bug.cgi?id=6428

diff --git a/m4/noexecstack.m4 b/m4/noexecstack.m4
index 4aab484..ef1bafd 100644
--- a/m4/noexecstack.m4
+++ b/m4/noexecstack.m4
@@ -38,7 +38,7 @@ EOF
   if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS
                      -S -o conftest.s conftest.c >/dev/null]) \
      && grep .note.GNU-stack conftest.s >/dev/null \
-     && AC_TRY_COMMAND([${CCAS} $CCASFLAGS $CPPFLAGS -Wa,--noexecstack
+     && AC_TRY_COMMAND([${CCAS} $ASFLAGS -Wa,--noexecstack
                        -c -o conftest.o conftest.s >/dev/null])
   then
     cl_cv_as_noexecstack=yes



More information about the Gcrypt-devel mailing list