Skip to content

Commit 2d0c9b6

Browse files
telansMaskRay
authored andcommitted
[OpenMP][CMake] Ensure linking against libm for Linux
Do the same as is done for NetBSD. Some compiler-rt/lib/builtins files call libm functions (e.g. fmaxl, fabs). Linking libomp with --rtlib=compiler-rt references these functions. Downstream report: https://bugs.gentoo.org/816831 Fixes: llvm#51457
1 parent 7f7c2c3 commit 2d0c9b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openmp/runtime/cmake/LibompHandleFlags.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ function(libomp_get_libflags libflags)
139139
libomp_append(libflags_local "-Wl,--no-as-needed" LIBOMP_HAVE_AS_NEEDED_FLAG)
140140
libomp_append(libflags_local "-lm")
141141
libomp_append(libflags_local "-Wl,--as-needed" LIBOMP_HAVE_AS_NEEDED_FLAG)
142-
elseif(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
142+
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|NetBSD")
143143
libomp_append(libflags_local -lm)
144144
endif()
145145
set(libflags_local ${libflags_local} ${LIBOMP_LIBFLAGS})

0 commit comments

Comments
 (0)