x86: Always include <dl-cet.h>/cet-tunables.h> for --enable-cet

Message ID 20180716225954.GA28377@intel.com
State New
Headers show
Series
  • x86: Always include <dl-cet.h>/cet-tunables.h> for --enable-cet
Related show

Commit Message

H.J. Lu July 16, 2018, 10:59 p.m.
Always include <dl-cet.h> and cet-tunables.h> when CET is enabled.
Otherwise, configure glibc with --enable-cet --disable-tunables will
fail to build.

OK for master?

H.J.
---
	* sysdeps/x86/cpu-features.c: Always include <dl-cet.h> and
	cet-tunables.h> when CET is enabled.
---
 sysdeps/x86/cpu-features.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

-- 
2.17.1

Comments

Siddhesh Poyarekar July 17, 2018, 2:02 a.m. | #1
On 07/17/2018 04:29 AM, H.J. Lu wrote:
> Always include <dl-cet.h> and cet-tunables.h> when CET is enabled.

> Otherwise, configure glibc with --enable-cet --disable-tunables will

> fail to build.


I can't imagine why you'd want to disable an amazing feature like 
tunables ;)

> OK for master?


LGTM, thanks :)

Siddhesh

Patch

diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index 0627f145e0..8108256c42 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -30,8 +30,6 @@  extern void TUNABLE_CALLBACK (set_hwcaps) (tunable_val_t *)
   attribute_hidden;
 
 # if CET_ENABLED
-#  include <dl-cet.h>
-#  include <cet-tunables.h>
 extern void TUNABLE_CALLBACK (set_x86_ibt) (tunable_val_t *)
   attribute_hidden;
 extern void TUNABLE_CALLBACK (set_x86_shstk) (tunable_val_t *)
@@ -39,6 +37,11 @@  extern void TUNABLE_CALLBACK (set_x86_shstk) (tunable_val_t *)
 # endif
 #endif
 
+#if CET_ENABLED
+# include <dl-cet.h>
+# include <cet-tunables.h>
+#endif
+
 static void
 get_common_indeces (struct cpu_features *cpu_features,
 		    unsigned int *family, unsigned int *model,