+2017-11-17 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
+
+ * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
+ * aclocal.m4: Regenerate.
+ * Makefile.in: Likewise.
+ * configure: Likewise.
+
2017-10-06 Ian Lance Taylor <iant@golang.org>
* ztest.c (test_large): Pass unsigned long *, not size_t *, to
$(am__configure_deps) $(srcdir)/config.h.in \
$(srcdir)/../mkinstalldirs $(srcdir)/backtrace-supported.h.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../config/lead-dot.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/../config/cet.m4 \
+ $(top_srcdir)/../config/enable.m4 \
+ $(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/multi.m4 \
$(top_srcdir)/../config/override.m4 \
$(top_srcdir)/../config/stdint.m4 \
with_gnu_ld
enable_libtool_lock
enable_largefile
+enable_cet
with_system_libunwind
enable_host_shared
'
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
--disable-largefile omit support for large files
+ --enable-cet enable Intel CET in target libraries
+ [default=default]
--enable-host-shared build host code as shared libraries
Optional Packages:
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11149 "configure"
+#line 11152 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11255 "configure"
+#line 11258 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
fi
fi
+if test -n "${with_target_subdir}"; then
+ # Add CET specific flags is Intel CET is enabled.
+ # Check whether --enable-cet was given.
+if test "${enable_cet+set}" = set; then :
+ enableval=$enable_cet;
+ case "$enableval" in
+ yes|no|default) ;;
+ *) as_fn_error "Unknown argument to enable/disable cet" "$LINENO" 5 ;;
+ esac
+
+else
+ enable_cet=default
+fi
+
+
+case "$host" in
+ i[34567]86-*-linux* | x86_64-*-linux*)
+ case "$enable_cet" in
+ default)
+ # Check if assembler supports CET.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+asm ("setssbsy");
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ enable_cet=yes
+else
+ enable_cet=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+ yes)
+ # Check if assembler supports CET.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+asm ("setssbsy");
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ as_fn_error "assembler with CET support is required for --enable-cet" "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+ esac
+ ;;
+ *)
+ enable_cet=no
+ ;;
+esac
+if test x$enable_cet = xyes; then
+ CET_FLAGS="-fcf-protection -mcet"
+fi
+
+ EXTRA_FLAGS="$EXTRA_FLAGS $CET_FLAGS"
+fi
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
EXTRA_FLAGS="$EXTRA_FLAGS -frandom-seed=\$@"
fi
fi
+
+if test -n "${with_target_subdir}"; then
+ # Add CET specific flags is Intel CET is enabled.
+ GCC_CET_FLAGS(CET_FLAGS)
+ EXTRA_FLAGS="$EXTRA_FLAGS $CET_FLAGS"
+fi
AC_SUBST(EXTRA_FLAGS)
ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \