]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Add --enable-mpx and --enable-mpx-write-only option to configure for Intel MPX support.
authorLiubov Dmitrieva <ldmitrie@sourceware.org>
Mon, 2 Sep 2013 09:21:47 +0000 (13:21 +0400)
committerLiubov Dmitrieva <ldmitrie@sourceware.org>
Wed, 23 Oct 2013 14:14:51 +0000 (18:14 +0400)
config.make.in
configure
configure.in
manual/install.texi

index 7b04568a2254bd1f85486873da19db8d5ce7f63a..36ee5e6b6117a048d468f4716b4225b5dc5e7ce4 100644 (file)
@@ -96,12 +96,15 @@ build-nscd = @build_nscd@
 use-nscd = @use_nscd@
 build-hardcoded-path-in-tests= @hardcoded_path_in_tests@
 build-pt-chown = @build_pt_chown@
+enable-mpx = @enable_mpx@
+enable-mpx-write-only = @enable_mpx_write_only@
 
 # Build tools.
 CC = @CC@
 CXX = @CXX@
 BUILD_CC = @BUILD_CC@
 CFLAGS = @CFLAGS@
+ASFLAGS = @ASFLAGS@
 CPPFLAGS-config = @CPPFLAGS@
 CPPUNDEFS = @CPPUNDEFS@
 ASFLAGS-config = @ASFLAGS_config@
index afe782105738e2ea565c592bd277916982f7511d..2c7dec17f34946a8d5f63b1850968c1b8a4638ea 100755 (executable)
--- a/configure
+++ b/configure
@@ -653,6 +653,9 @@ link_obsolete_rpc
 libc_cv_nss_crypt
 all_warnings
 force_install
+ASFLAGS
+enable_mpx_write_only
+enable_mpx
 bindnow
 hardcoded_path_in_tests
 oldest_abi
@@ -747,6 +750,8 @@ enable_lock_elision
 enable_add_ons
 enable_hidden_plt
 enable_bind_now
+enable_mpx
+enable_mpx_write_only
 enable_static_nss
 enable_force_install
 enable_kernel
@@ -1409,6 +1414,8 @@ Optional Features:
                           for add-ons if no parameter given
   --disable-hidden-plt    do not hide internal function calls to avoid PLT
   --enable-bind-now       disable lazy relocations in DSOs
+  --enable-mpx            turn on Intel MPX extension
+  --enable-mpx-write-only turn on Intel MPX extension
   --enable-static-nss     build static NSS modules [default=no]
   --disable-force-install don't force installation of files from this package,
                           even if they are older than the installed files
@@ -3519,6 +3526,37 @@ fi
 
 
 
+# Check whether --enable-mpx was given.
+if test "${enable_mpx+set}" = set; then :
+  enableval=$enable_mpx; enable_mpx=$enableval
+else
+  enable_mpx=no
+fi
+
+
+
+# Check whether --enable-mpx-write-only was given.
+if test "${enable_mpx_write_only+set}" = set; then :
+  enableval=$enable_mpx_write_only; enable_mpx_write_only=$enableval
+else
+  enable_mpx_write_only=no
+fi
+
+
+
+
+
+if test "$enable_mpx" = yes ; then
+       CFLAGS="$CFLAGS -g -fcheck-pointers -mmpx -fno-chkp-check-incomplete-type -fchkp-zero-input-bounds-for-main";
+   ASFLAGS="$ASFLAGS -g -D__CHKP__ -mmpx -Wa,-madd-bnd-prefix"
+fi
+
+if test "$enable_mpx_write_only" = yes ; then
+       CFLAGS="$CFLAGS -g -fcheck-pointers -fno-chkp-check-read -mmpx -fno-chkp-check-incomplete-type -fchkp-zero-input-bounds-for-main";
+       ASFLAGS="$ASFLAGS -g -D__CHKWR__ -mmpx -Wa,-madd-bnd-prefix"
+       enable_mpx=yes
+fi
+
 # Check whether --enable-static-nss was given.
 if test "${enable_static_nss+set}" = set; then :
   enableval=$enable_static_nss; static_nss=$enableval
index 9172ad10e40dacf9ce188124e4086d06c1cfafb9..7e83cec58d40cd97e475a01fb3347226a129dde0 100644 (file)
@@ -216,6 +216,33 @@ AC_ARG_ENABLE([bind-now],
              [bindnow=no])
 AC_SUBST(bindnow)
 
+AC_ARG_ENABLE([mpx],
+             AC_HELP_STRING([--enable-mpx],
+                            [turn on Intel MPX extension]),
+             [enable_mpx=$enableval],
+             [enable_mpx=no])
+AC_SUBST(enable_mpx)
+
+AC_ARG_ENABLE([mpx-write-only],
+             AC_HELP_STRING([--enable-mpx-write-only],
+                            [turn on Intel MPX extension]),
+             [enable_mpx_write_only=$enableval],
+             [enable_mpx_write_only=no])
+AC_SUBST(enable_mpx_write_only)
+
+AC_SUBST(ASFLAGS)
+
+if test "$enable_mpx" = yes ; then
+       CFLAGS="$CFLAGS -g -fcheck-pointers -mmpx -fno-chkp-check-incomplete-type -fchkp-zero-input-bounds-for-main";
+   ASFLAGS="$ASFLAGS -g -D__CHKP__ -mmpx -Wa,-madd-bnd-prefix"
+fi
+
+if test "$enable_mpx_write_only" = yes ; then
+       CFLAGS="$CFLAGS -g -fcheck-pointers -fno-chkp-check-read -mmpx -fno-chkp-check-incomplete-type -fchkp-zero-input-bounds-for-main";
+       ASFLAGS="$ASFLAGS -g -D__CHKWR__ -mmpx -Wa,-madd-bnd-prefix"
+       enable_mpx=yes
+fi
+
 dnl On some platforms we cannot use dynamic loading.  We must provide
 dnl static NSS modules.
 AC_ARG_ENABLE([static-nss],
index 4575d22319ddd4d323aa329b2967ca1212783670..03977e582875b74283bdc363bc3af5d0bdbd41fe 100644 (file)
@@ -177,6 +177,12 @@ setuid and owned by @code{root}.  The use of @file{pt_chown} introduces
 additional security risks to the system and you should enable it only if
 you understand and accept those risks.
 
+@item --enable-mpx
+By default, Intel MPX extension is disabled. This option turns it on.
+@item --enable-mpx-write-only
+By default, Intel MPX extension is disabled. This option turns it on for
+write only checks.
+
 @item --build=@var{build-system}
 @itemx --host=@var{host-system}
 These options are for cross-compiling.  If you specify both options and