Skip to content
Merged
40 changes: 36 additions & 4 deletions ports/llvm/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
set(LLVM_VERSION "14.0.3")
set(LLVM_VERSION "14.0.4")

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO llvm/llvm-project
REF llvmorg-${LLVM_VERSION}
SHA512 511e93fd9b1c414c38fe9e2649679ac0b16cb04f7f7838569d187b04c542a185e364d6db73e96465026e3b2533649eb75ac95507d12514af32b28bdfb66f2646
HEAD_REF master
SHA512 e14e6c3a1915a96e9ddc609f16ca3a398ca6f7fd0a691dadaa24490078a661340e845cb2d18f3679de4f47300bb822c33ae69548af6a0370d55737831a28b959
HEAD_REF main
PATCHES
0002-fix-install-paths.patch # This patch fixes paths in ClangConfig.cmake, LLVMConfig.cmake, LLDConfig.cmake etc.
0004-fix-dr-1734.patch
Expand Down Expand Up @@ -180,6 +180,7 @@ if("libunwind" IN_LIST FEATURES)
list(APPEND LLVM_ENABLE_RUNTIMES "libunwind")
endif()

# this is for normal targets
set(known_llvm_targets
AArch64
AMDGPU
Expand Down Expand Up @@ -209,10 +210,40 @@ foreach(llvm_target IN LISTS known_llvm_targets)
endif()
endforeach()

# this is for experimental targets
set(known_llvm_experamental_targets
Comment thread
pheonixfirewingz marked this conversation as resolved.
Outdated
SPRIV
)

set(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD "")
foreach(llvm_target IN LISTS known_llvm_experamental_targets)
Comment thread
pheonixfirewingz marked this conversation as resolved.
Outdated
string(TOLOWER "target-${llvm_target}" feature_name)
if(feature_name IN_LIST FEATURES)
list(APPEND LLVM_EXPERIMENTAL_TARGETS_TO_BUILD "${llvm_target}")
endif()
endforeach()

vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_DIR ${PYTHON3} DIRECTORY)
vcpkg_add_to_path(${PYTHON3_DIR})

cmake_host_system_information(RESULT MEMORY QUERY AVAILABLE_VIRTUAL_MEMORY)
Comment thread
pheonixfirewingz marked this conversation as resolved.
Outdated
set(LLVM_LINK_JOBS 1)

#this is calculated in mib to gb
Comment thread
pheonixfirewingz marked this conversation as resolved.
Outdated
if("6675.72" GREATER_EQUAL MEMORY)
set(LLVM_LINK_JOBS 2)
endif()
if("14305.11" GREATER_EQUAL MEMORY)
set(LLVM_LINK_JOBS 3)
endif()
if("29563.9" GREATER_EQUAL MEMORY)
set(LLVM_LINK_JOBS 4)
endif()
if("60081.48" GREATER_EQUAL MEMORY)
set(LLVM_LINK_JOBS 5)
endif()
Comment thread
pheonixfirewingz marked this conversation as resolved.
Outdated

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}/llvm
OPTIONS
Expand All @@ -228,9 +259,10 @@ vcpkg_cmake_configure(
"-DLLVM_ENABLE_PROJECTS=${LLVM_ENABLE_PROJECTS}"
"-DLLVM_ENABLE_RUNTIMES=${LLVM_ENABLE_RUNTIMES}"
"-DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS_TO_BUILD}"
"-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}"
-DPACKAGE_VERSION=${LLVM_VERSION}
# Limit the maximum number of concurrent link jobs to 1. This should fix low amount of memory issue for link.
-DLLVM_PARALLEL_LINK_JOBS=1
"-DLLVM_PARALLEL_LINK_JOBS=${LLVM_LINK_JOBS}"
-DLLVM_TOOLS_INSTALL_DIR=tools/llvm
)

Expand Down
15 changes: 13 additions & 2 deletions ports/llvm/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "llvm",
"version": "14.0.3",
"port-version": 1,
"version": "14.0.4",
"description": "The LLVM Compiler Infrastructure.",
"homepage": "https://llvm.org",
"license": "Apache-2.0",
Expand Down Expand Up @@ -87,6 +86,14 @@
],
"platform": "arm64"
},
{
"name": "llvm",
"default-features": false,
"features": [
"target-spirv"
],
"platform": "spirv"
},
{
"name": "llvm",
"default-features": false,
Expand Down Expand Up @@ -289,6 +296,7 @@
"target-powerpc",
"target-riscv",
"target-sparc",
"target-spirv",
"target-systemz",
"target-ve",
"target-webassembly",
Expand Down Expand Up @@ -334,6 +342,9 @@
"target-sparc": {
"description": "Build with Sparc backend."
},
"target-spirv": {
"description": "Build with Spriv backend."
},
"target-systemz": {
"description": "Build with SystemZ backend."
},
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4281,8 +4281,8 @@
"port-version": 2
},
"llvm": {
"baseline": "14.0.3",
"port-version": 1
"baseline": "14.0.4",
"port-version": 0
},
"lmdb": {
"baseline": "0.9.29",
Expand Down
9 changes: 7 additions & 2 deletions versions/l-/llvm.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"versions": [
{
"git-tree": "741b89d3872cb0152d5c295ce075b8d751381f51",
"git-tree": "168e933724c14f0494dd4cb1a44884bfd1b03447",
"version": "14.0.4",
"port-version": 0
},
{
"git-tree": "fe9a228e3ded582f205104bb804ad065c26c082b",
Comment thread
BillyONeal marked this conversation as resolved.
Outdated
"version": "14.0.3",
"port-version": 1
},
Expand Down Expand Up @@ -211,4 +216,4 @@
"port-version": 0
}
]
}
}
Comment thread
pheonixfirewingz marked this conversation as resolved.
Outdated
Comment thread
BillyONeal marked this conversation as resolved.
Outdated