Skip to content

Commit

Permalink
[OpenMP][CMake] Ensure linking against libm for Linux
Browse files Browse the repository at this point in the history
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: #51457
  • Loading branch information
telans authored and MaskRay committed Mar 6, 2022
1 parent 7f7c2c3 commit 2d0c9b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openmp/runtime/cmake/LibompHandleFlags.cmake
Expand Up @@ -139,7 +139,7 @@ function(libomp_get_libflags libflags)
libomp_append(libflags_local "-Wl,--no-as-needed" LIBOMP_HAVE_AS_NEEDED_FLAG)
libomp_append(libflags_local "-lm")
libomp_append(libflags_local "-Wl,--as-needed" LIBOMP_HAVE_AS_NEEDED_FLAG)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|NetBSD")
libomp_append(libflags_local -lm)
endif()
set(libflags_local ${libflags_local} ${LIBOMP_LIBFLAGS})
Expand Down

0 comments on commit 2d0c9b6

Please sign in to comment.