diff --git a/0001-openmp-Support-CET-in-z_Linux_asm.S-123213.patch b/0001-openmp-Support-CET-in-z_Linux_asm.S-123213.patch new file mode 100644 index 0000000..3fd4cd1 --- /dev/null +++ b/0001-openmp-Support-CET-in-z_Linux_asm.S-123213.patch @@ -0,0 +1,51 @@ +From 90a05f32166c4a45224a5eedbec9c5c7e21d2dbf Mon Sep 17 00:00:00 2001 +From: Nikita Popov +Date: Fri, 17 Jan 2025 09:26:49 +0100 +Subject: [PATCH] [openmp] Support CET in z_Linux_asm.S (#123213) + +When libomp is built with -cf-protection, add endbr instructions to the +start of functions for Intel CET support. +--- + openmp/runtime/src/z_Linux_asm.S | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/openmp/runtime/src/z_Linux_asm.S b/openmp/runtime/src/z_Linux_asm.S +index cc5344cdd124..0bf9f07a13f1 100644 +--- a/openmp/runtime/src/z_Linux_asm.S ++++ b/openmp/runtime/src/z_Linux_asm.S +@@ -19,6 +19,16 @@ + + #if KMP_ARCH_X86 || KMP_ARCH_X86_64 + ++# if defined(__ELF__) && defined(__CET__) && defined(__has_include) ++# if __has_include() ++# include ++# endif ++# endif ++ ++# if !defined(_CET_ENDBR) ++# define _CET_ENDBR ++# endif ++ + # if KMP_MIC + // the 'delay r16/r32/r64' should be used instead of the 'pause'. + // The delay operation has the effect of removing the current thread from +@@ -66,6 +76,7 @@ + ALIGN 4 + .globl KMP_PREFIX_UNDERSCORE($0) + KMP_PREFIX_UNDERSCORE($0): ++ _CET_ENDBR + .endmacro + # else // KMP_OS_DARWIN + # define KMP_PREFIX_UNDERSCORE(x) x //no extra underscore for Linux* OS symbols +@@ -92,6 +103,7 @@ KMP_PREFIX_UNDERSCORE($0): + .globl KMP_PREFIX_UNDERSCORE(\proc) + KMP_PREFIX_UNDERSCORE(\proc): + .cfi_startproc ++ _CET_ENDBR + .endm + .macro KMP_CFI_DEF_OFFSET sz + .cfi_def_cfa_offset \sz +-- +2.47.1 + diff --git a/llvm.spec b/llvm.spec index 6f25bdf..a1e8aa4 100644 --- a/llvm.spec +++ b/llvm.spec @@ -182,7 +182,7 @@ #region main package Name: %{pkg_name_llvm} Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}}%{?llvm_snapshot_version_suffix:~%{llvm_snapshot_version_suffix}} -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Low Level Virtual Machine License: Apache-2.0 WITH LLVM-exception OR NCSA @@ -239,6 +239,7 @@ Source1000: version.spec.inc #region OpenMP patches Patch1900: 0001-openmp-Add-option-to-disable-tsan-tests-111548.patch Patch1901: 0001-openmp-Use-core_siblings_list-if-physical_package_id.patch +Patch1910: 0001-openmp-Support-CET-in-z_Linux_asm.S-123213.patch #endregion OpenMP patches #region CLANG patches @@ -2513,6 +2514,9 @@ fi #region changelog %changelog +* Fri Jan 17 2025 Nikita Popov - 19.1.7-2 +- Support CET in libomp.so (RHEL-74346) + * Wed Jan 15 2025 Nikita Popov - 19.1.7-1 - Update to LLVM 19.1.7 (RHEL-57456) - Remove llvm18 compat package (RHEL-57457)