• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/common/libva


Commit MetaInfo

Révisioneefae9c0a7c80a368091577918080c553bb104e0 (tree)
l'heure2018-07-30 09:37:50
AuteurBernd Kuhls <bernd.kuhls@t-on...>
CommiterXiang, Haihao

Message de Log

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

Change Summary

Modification

--- a/configure.ac
+++ b/configure.ac
@@ -209,6 +209,22 @@ if test "$ac_cv_have_gnuc_visibility_attribute" = "yes"; then
209209 [Defined to 1 if GCC visibility attribute is supported])
210210 fi
211211
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+
212228 # Check for DRM (mandatory)
213229 LIBDRM_VERSION=libdrm_version
214230 PKG_CHECK_MODULES([DRM], [libdrm >= $LIBDRM_VERSION])
--- a/va/Makefile.am
+++ b/va/Makefile.am
@@ -77,9 +77,12 @@ libva_ldflags = \
7777
7878 libva_cflags = \
7979 -Wall \
80- -fstack-protector \
8180 $(NULL)
8281
82+if USE_SSP
83+libva_cflags += -fstack-protector
84+endif
85+
8386 lib_LTLIBRARIES = libva.la
8487 libvaincludedir = ${includedir}/va
8588 libvainclude_HEADERS = $(libva_source_h)