mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-18 08:23:50 +08:00
Enable building libgfortran with Intel CET
libgfortran/ * acinclude.m4: Add enable.m4, cet.m4. * Makefile.in: Regenerate. * configure: Likewise. * configure.ac: Set CET_FLAGS. Update AM_FCFLAGS, AM_CFLAGS, CFLAGS. From-SVN: r254902
This commit is contained in:
parent
0495940618
commit
26724ef992
@ -1,3 +1,11 @@
|
||||
2017-11-17 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
|
||||
|
||||
* acinclude.m4: Add enable.m4, cet.m4.
|
||||
* Makefile.in: Regenerate.
|
||||
* configure: Likewise.
|
||||
* configure.ac: Set CET_FLAGS. Update AM_FCFLAGS,
|
||||
AM_CFLAGS, CFLAGS.
|
||||
|
||||
2017-10-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
Rimvydas (RJ)
|
||||
|
||||
|
@ -139,7 +139,9 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
|
||||
$(top_srcdir)/../config/no-executables.m4 \
|
||||
$(top_srcdir)/../config/math.m4 \
|
||||
$(top_srcdir)/../config/ax_check_define.m4 \
|
||||
$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/../config/enable.m4 \
|
||||
$(top_srcdir)/../config/cet.m4 $(top_srcdir)/../libtool.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 \
|
||||
|
@ -2,6 +2,8 @@ m4_include(../config/acx.m4)
|
||||
m4_include(../config/no-executables.m4)
|
||||
m4_include(../config/math.m4)
|
||||
m4_include(../config/ax_check_define.m4)
|
||||
m4_include(../config/enable.m4)
|
||||
m4_include(../config/cet.m4)
|
||||
|
||||
dnl Check that we have a working GNU Fortran compiler
|
||||
AC_DEFUN([LIBGFOR_WORKING_GFORTRAN], [
|
||||
|
79
libgfortran/configure
vendored
79
libgfortran/configure
vendored
@ -773,6 +773,7 @@ enable_intermodule
|
||||
enable_maintainer_mode
|
||||
enable_multilib
|
||||
enable_dependency_tracking
|
||||
enable_cet
|
||||
enable_symvers
|
||||
with_gnu_ld
|
||||
enable_shared
|
||||
@ -1424,6 +1425,8 @@ Optional Features:
|
||||
--enable-multilib build many library versions (default)
|
||||
--disable-dependency-tracking speeds up one-time build
|
||||
--enable-dependency-tracking do not reject slow dependency extractors
|
||||
--enable-cet enable Intel CET in target libraries
|
||||
[default=default]
|
||||
--disable-symvers disable symbol versioning for libgfortran
|
||||
--enable-shared[=PKGS] build shared libraries [default=yes]
|
||||
--enable-static[=PKGS] build static libraries [default=yes]
|
||||
@ -5787,6 +5790,78 @@ if test "x$GCC" = "xyes"; then
|
||||
CFLAGS="-std=gnu11 $CFLAGS"
|
||||
fi
|
||||
|
||||
# Add CET specific flags if 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
|
||||
|
||||
AM_FCFLAGS="$AM_FCFLAGS $CET_FLAGS"
|
||||
AM_CFLAGS="$AM_CFLAGS $CET_FLAGS"
|
||||
CFLAGS="$CFLAGS $CET_FLAGS"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -12423,7 +12498,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 12426 "configure"
|
||||
#line 12501 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -12529,7 +12604,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 12532 "configure"
|
||||
#line 12607 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -147,6 +147,13 @@ if test "x$GCC" = "xyes"; then
|
||||
## that we'll encounter when compiling our own source files.
|
||||
CFLAGS="-std=gnu11 $CFLAGS"
|
||||
fi
|
||||
|
||||
# Add CET specific flags if CET is enabled
|
||||
GCC_CET_FLAGS(CET_FLAGS)
|
||||
AM_FCFLAGS="$AM_FCFLAGS $CET_FLAGS"
|
||||
AM_CFLAGS="$AM_CFLAGS $CET_FLAGS"
|
||||
CFLAGS="$CFLAGS $CET_FLAGS"
|
||||
|
||||
AC_SUBST(AM_FCFLAGS)
|
||||
AC_SUBST(AM_CFLAGS)
|
||||
AC_SUBST(CFLAGS)
|
||||
|
Loading…
Reference in New Issue
Block a user