hardware/intel/common/libva
Revision | eefae9c0a7c80a368091577918080c553bb104e0 (tree) |
---|---|
Time | 2018-07-30 09:37:50 |
Author | Bernd Kuhls <bernd.kuhls@t-on...> |
Commiter | Xiang, Haihao |
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
@@ -209,6 +209,22 @@ if test "$ac_cv_have_gnuc_visibility_attribute" = "yes"; then | ||
209 | 209 | [Defined to 1 if GCC visibility attribute is supported]) |
210 | 210 | fi |
211 | 211 | |
212 | +# Check for -fstack-protector | |
213 | +ssp_cc=yes | |
214 | +if test "X$CC-cc" != "X"; then | |
215 | + AC_MSG_CHECKING([whether ${CC-cc} accepts -fstack-protector]) | |
216 | + ssp_old_cflags="$CFLAGS" | |
217 | + CFLAGS="$CFLAGS -fstack-protector" | |
218 | + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[alloca(100);]])], [], [ssp_cc=no]) | |
219 | + AC_MSG_RESULT([$ssp_cc]) | |
220 | + if test "X$ssp_cc" = "Xno"; then | |
221 | + CFLAGS="$ssp_old_cflags" | |
222 | + else | |
223 | + AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.]) | |
224 | + fi | |
225 | +fi | |
226 | +AM_CONDITIONAL(USE_SSP, test "$ssp_cc" = "yes") | |
227 | + | |
212 | 228 | # Check for DRM (mandatory) |
213 | 229 | LIBDRM_VERSION=libdrm_version |
214 | 230 | PKG_CHECK_MODULES([DRM], [libdrm >= $LIBDRM_VERSION]) |
@@ -77,9 +77,12 @@ libva_ldflags = \ | ||
77 | 77 | |
78 | 78 | libva_cflags = \ |
79 | 79 | -Wall \ |
80 | - -fstack-protector \ | |
81 | 80 | $(NULL) |
82 | 81 | |
82 | +if USE_SSP | |
83 | +libva_cflags += -fstack-protector | |
84 | +endif | |
85 | + | |
83 | 86 | lib_LTLIBRARIES = libva.la |
84 | 87 | libvaincludedir = ${includedir}/va |
85 | 88 | libvainclude_HEADERS = $(libva_source_h) |