libLLVM: update to 13.0.1, for mesa update
This commit is contained in:
parent
aede887363
commit
1287925604
14 changed files with 477 additions and 181 deletions
|
@ -1,10 +1,11 @@
|
|||
# $NetBSD: Makefile,v 1.37 2021/05/24 19:52:33 wiz Exp $
|
||||
# $NetBSD: Makefile,v 1.38 2022/03/13 15:22:32 tnn Exp $
|
||||
|
||||
DISTNAME= llvm-9.0.1.src
|
||||
DISTNAME= llvm-13.0.1.src
|
||||
PKGNAME= ${DISTNAME:S/llvm/libLLVM/:S/.src//}
|
||||
PKGREVISION= 1
|
||||
CATEGORIES= lang devel
|
||||
MASTER_SITES= http://llvm.org/releases/${PKGVERSION_NOREV}/
|
||||
MASTER_SITES= ${MASTER_SITE_GITHUB:=llvm/}
|
||||
GITHUB_PROJECT= llvm-project
|
||||
GITHUB_RELEASE= llvmorg-${PKGVERSION_NOREV}
|
||||
EXTRACT_SUFX= .tar.xz
|
||||
|
||||
MAINTAINER= pkgsrc-users@NetBSD.org
|
||||
|
@ -39,7 +40,7 @@ CMAKE_ARGS.Darwin+= -DCMAKE_LIBTOOL=/usr/bin/libtool
|
|||
.for tool in bugpoint bugpoint_passes dsymutil gold llc lli llvm_ar \
|
||||
llvm_as llvm_as_fuzzer llvm_bcanalyzer llvm_c_test llvm_cat \
|
||||
llvm_cfi_verify llvm_cov llvm_cvtres llvm_cxxdump llvm_cxxfilt \
|
||||
llvm_cxxmap llvm_diff llvm_dis llvm_dwarfdump llvm_dwp \
|
||||
llvm_cxxmap llvm_diff llvm_dis llvm_dwp \
|
||||
llvm_elfabi llvm_exegesis llvm_extract llvm_go llvm_isel_fuzzer \
|
||||
llvm_itanium_demangle_fuzzer llvm_jitlink llvm_jitlistener \
|
||||
llvm_link llvm_lipo llvm_lto llvm_lto2 llvm_mc \
|
||||
|
@ -51,7 +52,10 @@ CMAKE_ARGS.Darwin+= -DCMAKE_LIBTOOL=/usr/bin/libtool
|
|||
llvm_strings llvm_symbolizer llvm_undname llvm_xray \
|
||||
llvm_yaml_numeric_parser_fuzzer lto msbuild obj2yaml \
|
||||
opt opt_viewer remarks_shlib sancov sanstats \
|
||||
verify_uselistorder xcode_toolchain yaml2obj
|
||||
verify_uselistorder xcode_toolchain yaml2obj \
|
||||
llvm_ml llvm_profgen llvm_reduce llvm_gsymutil split_file \
|
||||
llvm_libtool_darwin llvm_ifs llvm_dwarfdump llvm_sim \
|
||||
llvm_tapi_diff
|
||||
|
||||
CMAKE_ARGS+= -DLLVM_TOOL_${tool:tu}_BUILD=OFF
|
||||
.endfor
|
||||
|
@ -76,7 +80,7 @@ REPLACE_PYTHON+= utils/Misc/zkill
|
|||
REPLACE_PYTHON+= utils/bisect
|
||||
REPLACE_PYTHON+= utils/clang-parse-diagnostics-file
|
||||
REPLACE_PYTHON+= utils/git/find-rev
|
||||
REPLACE_PYTHON+= utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest
|
||||
REPLACE_PYTHON+= utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest.py
|
||||
REPLACE_PYTHON+= utils/llvm-build/llvm-build
|
||||
REPLACE_PYTHON+= utils/llvm-compilers-check
|
||||
REPLACE_PYTHON+= utils/llvm-lit/llvm-lit.in
|
||||
|
@ -104,13 +108,19 @@ PLIST.notdylib= yes
|
|||
PLIST_SUBST+= SOEXT=${SOEXT}
|
||||
PLIST_SUBST+= LLVM_LIBNAME=${LLVM_LIBNAME}
|
||||
|
||||
.include "options.mk"
|
||||
|
||||
# needs std::atomic with 64-bit CAS
|
||||
.if ${MACHINE_ARCH} == "i386"
|
||||
CXXFLAGS+= -march=i586
|
||||
.endif
|
||||
|
||||
.if !empty(MACHINE_ARCH:Mpowerpc*)
|
||||
# Needed to avoid "relocation truncated to fit: R_PPC_REL24"
|
||||
CFLAGS+= -mlongcall
|
||||
CXXFLAGS+= -mlongcall
|
||||
.endif
|
||||
|
||||
.include "options.mk"
|
||||
|
||||
# replacing config.guess is required even for cmake.
|
||||
# It is used to detect correct LLVM_HOST_TRIPLE, e.g. for NetBSD/evbarm.
|
||||
post-extract:
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,11 +1,11 @@
|
|||
# $NetBSD: buildlink3.mk,v 1.6 2020/03/06 22:44:18 tnn Exp $
|
||||
# $NetBSD: buildlink3.mk,v 1.7 2022/03/13 15:22:32 tnn Exp $
|
||||
|
||||
BUILDLINK_TREE+= libLLVM
|
||||
|
||||
.if !defined(LIBLLVM_BUILDLINK3_MK)
|
||||
LIBLLVM_BUILDLINK3_MK:=
|
||||
|
||||
BUILDLINK_API_DEPENDS.libLLVM+= libLLVM>=9.0.0
|
||||
BUILDLINK_API_DEPENDS.libLLVM+= libLLVM>=13
|
||||
BUILDLINK_PKGSRCDIR.libLLVM?= ../../lang/libLLVM
|
||||
BUILDLINK_INCDIRS.libLLVM?= include/libLLVM
|
||||
BUILDLINK_LIBDIRS.libLLVM?= lib/libLLVM
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
$NetBSD: distinfo,v 1.18 2021/10/26 10:51:40 nia Exp $
|
||||
$NetBSD: distinfo,v 1.19 2022/03/13 15:22:32 tnn Exp $
|
||||
|
||||
BLAKE2s (llvm-9.0.1.src.tar.xz) = 16f02c65adb30c1d94c27efe3ffa7cb49dc737cb620446a393b7d40322aa94de
|
||||
SHA512 (llvm-9.0.1.src.tar.xz) = bfb6960a4dd1e18f4005f324f478a781c69e8ec7c20569d9b243fcb9372dc7733b254f26c683373537990cc9c109c78eaf0f65449629ee17caca1bce9b9ccccd
|
||||
Size (llvm-9.0.1.src.tar.xz) = 33035112 bytes
|
||||
SHA1 (patch-CMakeLists.txt) = af0dc7f54e5e11c481f78ffafc9a6833e4469f32
|
||||
SHA1 (patch-cmake_config-ix.cmake) = a6f4e9b0e635792acf18a41b310f55969f78bcd8
|
||||
SHA1 (patch-cmake_modules_AddLLVM.cmake) = 752852ec340e72428bf1087b454a75a4cb176632
|
||||
SHA1 (patch-cmake_modules_CMakeLists.txt) = 69514dafb36794eb6923a39ef219bdc7b09c37ee
|
||||
SHA1 (patch-cmake_modules_CheckAtomic.cmake) = 51e4fdf3bc24b50fc4d4bfa1ec5ba6c82ef946b4
|
||||
SHA1 (patch-include_llvm-c_DataTypes.h) = 025c035e0e10871727391bd58936bd67b3e58244
|
||||
BLAKE2s (llvm-13.0.1.src.tar.xz) = 5fff4c8506340cc14b2160478be6403c80f526841209a4b1b3a9f16cf61dcc05
|
||||
SHA512 (llvm-13.0.1.src.tar.xz) = 05fbe8708ac3d0dfef3a9135ee88185a95ed492095429a97d33b8aadb0187e59ad42d1a7184f02b5c84fdd31f3d7227c65bd292ed0aa039b29522e59cf90a965
|
||||
Size (llvm-13.0.1.src.tar.xz) = 45479112 bytes
|
||||
SHA1 (patch-CMakeLists.txt) = c60afc86b44ae6c37840b3fea3533136aae2616d
|
||||
SHA1 (patch-cmake_config-ix.cmake) = 3b8b5295872ac1a5d90a8b4c78540d8ce1224bf0
|
||||
SHA1 (patch-cmake_modules_AddLLVM.cmake) = 41000d0660af1bfe6ccd15d0e0611b7cbbd456a4
|
||||
SHA1 (patch-cmake_modules_CMakeLists.txt) = 57462a55dfd2af82df51f62fc222a081cdb3e0db
|
||||
SHA1 (patch-cmake_modules_CheckAtomic.cmake) = cb2eda89ca2413728fc594ff01fa7a287b2a22b9
|
||||
SHA1 (patch-include_llvm-c_DataTypes.h) = 790c9458d6590a0d6985fdcbd8785da340b9779b
|
||||
SHA1 (patch-include_llvm_Analysis_ConstantFolding.h) = 56b9374da236c346565897977040255b9766cab8
|
||||
SHA1 (patch-tools_llvm-config_llvm-config.cpp) = 6d9e13036e2b1639fa67de995eb61520581f4fbd
|
||||
SHA1 (patch-tools_llvm-shlib_CMakeLists.txt) = 5892d83e4b8f1c30eefb9b8560fed43cb1a226e9
|
||||
SHA1 (patch-tools_llvm-config_llvm-config.cpp) = 12b0f7dd0d8caf635ca139abdde3ba49dc753cbe
|
||||
SHA1 (patch-tools_llvm-shlib_CMakeLists.txt) = 97b9c7c3487989c2909dd0294a67a5328d9ef309
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
# $NetBSD: hacks.mk,v 1.1 2020/09/15 16:16:29 he Exp $
|
||||
|
||||
.if !defined(LIBLLVM_HACKS_MK)
|
||||
LIBLLVM_HACKS_MK= defined
|
||||
|
||||
# [ Tue Sep 15 07:21:13 CEST 2020 : he ]
|
||||
# On NetBSD/powerpc, enable -mlongcall, to avoid relocation overflows
|
||||
.if ${MACHINE_ARCH} == "powerpc"
|
||||
CFLAGS+= -mlongcall
|
||||
CXXFLAGS+= -mlongcall
|
||||
.endif
|
||||
|
||||
.endif # LIBLLVM_HACKS_MK
|
|
@ -1,8 +1,8 @@
|
|||
# $NetBSD: options.mk,v 1.4 2019/01/26 21:17:20 tnn Exp $
|
||||
# $NetBSD: options.mk,v 1.5 2022/03/13 15:22:32 tnn Exp $
|
||||
|
||||
PKG_OPTIONS_VAR= PKG_OPTIONS.llvm
|
||||
PKG_OPTIONS_VAR= PKG_OPTIONS.libLLVM
|
||||
|
||||
LLVM_TARGETS= AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430 NVPTX PowerPC Sparc SystemZ X86 XCore
|
||||
LLVM_TARGETS= AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430 NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore
|
||||
|
||||
.for tgt in ${LLVM_TARGETS}
|
||||
PLIST_VARS+= ${tgt}
|
||||
|
@ -23,20 +23,22 @@ PKG_SUGGESTED_OPTIONS+= terminfo
|
|||
# Probably safe to assume that only x86 users are interested in
|
||||
# cross-compilation for now. This saves some build time for everyone else.
|
||||
.if !empty(MACHINE_ARCH:Msparc*)
|
||||
PKG_SUGGESTED_OPTIONS+= llvm-target-sparc
|
||||
PKG_SUGGESTED_OPTIONS+= llvm-target-sparc
|
||||
.elif !empty(MACHINE_ARCH:Mpowerpc*)
|
||||
PKG_SUGGESTED_OPTIONS+= llvm-target-powerpc
|
||||
PKG_SUGGESTED_OPTIONS+= llvm-target-powerpc
|
||||
.elif !empty(MACHINE_ARCH:Maarch64)
|
||||
PKG_SUGGESTED_OPTIONS+= llvm-target-aarch64
|
||||
.elif !empty(MACHINE_ARCH:Mearm*)
|
||||
PKG_SUGGESTED_OPTIONS+= llvm-target-arm
|
||||
PKG_SUGGESTED_OPTIONS+= llvm-target-arm
|
||||
.elif !empty(MACHINE_ARCH:M*mips*)
|
||||
PKG_SUGGESTED_OPTIONS+= llvm-target-mips
|
||||
PKG_SUGGESTED_OPTIONS+= llvm-target-mips
|
||||
.else
|
||||
# X86 and everyone else get all targets by default.
|
||||
. for tgt in ${LLVM_TARGETS}
|
||||
PKG_SUGGESTED_OPTIONS+= llvm-target-${tgt:tl}
|
||||
PKG_SUGGESTED_OPTIONS+= llvm-target-${tgt:tl}
|
||||
. endfor
|
||||
.endif
|
||||
PKG_SUGGESTED_OPTIONS+= llvm-target-amdgpu # for mesa/radeon
|
||||
PKG_SUGGESTED_OPTIONS+= llvm-target-amdgpu # for mesa/radeon
|
||||
|
||||
.include "../../mk/bsd.options.mk"
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
$NetBSD: patch-CMakeLists.txt,v 1.2 2019/01/26 21:17:20 tnn Exp $
|
||||
$NetBSD: patch-CMakeLists.txt,v 1.3 2022/03/13 15:22:32 tnn Exp $
|
||||
|
||||
Put headers in subdirectory to avoid conflict with clang.
|
||||
Don't implement sys/regset.h workaround, fix source instead.
|
||||
Don't build locstats.
|
||||
|
||||
--- CMakeLists.txt.orig 2018-11-02 17:47:32.000000000 +0000
|
||||
--- CMakeLists.txt.orig 2021-06-28 16:23:38.000000000 +0000
|
||||
+++ CMakeLists.txt
|
||||
@@ -830,7 +830,7 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "(Fre
|
||||
@@ -902,7 +902,7 @@ endif()
|
||||
|
||||
if( ${CMAKE_SYSTEM_NAME} MATCHES SunOS )
|
||||
# special hack for Solaris to handle crazy system sys/regset.h
|
||||
|
@ -14,7 +15,7 @@ Don't implement sys/regset.h workaround, fix source instead.
|
|||
endif( ${CMAKE_SYSTEM_NAME} MATCHES SunOS )
|
||||
|
||||
# Make sure we don't get -rdynamic in every binary. For those that need it,
|
||||
@@ -966,7 +966,7 @@ endif()
|
||||
@@ -1027,7 +1027,7 @@ endif()
|
||||
|
||||
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
||||
install(DIRECTORY include/llvm include/llvm-c
|
||||
|
@ -23,7 +24,7 @@ Don't implement sys/regset.h workaround, fix source instead.
|
|||
COMPONENT llvm-headers
|
||||
FILES_MATCHING
|
||||
PATTERN "*.def"
|
||||
@@ -978,7 +978,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
||||
@@ -1038,7 +1038,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
||||
)
|
||||
|
||||
install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm ${LLVM_INCLUDE_DIR}/llvm-c
|
||||
|
@ -32,3 +33,10 @@ Don't implement sys/regset.h workaround, fix source instead.
|
|||
COMPONENT llvm-headers
|
||||
FILES_MATCHING
|
||||
PATTERN "*.def"
|
||||
@@ -1125,5 +1125,5 @@ if (LLVM_INCLUDE_BENCHMARKS)
|
||||
endif()
|
||||
|
||||
if (LLVM_INCLUDE_UTILS AND LLVM_INCLUDE_TOOLS)
|
||||
- add_subdirectory(utils/llvm-locstats)
|
||||
+# add_subdirectory(utils/llvm-locstats)
|
||||
endif()
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
$NetBSD: patch-cmake_config-ix.cmake,v 1.2 2020/03/06 22:44:18 tnn Exp $
|
||||
$NetBSD: patch-cmake_config-ix.cmake,v 1.3 2022/03/13 15:22:32 tnn Exp $
|
||||
|
||||
Do not generate invalid llvm-config in pkgsrc.
|
||||
|
||||
--- cmake/config-ix.cmake.orig 2019-12-11 19:15:30.000000000 +0000
|
||||
--- cmake/config-ix.cmake.orig 2021-06-28 16:23:38.000000000 +0000
|
||||
+++ cmake/config-ix.cmake
|
||||
@@ -141,7 +141,7 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memor
|
||||
@@ -175,7 +175,7 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memor
|
||||
set(MAYBE_REQUIRED)
|
||||
endif()
|
||||
if(LLVM_ENABLE_TERMINFO)
|
||||
set(HAVE_TERMINFO 0)
|
||||
- foreach(library terminfo tinfo curses ncurses ncursesw)
|
||||
+ foreach(library terminfo curses ncurses ncursesw tinfo)
|
||||
string(TOUPPER ${library} library_suffix)
|
||||
check_library_exists(${library} setupterm "" HAVE_TERMINFO_${library_suffix})
|
||||
if(HAVE_TERMINFO_${library_suffix})
|
||||
- find_library(TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED})
|
||||
+ find_library(TERMINFO_LIB NAMES terminfo curses ncurses ncursesw tinfo ${MAYBE_REQUIRED})
|
||||
endif()
|
||||
if(TERMINFO_LIB)
|
||||
set(LLVM_ENABLE_TERMINFO 1)
|
||||
|
|
|
@ -1,37 +1,46 @@
|
|||
$NetBSD: patch-cmake_modules_AddLLVM.cmake,v 1.9 2020/03/06 22:44:18 tnn Exp $
|
||||
$NetBSD: patch-cmake_modules_AddLLVM.cmake,v 1.10 2022/03/13 15:22:32 tnn Exp $
|
||||
|
||||
Disable library install rules. Handled manually.
|
||||
Make sure llvm-config goes in libexec/libLLVM to avoid conflict.
|
||||
Don't use non-portable -z discard-unused on SunOS.
|
||||
Don't use relative @rpath in llvm-config on Darwin.
|
||||
|
||||
--- cmake/modules/AddLLVM.cmake.orig 2019-12-11 19:15:30.000000000 +0000
|
||||
--- cmake/modules/AddLLVM.cmake.orig 2021-09-24 16:18:10.000000000 +0000
|
||||
+++ cmake/modules/AddLLVM.cmake
|
||||
@@ -222,9 +222,6 @@ function(add_link_opts target_name)
|
||||
# ld64's implementation of -dead_strip breaks tools that use plugins.
|
||||
set_property(TARGET ${target_name} APPEND_STRING PROPERTY
|
||||
LINK_FLAGS " -Wl,-dead_strip")
|
||||
- elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
|
||||
- set_property(TARGET ${target_name} APPEND_STRING PROPERTY
|
||||
- LINK_FLAGS " -Wl,-z -Wl,discard-unused=sections")
|
||||
elseif(NOT WIN32 AND NOT LLVM_LINKER_IS_GOLD AND
|
||||
NOT ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD|AIX")
|
||||
# Object files are compiled with -ffunction-data-sections.
|
||||
@@ -695,12 +692,6 @@ macro(add_llvm_library name)
|
||||
set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True)
|
||||
@@ -616,10 +616,6 @@ function(llvm_add_library name)
|
||||
set(api_name ${output_name}-${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX})
|
||||
set_target_properties(${name} PROPERTIES OUTPUT_NAME ${library_name})
|
||||
if(UNIX)
|
||||
- llvm_install_library_symlink(${api_name} ${library_name} SHARED
|
||||
- COMPONENT ${name})
|
||||
- llvm_install_library_symlink(${output_name} ${library_name} SHARED
|
||||
- COMPONENT ${name})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@@ -820,11 +816,6 @@ macro(add_llvm_library name)
|
||||
endif()
|
||||
|
||||
get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella})
|
||||
- install(TARGETS ${name}
|
||||
- ${export_to_llvmexports}
|
||||
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
|
||||
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
|
||||
- RUNTIME DESTINATION bin COMPONENT ${name})
|
||||
-
|
||||
|
||||
if (NOT LLVM_ENABLE_IDE)
|
||||
add_llvm_install_targets(install-${name}
|
||||
DEPENDS ${name}
|
||||
@@ -907,7 +898,7 @@ macro(add_llvm_tool name)
|
||||
@@ -1033,7 +1024,7 @@ function(process_llvm_pass_plugins)
|
||||
|
||||
## Part 1: Extension header to be included whenever we need extension
|
||||
# processing.
|
||||
- set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm)
|
||||
+ set(LLVM_INSTALL_PACKAGE_DIR lib/libLLVM/cmake/llvm)
|
||||
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")
|
||||
file(WRITE
|
||||
"${llvm_cmake_builddir}/LLVMConfigExtensions.cmake"
|
||||
@@ -1234,7 +1225,7 @@ macro(add_llvm_tool name)
|
||||
get_target_export_arg(${name} LLVM export_to_llvmexports)
|
||||
install(TARGETS ${name}
|
||||
${export_to_llvmexports}
|
||||
- RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}
|
||||
|
@ -39,12 +48,12 @@ Don't use relative @rpath in llvm-config on Darwin.
|
|||
COMPONENT ${name})
|
||||
|
||||
if (NOT LLVM_ENABLE_IDE)
|
||||
@@ -1727,7 +1718,7 @@ function(llvm_setup_rpath name)
|
||||
@@ -2118,7 +2109,7 @@ function(llvm_setup_rpath name)
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
- set(_install_name_dir INSTALL_NAME_DIR "@rpath")
|
||||
+ set(_install_name_dir INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib/libLLVM")
|
||||
set(_install_rpath "@loader_path/../lib" ${extra_libdir})
|
||||
elseif(UNIX)
|
||||
set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
|
||||
set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX" AND BUILD_SHARED_LIBS)
|
||||
# $ORIGIN is not interpreted at link time by aix ld.
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
$NetBSD: patch-cmake_modules_CMakeLists.txt,v 1.3 2017/03/17 22:38:18 adam Exp $
|
||||
$NetBSD: patch-cmake_modules_CMakeLists.txt,v 1.4 2022/03/13 15:22:32 tnn Exp $
|
||||
|
||||
Make sure cmake rules go in own directory to avoid conflicts.
|
||||
|
||||
--- cmake/modules/CMakeLists.txt.orig 2016-11-08 05:02:18.000000000 +0000
|
||||
--- cmake/modules/CMakeLists.txt.orig 2021-09-24 16:18:10.000000000 +0000
|
||||
+++ cmake/modules/CMakeLists.txt
|
||||
@@ -1,4 +1,4 @@
|
||||
@@ -1,6 +1,6 @@
|
||||
include(LLVMDistributionSupport)
|
||||
|
||||
-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm)
|
||||
+set(LLVM_INSTALL_PACKAGE_DIR share/libLLVM/cmake)
|
||||
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")
|
||||
|
|
|
@ -1,38 +1,43 @@
|
|||
$NetBSD: patch-cmake_modules_CheckAtomic.cmake,v 1.1 2019/01/26 21:17:20 tnn Exp $
|
||||
$NetBSD: patch-cmake_modules_CheckAtomic.cmake,v 1.2 2022/03/13 15:22:32 tnn 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 2016-06-23 06:39:35.000000000 +0000
|
||||
--- cmake/modules/CheckAtomic.cmake.orig 2021-06-28 16:23:38.000000000 +0000
|
||||
+++ cmake/modules/CheckAtomic.cmake
|
||||
@@ -62,18 +62,18 @@ else()
|
||||
@@ -66,20 +66,21 @@ if(MSVC)
|
||||
set(HAVE_CXX_ATOMICS64_WITHOUT_LIB True)
|
||||
elseif(LLVM_COMPILER_IS_GCC_COMPATIBLE)
|
||||
# First check if atomics work without the library.
|
||||
- check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITHOUT_LIB)
|
||||
- # 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()
|
||||
+ set(HAVE_CXX_ATOMICS64_WITHOUT_LIB True)
|
||||
+# check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITHOUT_LIB)
|
||||
+# # 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()
|
||||
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 std::atomic!")
|
||||
- endif()
|
||||
- else()
|
||||
- message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.")
|
||||
- endif()
|
||||
-endif()
|
||||
+#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 std::atomic!")
|
||||
+# endif()
|
||||
+# else()
|
||||
+# message(FATAL_ERROR "Host compiler appears to require libatomic, 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
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
$NetBSD: patch-include_llvm-c_DataTypes.h,v 1.1 2019/01/26 21:17:20 tnn Exp $
|
||||
$NetBSD: patch-include_llvm-c_DataTypes.h,v 1.2 2022/03/13 15:22:32 tnn Exp $
|
||||
|
||||
Don't implement sys/regset.h workaround, fix source instead.
|
||||
|
||||
--- include/llvm-c/DataTypes.h.orig 2018-04-02 13:22:26.000000000 +0000
|
||||
--- include/llvm-c/DataTypes.h.orig 2021-04-06 16:38:18.000000000 +0000
|
||||
+++ include/llvm-c/DataTypes.h
|
||||
@@ -87,4 +87,27 @@ typedef signed int ssize_t;
|
||||
#define HUGE_VALF (float)HUGE_VAL
|
||||
@@ -77,4 +77,27 @@ typedef signed int ssize_t;
|
||||
# define UINT64_MAX 0xffffffffffffffffULL
|
||||
#endif
|
||||
|
||||
+#if defined(__sun)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
$NetBSD: patch-tools_llvm-config_llvm-config.cpp,v 1.6 2019/01/26 21:17:20 tnn Exp $
|
||||
$NetBSD: patch-tools_llvm-config_llvm-config.cpp,v 1.7 2022/03/13 15:22:32 tnn Exp $
|
||||
|
||||
Avoid conflict with lang/clang.
|
||||
Use -lLLVM-3.8 instead of -lLLVM-3.8.0 so we don't break unnecessarily
|
||||
on patch updates.
|
||||
|
||||
--- tools/llvm-config/llvm-config.cpp.orig 2018-06-23 16:50:09.000000000 +0000
|
||||
--- tools/llvm-config/llvm-config.cpp.orig 2021-06-28 16:23:38.000000000 +0000
|
||||
+++ tools/llvm-config/llvm-config.cpp
|
||||
@@ -333,11 +333,11 @@ int main(int argc, char **argv) {
|
||||
@@ -357,11 +357,11 @@ int main(int argc, char **argv) {
|
||||
("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
|
||||
} else {
|
||||
ActivePrefix = CurrentExecPrefix;
|
||||
|
@ -14,13 +14,13 @@ on patch updates.
|
|||
+ ActiveIncludeDir = "@PREFIX@/include/libLLVM";
|
||||
SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
|
||||
sys::fs::make_absolute(ActivePrefix, path);
|
||||
ActiveBinDir = path.str();
|
||||
ActiveBinDir = std::string(path.str());
|
||||
- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
|
||||
+ ActiveLibDir = "@PREFIX@/lib/libLLVM";
|
||||
ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
|
||||
ActiveIncludeOption = "-I" + ActiveIncludeDir;
|
||||
}
|
||||
@@ -373,14 +373,14 @@ int main(int argc, char **argv) {
|
||||
@@ -399,14 +399,14 @@ int main(int argc, char **argv) {
|
||||
StaticDir = ActiveLibDir;
|
||||
} else if (HostTriple.isOSDarwin()) {
|
||||
SharedExt = "dylib";
|
||||
|
@ -37,7 +37,7 @@ on patch updates.
|
|||
StaticExt = "a";
|
||||
StaticDir = SharedDir = ActiveLibDir;
|
||||
StaticPrefix = SharedPrefix = "lib";
|
||||
@@ -393,7 +393,7 @@ int main(int argc, char **argv) {
|
||||
@@ -419,7 +419,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
bool DyLibExists = false;
|
||||
const std::string DyLibName =
|
||||
|
@ -46,7 +46,7 @@ on patch updates.
|
|||
|
||||
// If LLVM_LINK_DYLIB is ON, the single shared library will be returned
|
||||
// for "--libs", etc, if they exist. This behaviour can be overridden with
|
||||
@@ -494,7 +494,7 @@ int main(int argc, char **argv) {
|
||||
@@ -520,7 +520,7 @@ int main(int argc, char **argv) {
|
||||
OS << ActiveIncludeOption << ' ' << LLVM_CXXFLAGS << '\n';
|
||||
} else if (Arg == "--ldflags") {
|
||||
OS << ((HostTriple.isWindowsMSVCEnvironment()) ? "-LIBPATH:" : "-L")
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
$NetBSD: patch-tools_llvm-shlib_CMakeLists.txt,v 1.7 2020/03/06 22:44:18 tnn Exp $
|
||||
$NetBSD: patch-tools_llvm-shlib_CMakeLists.txt,v 1.8 2022/03/13 15:22:32 tnn Exp $
|
||||
|
||||
Use the Linux style linking everywhere except Darwin and SunOS.
|
||||
|
||||
--- tools/llvm-shlib/CMakeLists.txt.orig 2019-12-11 19:15:30.000000000 +0000
|
||||
--- tools/llvm-shlib/CMakeLists.txt.orig 2021-09-24 16:18:10.000000000 +0000
|
||||
+++ tools/llvm-shlib/CMakeLists.txt
|
||||
@@ -45,13 +45,11 @@ if(LLVM_BUILD_LLVM_DYLIB)
|
||||
@@ -33,13 +33,11 @@ if(LLVM_BUILD_LLVM_DYLIB)
|
||||
add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${INSTALL_WITH_TOOLCHAIN} ${SOURCES})
|
||||
|
||||
list(REMOVE_DUPLICATES LIB_NAMES)
|
||||
|
@ -15,17 +15,17 @@ Use the Linux style linking everywhere except Darwin and SunOS.
|
|||
- OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
|
||||
- OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")
|
||||
- OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")) # FIXME: It should be "GNU ld for elf"
|
||||
+ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
|
||||
+ set(LIB_NAMES -Wl,-all_load ${LIB_NAMES})
|
||||
+ elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
|
||||
+ if("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
|
||||
+ set(LIB_NAMES -Wl,-Bsymbolic -Wl,-z -Wl,allextract ${LIB_NAMES} -Wl,-z -Wl,defaultextract)
|
||||
+ elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
|
||||
+ set(LIB_NAMES -Wl,-all_load ${LIB_NAMES})
|
||||
+ else()
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/simple_version_script.map.in
|
||||
${LLVM_LIBRARY_DIR}/tools/llvm-shlib/simple_version_script.map)
|
||||
@@ -62,8 +60,6 @@ if(LLVM_BUILD_LLVM_DYLIB)
|
||||
# Solaris ld does not accept global: *; so there is no way to version *all* global symbols
|
||||
set(LIB_NAMES -Wl,--version-script,${LLVM_LIBRARY_DIR}/tools/llvm-shlib/simple_version_script.map ${LIB_NAMES})
|
||||
@@ -57,8 +55,6 @@ if(LLVM_BUILD_LLVM_DYLIB)
|
||||
# inside and outside libLLVM.so.
|
||||
target_link_options(LLVM PRIVATE LINKER:-Bsymbolic-functions)
|
||||
endif()
|
||||
- elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
|
||||
- set(LIB_NAMES -Wl,-all_load ${LIB_NAMES})
|
||||
|
|
Loading…
Reference in a new issue