[libunwind] Only include cet.h if __CET__ defined

We should not assume that the cet.h header exists just because
we're on x86 linux. Only include it if __CET__ is defined. This
makes the code more similar to what compiler-rt does in
ee423d93ea/compiler-rt/lib/builtins/assembly.h (L17)
(though that one also has a __has_include() check -- I've not found
that to be necessary).

Differential Revision: https://reviews.llvm.org/D119697
This commit is contained in:
Nikita Popov 2022-02-12 10:29:33 +01:00 committed by Nikita Popov
parent b66b3247f5
commit 2d2ef384b2
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@
#ifndef UNWIND_ASSEMBLY_H #ifndef UNWIND_ASSEMBLY_H
#define UNWIND_ASSEMBLY_H #define UNWIND_ASSEMBLY_H
#if (defined(__i386__) || defined(__x86_64__)) && defined(__linux__) #if defined(__linux__) && defined(__CET__)
#include <cet.h> #include <cet.h>
#define _LIBUNWIND_CET_ENDBR _CET_ENDBR #define _LIBUNWIND_CET_ENDBR _CET_ENDBR
#else #else