Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,22 @@ if test "$ac_cv_have_gnuc_visibility_attribute" = "yes"; then
[Defined to 1 if GCC visibility attribute is supported])
fi

# 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")

# Check for DRM (mandatory)
LIBDRM_VERSION=libdrm_version
PKG_CHECK_MODULES([DRM], [libdrm >= $LIBDRM_VERSION])
Expand Down
5 changes: 4 additions & 1 deletion va/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ libva_ldflags = \

libva_cflags = \
-Wall \
-fstack-protector \
$(NULL)

if USE_SSP
libva_cflags += -fstack-protector
endif

lib_LTLIBRARIES = libva.la
libvaincludedir = ${includedir}/va
libvainclude_HEADERS = $(libva_source_h)
Expand Down