Skip to content

Commit 2ee0434

Browse files
committed
[compiler-rt][libunwind] Allow for CET on OpenBSD
1 parent d10af9d commit 2ee0434

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

compiler-rt/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ include(config-ix)
315315
# Setup Compiler Flags
316316
#================================
317317

318-
# fcf-protection is a gcc/clang option for CET support on Linux platforms.
318+
# fcf-protection is a gcc/clang option for CET support on some platforms.
319319
# We need to handle MSVC CET option on Windows platforms.
320320
if (NOT MSVC)
321321
if (COMPILER_RT_ENABLE_CET AND NOT COMPILER_RT_HAS_FCF_PROTECTION_FLAG)

compiler-rt/lib/builtins/assembly.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#ifndef COMPILERRT_ASSEMBLY_H
1515
#define COMPILERRT_ASSEMBLY_H
1616

17-
#if defined(__linux__) && defined(__CET__)
17+
#ifdef __CET__
1818
#if __has_include(<cet.h>)
1919
#include <cet.h>
2020
#endif

libunwind/src/assembly.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#ifndef UNWIND_ASSEMBLY_H
1616
#define UNWIND_ASSEMBLY_H
1717

18-
#if defined(__linux__) && defined(__CET__)
18+
#if defined(__CET__)
1919
#include <cet.h>
2020
#define _LIBUNWIND_CET_ENDBR _CET_ENDBR
2121
#else

libunwind/src/shadow_stack_unwind.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
#include "libunwind.h"
1414

15-
// Currently, CET is implemented on Linux x86 platforms.
16-
#if defined(_LIBUNWIND_TARGET_LINUX) && defined(__CET__) && defined(__SHSTK__)
15+
// Currently, CET is implemented on Linux/OpenBSD x86.
16+
#if defined(__CET__) && defined(__SHSTK__)
1717
#define _LIBUNWIND_USE_CET 1
1818
#endif
1919

0 commit comments

Comments
 (0)