diff options
author | Bernd Kuhls <bernd.kuhls@t-online.de> | 2018-07-29 20:55:23 +0200 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2018-08-21 10:59:35 +0800 |
commit | d805098c739a9dfffacb2591ad8906b70376216e (patch) | |
tree | 57039f8b78510b27092911feffb00d15037babf5 /configure.ac | |
parent | edafd706539433796a4e4478dd16ec979aa0239c (diff) | |
download | libva-intel-driver-d805098c739a9dfffacb2591ad8906b70376216e.tar.gz |
Check for -fstack-protector
Not all toolchains provide support for -fstack-protector. This patch
provides a configure check to avoid build errors like
/home/buildroot/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-uclibc/6.4.0/../../../../x86_64-buildroot-linux-uclibc/bin/ld: cannot find -lssp_nonshared
/home/buildroot/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-uclibc/6.4.0/../../../../x86_64-buildroot-linux-uclibc/bin/ld: cannot find -lssp
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index c76060c7..5471aee7 100644 --- a/configure.ac +++ b/configure.ac @@ -86,6 +86,23 @@ AC_SEARCH_LIBS([dlopen], [dl], [], [ AC_MSG_ERROR([unable to find the dlopen() function]) ]) + +# Check for -fstack-protector +ssp_cc=yes +if test "X$CC-cc" != "X"; then + AC_MSG_CHECKING([whether ${CC-cc} accepts -fstack-protector]) + ssp_old_cflags="$CFLAGS" + CFLAGS="$CFLAGS -fstack-protector" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[alloca(100);]])], [], [ssp_cc=no]) + AC_MSG_RESULT([$ssp_cc]) + if test "X$ssp_cc" = "Xno"; then + CFLAGS="$ssp_old_cflags" + else + AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.]) + fi +fi +AM_CONDITIONAL(USE_SSP, test "$ssp_cc" = "yes") + dnl Check for recent enough DRM LIBDRM_VERSION=libdrm_version PKG_CHECK_MODULES([DRM], [libdrm >= $LIBDRM_VERSION libdrm_intel]) |