Enable building libbacktrace with Intel CET

libbacktrace/
	* configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
	* aclocal.m4: Regenerate.
	* Makefile.in: Likewise.
	* configure: Likewise.

From-SVN: r254892
This commit is contained in:
Igor Tsimbalist 2017-11-17 22:11:42 +01:00 committed by Igor Tsimbalist
parent 5dbc00611a
commit 44685d378f
5 changed files with 94 additions and 3 deletions

View File

@ -1,3 +1,10 @@
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

View File

@ -95,7 +95,9 @@ DIST_COMMON = README ChangeLog $(srcdir)/Makefile.in \
$(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 \

View File

@ -670,6 +670,8 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([../config/cet.m4])
m4_include([../config/enable.m4])
m4_include([../config/lead-dot.m4])
m4_include([../config/multi.m4])
m4_include([../config/override.m4])

View File

@ -743,6 +743,7 @@ enable_fast_install
with_gnu_ld
enable_libtool_lock
enable_largefile
enable_cet
with_system_libunwind
enable_host_shared
'
@ -1385,6 +1386,8 @@ Optional Features:
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:
@ -11146,7 +11149,7 @@ else
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
@ -11252,7 +11255,7 @@ else
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
@ -11784,6 +11787,77 @@ $as_echo "$libbacktrace_cv_c_random_seed_string" >&6; }
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'

View File

@ -130,6 +130,12 @@ else
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 \