Skip to content

Commit fe287bf

Browse files
committed
[openmp] Only try to add the -mrtm flag on i386/x86_64
Clang does accept the flag for any architecture, but prints a warning: clang-16: warning: argument unused during compilation: '-mrtm' [-Wunused-command-line-argument] This flag is documented as an x86 specific flag, so don't try to add it for other architectures, to silence this warning. Differential Revision: https://reviews.llvm.org/D137744
1 parent 7e6dbfc commit fe287bf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

openmp/runtime/cmake/LibompHandleFlags.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ function(libomp_get_cxxflags cxxflags)
4242
libomp_append(flags_local /GS LIBOMP_HAVE_GS_FLAG)
4343
libomp_append(flags_local /EHsc LIBOMP_HAVE_EHSC_FLAG)
4444
libomp_append(flags_local /Oy- LIBOMP_HAVE_OY__FLAG)
45-
libomp_append(flags_local -mrtm LIBOMP_HAVE_MRTM_FLAG)
45+
if(${IA32} OR ${INTEL64})
46+
libomp_append(flags_local -mrtm LIBOMP_HAVE_MRTM_FLAG)
47+
endif()
4648
# Intel(R) C Compiler flags
4749
libomp_append(flags_local /Qsafeseh LIBOMP_HAVE_QSAFESEH_FLAG)
4850
libomp_append(flags_local -Qoption,cpp,--extended_float_types LIBOMP_HAVE_EXTENDED_FLOAT_TYPES_FLAG)

0 commit comments

Comments
 (0)