From f34271d886901b5a96db8d8ac3341a8c59f1c141 Mon Sep 17 00:00:00 2001 From: Andrey Churbanov Date: Tue, 8 Oct 2019 12:23:25 +0000 Subject: [PATCH] Don't link libm with -Wl,--as-needed on FreeBSD Patch by jbeich (Jan Beich) Differential Revision: https://reviews.llvm.org/D68051 llvm-svn: 374037 --- openmp/runtime/cmake/LibompHandleFlags.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmp/runtime/cmake/LibompHandleFlags.cmake b/openmp/runtime/cmake/LibompHandleFlags.cmake index 4ad8e26..046c5d8 100644 --- a/openmp/runtime/cmake/LibompHandleFlags.cmake +++ b/openmp/runtime/cmake/LibompHandleFlags.cmake @@ -126,11 +126,11 @@ function(libomp_get_libflags libflags) if(${IA32}) libomp_append(libflags_local -lirc_pic LIBOMP_HAVE_IRC_PIC_LIBRARY) endif() - if(${CMAKE_SYSTEM_NAME} MATCHES "DragonFly") + if(${CMAKE_SYSTEM_NAME} MATCHES "DragonFly|FreeBSD") 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 "(Free|Net)BSD") + elseif(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD") libomp_append(libflags_local -lm) endif() set(libflags_local ${libflags_local} ${LIBOMP_LIBFLAGS}) -- 2.7.4