pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/llvm Re-instate the cmake configure check for whe...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/10425258ccc6
branches:  trunk
changeset: 439525:10425258ccc6
user:      he <he%pkgsrc.org@localhost>
date:      Sun Sep 20 09:37:17 2020 +0000

description:
Re-instate the cmake configure check for whether -latomic is
required to gain access to 8-byte atomics.  Add a hacks.mk file
to pull in devel/libatomic on powerpc ports.  The reason is that
even though llvm itself doesn't need or use 8-byte atomics, other
programs refer to this installed CheckAtomic cmake file and may
indeed both need and use 8-byte atomics.
Verified that llvm still builds on NetBSD/macppc 9.0.
Bump PKGREVISION to 1.

diffstat:

 lang/llvm/Makefile                                      |   3 +-
 lang/llvm/hacks.mk                                      |  12 +++++++
 lang/llvm/patches/patch-cmake_modules_CheckAtomic.cmake |  27 -----------------
 3 files changed, 14 insertions(+), 28 deletions(-)

diffs (64 lines):

diff -r 918321289f19 -r 10425258ccc6 lang/llvm/Makefile
--- a/lang/llvm/Makefile        Sun Sep 20 09:33:47 2020 +0000
+++ b/lang/llvm/Makefile        Sun Sep 20 09:37:17 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.57 2020/07/27 11:12:48 adam Exp $
+# $NetBSD: Makefile,v 1.58 2020/09/20 09:37:17 he Exp $
 #
 # when updating this, please also update:
 # devel/include-what-you-use
@@ -25,6 +25,7 @@
 
 DISTNAME=      llvm-${LLVM_VERSION}.src
 PKGNAME=       ${DISTNAME:S/.src//}
+PKGREVISION=   1
 CATEGORIES=    lang devel
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
diff -r 918321289f19 -r 10425258ccc6 lang/llvm/hacks.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/llvm/hacks.mk        Sun Sep 20 09:37:17 2020 +0000
@@ -0,0 +1,12 @@
+# $NetBSD: hacks.mk,v 1.1 2020/09/20 09:37:17 he Exp $
+
+.if !defined(LLVM_HACKS_MK)
+LLVM_HACKS_MK= defined
+
+# [Sun Sep 20 11:08:39 CEST 2020 : he]
+# On NetBSD/powerpc, use devel/libatomic to get 8-byte atomics.
+.if ${MACHINE_ARCH} == "powerpc"
+.include "../../devel/libatomic/buildlink3.mk"
+.endif
+
+.endif # LLVM_HACKS_MK
diff -r 918321289f19 -r 10425258ccc6 lang/llvm/patches/patch-cmake_modules_CheckAtomic.cmake
--- a/lang/llvm/patches/patch-cmake_modules_CheckAtomic.cmake   Sun Sep 20 09:33:47 2020 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-$NetBSD: patch-cmake_modules_CheckAtomic.cmake,v 1.2 2020/04/18 07:50:18 adam Exp $
-
-Omit check for native 8-byte atomics, platform may not have them,
-and they are actually not required here.  Makes powerpc build llvm.
-
---- cmake/modules/CheckAtomic.cmake.orig       2020-03-19 09:19:04.000000000 +0000
-+++ cmake/modules/CheckAtomic.cmake
-@@ -62,19 +62,6 @@ else()
-   check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITHOUT_LIB)
- endif()
- 
--# If not, check if the library exists, and atomics work with it.
--if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
--  check_library_exists(atomic __atomic_load_8 "" HAVE_CXX_LIBATOMICS64)
--  if(HAVE_CXX_LIBATOMICS64)
--    list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
--    check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITH_LIB)
--    if (NOT HAVE_CXX_ATOMICS64_WITH_LIB)
--      message(FATAL_ERROR "Host compiler must support 64-bit std::atomic!")
--    endif()
--  else()
--    message(FATAL_ERROR "Host compiler appears to require libatomic for 64-bit operations, but cannot find it.")
--  endif()
--endif()
- 
- ## TODO: This define is only used for the legacy atomic operations in
- ## llvm's Atomic.h, which should be replaced.  Other code simply



Home | Main Index | Thread Index | Old Index