Skip to content

Commit

Permalink
[libunwind] Only include cet.h if __CET__ defined
Browse files Browse the repository at this point in the history
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
https://github.com/llvm/llvm-project/blob/ee423d93ead39e94c2970b3cc7ef6e6faa75d10b/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
  • Loading branch information
nikic committed Feb 16, 2022
1 parent b66b324 commit 2d2ef38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libunwind/src/assembly.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef UNWIND_ASSEMBLY_H
#define UNWIND_ASSEMBLY_H

#if (defined(__i386__) || defined(__x86_64__)) && defined(__linux__)
#if defined(__linux__) && defined(__CET__)
#include <cet.h>
#define _LIBUNWIND_CET_ENDBR _CET_ENDBR
#else
Expand Down

0 comments on commit 2d2ef38

Please sign in to comment.