This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch hjl/cet/property created. glibc-2.25-549-g408eadb


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/cet/property has been created
        at  408eadbfd3db90ab854e2696a9ac633d311e12e4 (commit)

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=408eadbfd3db90ab854e2696a9ac633d311e12e4

commit 408eadbfd3db90ab854e2696a9ac633d311e12e4
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Jun 22 04:15:39 2017 -0700

    Add <sys/cet.h>

diff --git a/configure b/configure
index 97a2dad..5ac2c78 100755
--- a/configure
+++ b/configure
@@ -788,6 +788,7 @@ enable_nscd
 enable_pt_chown
 enable_tunables
 enable_mathvec
+enable_cet
 with_cpu
 '
       ac_precious_vars='build_alias
@@ -1463,6 +1464,7 @@ Optional Features:
                           'no' and 'valstring'
   --enable-mathvec        Enable building and installing mathvec [default
                           depends on architecture]
+  --enable-cet            Enable CET [default depends on architecture]
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -3754,6 +3756,14 @@ else
 fi
 
 
+# Check whether --enable-cet was given.
+if test "${enable_cet+set}" = set; then :
+  enableval=$enable_cet; enable_cet=$enableval
+else
+  enable_cet=notset
+fi
+
+
 # We keep the original values in `$config_*' and never modify them, so we
 # can write them unchanged into config.make.  Everything else uses
 # $machine, $vendor, and $os, and changes them whenever convenient.
@@ -6682,6 +6692,12 @@ fi
 config_vars="$config_vars
 build-mathvec = $build_mathvec"
 
+if test x"$enable_cet" = xnotset; then
+  enable_cet=no
+fi
+config_vars="$config_vars
+enable-cet = $enable_cet"
+
 
 
 
diff --git a/configure.ac b/configure.ac
index 16e97d3..29a2e36 100644
--- a/configure.ac
+++ b/configure.ac
@@ -460,6 +460,12 @@ AC_ARG_ENABLE([mathvec],
 	      [build_mathvec=$enableval],
 	      [build_mathvec=notset])
 
+AC_ARG_ENABLE([cet],
+	      [AS_HELP_STRING([--enable-cet],
+	      [Enable CET @<:@default depends on architecture@:>@])],
+	      [enable_cet=$enableval],
+	      [enable_cet=notset])
+
 # We keep the original values in `$config_*' and never modify them, so we
 # can write them unchanged into config.make.  Everything else uses
 # $machine, $vendor, and $os, and changes them whenever convenient.
@@ -1855,6 +1861,11 @@ if test x"$build_mathvec" = xnotset; then
 fi
 LIBC_CONFIG_VAR([build-mathvec], [$build_mathvec])
 
+if test x"$enable_cet" = xnotset; then
+  enable_cet=no
+fi
+LIBC_CONFIG_VAR([enable-cet], [$enable_cet])
+
 AC_SUBST(libc_extra_cflags)
 AC_SUBST(libc_extra_cppflags)
 
diff --git a/sysdeps/unix/sysv/linux/x86/Makefile b/sysdeps/unix/sysv/linux/x86/Makefile
index 9e6ec44..71225bb 100644
--- a/sysdeps/unix/sysv/linux/x86/Makefile
+++ b/sysdeps/unix/sysv/linux/x86/Makefile
@@ -22,3 +22,9 @@ endif
 ifeq ($(subdir),elf)
 sysdep_routines += dl-vdso
 endif
