summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-09-13 12:42:12 +0200
committerLucas De Marchi <lucas.demarchi@intel.com>2015-02-24 22:41:30 -0300
commit779729cf535549bfd687227da2385b607cc31a61 (patch)
treeb6cc239e2e8bfeeb3edca5af0394fff6d39ec546
parentc619d8920852c39ea4ec8564b8ba83f1c10898f2 (diff)
downloadkmod-779729cf535549bfd687227da2385b607cc31a61.tar.gz
from systemd: build: check for build/link flags harder
Use AC_LINK_IFELSE instead of AC_COMPILE_IFELSE to test for flags that might succeed during compilation but not during linking. An example is gcc compiled with libssp support but gnu-ld without it. In this case -fstack-protector works fine during compilation but fails during linking as several internal helpers are missing.
-rw-r--r--m4/attributes.m46
1 files changed, 3 insertions, 3 deletions
diff --git a/m4/attributes.m4 b/m4/attributes.m4
index 104f04c..fad1c8f 100644
--- a/m4/attributes.m4
+++ b/m4/attributes.m4
@@ -42,9 +42,9 @@ AC_DEFUN([CC_CHECK_FLAG_APPEND], [
AS_TR_SH([cc_cv_$2_$3]),
[eval "AS_TR_SH([cc_save_$2])='${$2}'"
eval "AS_TR_SH([$2])='-Werror $3'"
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([int a = 0; int main(void) { return a; } ])],
- [eval "AS_TR_SH([cc_cv_$2_$3])='yes'"],
- [eval "AS_TR_SH([cc_cv_$2_$3])='no'"])
+ AC_LINK_IFELSE([AC_LANG_SOURCE([int a = 0; int main(void) { return a; } ])],
+ [eval "AS_TR_SH([cc_cv_$2_$3])='yes'"],
+ [eval "AS_TR_SH([cc_cv_$2_$3])='no'"])
eval "AS_TR_SH([$2])='$cc_save_$2'"])
AS_IF([eval test x$]AS_TR_SH([cc_cv_$2_$3])[ = xyes],