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

(cherry picked from commit 2d2ef38)
  • Loading branch information
nikic authored and tstellar committed Feb 28, 2022
1 parent 5f5b687 commit 61e78c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libunwind/src/assembly.h
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 61e78c6

Please sign in to comment.