+2017-11-17 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
+
+ * acinclude.m4: Add cet.m4.
+ * configure.ac: Set CET_FLAGS. Update EXTRA_CFLAGS,
+ EXTRA_CXX_FLAGS.
+ * libsupc++/Makefile.am: Use Add EXTRA_CFLAGS.
+ * Makefile.in: Regenerate.
+ * configure: Likewise.
+ * doc/Makefile.in: Likewise.
+ * include/Makefile.in: Likewise.
+ * libsupc++/Makefile.in: Likewise.
+ * po/Makefile.in: Likewise.
+ * python/Makefile.in: Likewise.
+ * src/Makefile.in: Likewise.
+ * src/c++11/Makefile.in: Likewise.
+ * src/c++98/Makefile.in: Likewise.
+ * src/filesystem/Makefile.in: Likewise.
+ * testsuite/Makefile.in: Likewise.
+
2017-11-17 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/83025
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/../config/gthr.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/../config/cet.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
EGREP = @EGREP@
ERROR_CONSTANTS_SRCDIR = @ERROR_CONSTANTS_SRCDIR@
EXEEXT = @EXEEXT@
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
m4_include([../config/gc++filt.m4])
m4_include([../config/tls.m4])
m4_include([../config/gthr.m4])
+m4_include([../config/cet.m4])
glibcxx_toolexecdir
gxx_include_dir
glibcxx_prefixdir
+EXTRA_CFLAGS
CPU_OPT_BITS_RANDOM
CPU_OPT_EXT_RANDOM
ERROR_CONSTANTS_SRCDIR
with_default_libstdcxx_abi
enable_libstdcxx_threads
enable_libstdcxx_filesystem_ts
+enable_cet
with_gxx_include_dir
enable_version_specific_runtime_libs
with_gcc_major_version_only
enable C++11 threads support [default=auto]
--enable-libstdcxx-filesystem-ts
turns on ISO/IEC TS 18822 support [default=auto]
+ --enable-cet enable Intel CET in target libraries
+ [default=default]
--enable-version-specific-runtime-libs
Specify that runtime libraries should be installed
in a compiler-specific directory
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11604 "configure"
+#line 11608 "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 11710 "configure"
+#line 11714 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
# Fake what AC_TRY_COMPILE does.
cat > conftest.$ac_ext << EOF
-#line 15396 "configure"
+#line 15400 "configure"
int main()
{
typedef bool atomic_type;
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15431 "configure"
+#line 15435 "configure"
int main()
{
typedef short atomic_type;
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15466 "configure"
+#line 15470 "configure"
int main()
{
// NB: _Atomic_word not necessarily int.
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15502 "configure"
+#line 15506 "configure"
int main()
{
typedef long long atomic_type;
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 15583 "configure"
+#line 15587 "configure"
int main()
{
_Decimal32 d1;
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 15625 "configure"
+#line 15629 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15659 "configure"
+#line 15663 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
+# Add CET specific flags if 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_CXX_FLAGS="$EXTRA_CXX_FLAGS $CET_FLAGS"
+EXTRA_CFLAGS="$EXTRA_CFLAGS $CET_FLAGS"
+
+
+
# Determine cross-compile flags and AM_CONDITIONALs.
#AC_SUBST(GLIBCXX_IS_NATIVE)
#AM_CONDITIONAL(CANADIAN, test $CANADIAN = yes)
AC_SUBST(CPU_OPT_BITS_RANDOM)
+# Add CET specific flags if Intel CET is enabled.
+GCC_CET_FLAGS(CET_FLAGS)
+EXTRA_CXX_FLAGS="$EXTRA_CXX_FLAGS $CET_FLAGS"
+EXTRA_CFLAGS="$EXTRA_CFLAGS $CET_FLAGS"
+AC_SUBST(EXTRA_CFLAGS)
+AC_SUBST(EXTRA_CXX_FLAGS)
+
# Determine cross-compile flags and AM_CONDITIONALs.
#AC_SUBST(GLIBCXX_IS_NATIVE)
#AM_CONDITIONAL(CANADIAN, test $CANADIAN = yes)
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/../config/gthr.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/../config/cet.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
CONFIG_HEADER = $(top_builddir)/config.h
EGREP = @EGREP@
ERROR_CONSTANTS_SRCDIR = @ERROR_CONSTANTS_SRCDIR@
EXEEXT = @EXEEXT@
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/../config/gthr.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/../config/cet.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
CONFIG_HEADER = $(top_builddir)/config.h
EGREP = @EGREP@
ERROR_CONSTANTS_SRCDIR = @ERROR_CONSTANTS_SRCDIR@
EXEEXT = @EXEEXT@
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
C_INCLUDES = -I.. -I$(toplevel_srcdir)/libiberty -I$(toplevel_srcdir)/include
C_COMPILE = \
$(CC) $(DEFS) $(C_INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
# LTCOMPILE is copied from LTCXXCOMPILE below.
LTCOMPILE = $(LIBTOOL) --tag CC --tag disable-shared $(LIBTOOLFLAGS) --mode=compile \
$(CC) $(DEFS) $(C_INCLUDES) \
$(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
# Libtool notes
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/../config/gthr.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/../config/cet.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
CONFIG_HEADER = $(top_builddir)/config.h
EGREP = @EGREP@
ERROR_CONSTANTS_SRCDIR = @ERROR_CONSTANTS_SRCDIR@
EXEEXT = @EXEEXT@
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
C_INCLUDES = -I.. -I$(toplevel_srcdir)/libiberty -I$(toplevel_srcdir)/include
C_COMPILE = \
$(CC) $(DEFS) $(C_INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
# LTCOMPILE is copied from LTCXXCOMPILE below.
LTCOMPILE = $(LIBTOOL) --tag CC --tag disable-shared $(LIBTOOLFLAGS) --mode=compile \
$(CC) $(DEFS) $(C_INCLUDES) \
$(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
# Libtool notes
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/../config/gthr.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/../config/cet.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
CONFIG_HEADER = $(top_builddir)/config.h
EGREP = @EGREP@
ERROR_CONSTANTS_SRCDIR = @ERROR_CONSTANTS_SRCDIR@
EXEEXT = @EXEEXT@
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/../config/gthr.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/../config/cet.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
CONFIG_HEADER = $(top_builddir)/config.h
EGREP = @EGREP@
ERROR_CONSTANTS_SRCDIR = @ERROR_CONSTANTS_SRCDIR@
EXEEXT = @EXEEXT@
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/../config/gthr.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/../config/cet.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
CONFIG_HEADER = $(top_builddir)/config.h
EGREP = @EGREP@
ERROR_CONSTANTS_SRCDIR = @ERROR_CONSTANTS_SRCDIR@
EXEEXT = @EXEEXT@
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/../config/gthr.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/../config/cet.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
CONFIG_HEADER = $(top_builddir)/config.h
EGREP = @EGREP@
ERROR_CONSTANTS_SRCDIR = @ERROR_CONSTANTS_SRCDIR@
EXEEXT = @EXEEXT@
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/../config/gthr.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/../config/cet.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
CONFIG_HEADER = $(top_builddir)/config.h
EGREP = @EGREP@
ERROR_CONSTANTS_SRCDIR = @ERROR_CONSTANTS_SRCDIR@
EXEEXT = @EXEEXT@
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/../config/gthr.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/../config/cet.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
CONFIG_HEADER = $(top_builddir)/config.h
EGREP = @EGREP@
ERROR_CONSTANTS_SRCDIR = @ERROR_CONSTANTS_SRCDIR@
EXEEXT = @EXEEXT@
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/../config/gthr.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/../config/cet.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
CONFIG_HEADER = $(top_builddir)/config.h
EGREP = @EGREP@
ERROR_CONSTANTS_SRCDIR = @ERROR_CONSTANTS_SRCDIR@
EXEEXT = @EXEEXT@
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@