diff --git a/configure.ac b/configure.ac index a0e059e..b0521e5 100644 --- a/configure.ac +++ b/configure.ac @@ -79,6 +79,22 @@ AS_IF([test "x$intel_cet_enabled" = "xyes"], [ AC_DEFINE(INTEL_CET_ENABLED, [1], [Intel CET enabled.]) ]) +# check if LD -z options are supported +LDFLAGS="\ +-Wl,-z,noexecstack \ +-Wl,-z,relro \ +-Wl,-z,now \ +" +AC_MSG_CHECKING([if $LD supports $LDFLAGS]) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ +int main(int argc, char **argv) +{ + return 0; +}]])], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + LDFLAGS=""] +) # Pick an assembler yasm or nasm if test x"$AS" = x""; then @@ -290,13 +306,6 @@ my_CFLAGS="\ " AC_SUBST([my_CFLAGS]) -AM_LDFLAGS="\ --Wl,-z,noexecstack \ --Wl,-z,relro \ --Wl,-z,now \ -" -AC_SUBST([AM_LDFLAGS]) - AC_CONFIG_FILES([\ Makefile\ libisal.pc