+
+ifeq ($(enable-cet),yes)
+CPPFLAGS-.o += -include $(..)sysdeps/unix/sysv/linux/x86/sys/cet.h
+CPPFLAGS-.os += -include $(..)sysdeps/unix/sysv/linux/x86/sys/cet.h
+CPPFLAGS-.op += -include $(..)sysdeps/unix/sysv/linux/x86/sys/cet.h
+endif
diff --git a/sysdeps/unix/sysv/linux/x86/configure b/sysdeps/unix/sysv/linux/x86/configure
new file mode 100644
index 0000000..84db765
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/configure
@@ -0,0 +1,6 @@
+# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/unix/sysv/linux/x86.
+
+if test x"$enable_cet" = xnotset; then
+  enable_cet=yes
+fi
diff --git a/sysdeps/unix/sysv/linux/x86/configure.ac b/sysdeps/unix/sysv/linux/x86/configure.ac
new file mode 100644
index 0000000..08c201c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/configure.ac
@@ -0,0 +1,6 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/unix/sysv/linux/x86.
+
+if test x"$enable_cet" = xnotset; then
+  enable_cet=yes
+fi
diff --git a/sysdeps/unix/sysv/linux/x86/sys/cet.h b/sysdeps/unix/sysv/linux/x86/sys/cet.h
new file mode 100644
index 0000000..dbc9738
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/sys/cet.h
@@ -0,0 +1,134 @@
+/* GNU program property for Intel CET.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _SYS_CET_H
+#define _SYS_CET_H	1
+
+# ifdef __ASSEMBLER__
+
+#  ifdef __LP64__
+#   define __PROPERTY_ALIGN 3
+#  else
+#   define __PROPERTY_ALIGN 2
+#  endif
+
+#  ifdef __IBT__
+	.pushsection ".note.gnu.property", "a"
+	.p2align __PROPERTY_ALIGN
+	.long 1f - 0f		/* name length.  */
+	.long 5f - 1f		/* data length.  */
+	/* NT_GNU_PROPERTY_TYPE_0.   */
+	.long 5			/* note type.  */
+0:
+	.asciz "GNU"		/* vendor name.  */
+1:
+	.p2align __PROPERTY_ALIGN
+	/* GNU_PROPERTY_X86_FEATURE_1_AND.  */
+	.long 0xc0000002	/* pr_type.  */
+	.long 4f - 3f		/* pr_datasz.  */
+3:
+	/* GNU_PROPERTY_X86_FEATURE_1_IBT.  */
+	.long 0x1
+4:
+	.p2align __PROPERTY_ALIGN
+5:
+	.popsection
+#  endif
+
+#  ifdef __SHSTK__
+	.pushsection ".note.gnu.property", "a"
+	.p2align __PROPERTY_ALIGN
+	.long 1f - 0f		/* name length.  */
+	.long 5f - 1f		/* data length.  */
+	/* NT_GNU_PROPERTY_TYPE_0.   */
+	.long 5			/* note type.  */
+0:
+	.asciz "GNU"		/* vendor name.  */
+1:
+	.p2align __PROPERTY_ALIGN
+	/* GNU_PROPERTY_X86_FEATURE_1_AND.  */
+	.long 0xc0000002	/* pr_type.  */
+	.long 4f - 3f		/* pr_datasz.  */
+3:
+	/* GNU_PROPERTY_X86_FEATURE_1_SHSTK.  */
+	.long 0x2
+4:
+	.p2align __PROPERTY_ALIGN
+5:
+	.popsection
+#  endif
+
+# else
+
+#  ifdef __LP64__
+#   define __PROPERTY_ALIGN "3"
+#  else
+#   define __PROPERTY_ALIGN "2"
+#  endif
+
+#  ifdef __IBT__
+  __asm ("\
+	.pushsection \".note.gnu.property\", \"a\"\n\
+	.p2align " __PROPERTY_ALIGN "\n\
+	.long 1f - 0f		/* name length.  */\n\
+	.long 5f - 1f		/* data length.  */\n\
+	/* NT_GNU_PROPERTY_TYPE_0.   */\n\
+	.long 5			/* note type.  */\n\
+0:\n\
+	.asciz \"GNU\"		/* vendor name.  */\n\
+1:\n\
+	.p2align " __PROPERTY_ALIGN "\n\
+	/* GNU_PROPERTY_X86_FEATURE_1_AND.  */\n\
+	.long 0xc0000002	/* pr_type.  */\n\
+	.long 4f - 3f		/* pr_datasz.  */\n\
+3:\n\
+	/* GNU_PROPERTY_X86_FEATURE_1_IBT.  */\n\
+	.long 0x1\n\
+4:\n\
+	.p2align " __PROPERTY_ALIGN "\n\
+5:\n\
+	.popsection");
+#  endif
+
+#  ifdef __SHSTK__
+  __asm ("\
+	.pushsection \".note.gnu.property\", \"a\"\n\
+	.p2align " __PROPERTY_ALIGN "\n\
+	.long 1f - 0f		/* name length.  */\n\
+	.long 5f - 1f		/* data length.  */\n\
+	/* NT_GNU_PROPERTY_TYPE_0.   */\n\
+	.long 5			/* note type.  */\n\
+0:\n\
+	.asciz \"GNU\"		/* vendor name.  */\n\
+1:\n\
+	.p2align " __PROPERTY_ALIGN "\n\
+	/* GNU_PROPERTY_X86_FEATURE_1_AND.  */\n\
+	.long 0xc0000002	/* pr_type.  */\n\
+	.long 4f - 3f		/* pr_datasz.  */\n\
+3:\n\
+	/* GNU_PROPERTY_X86_FEATURE_1_SHSTK.  */\n\
+	.long 0x2\n\
+4:\n\
+	.p2align " __PROPERTY_ALIGN "\n\
+5:\n\
+	.popsection");
+#  endif
+
+# endif
+
+#endif	/* _SYS_CET_H */

-----------------------------------------------------------------------


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]