Skip to content

Commit

Permalink
Custom llvm for lifting bits (#1038)
Browse files Browse the repository at this point in the history
  • Loading branch information
2over12 authored Nov 30, 2023
1 parent eec61cc commit bf2255c
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/vcpkg_ci_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ jobs:
- { os: 'ubuntu', name: 'ubuntu-v2', tag: '22.04' }
llvm: [
'llvm-16',
'llvm-17'
'llvm-17',
'llvm-17[liftingbits-llvm]'
]
target_arch: [ 'x64', 'arm64' ]

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/vcpkg_ci_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ jobs:
- { runner: 'macos-13', xcode: '15.0' }
llvm: [
'llvm-16',
'llvm-17'
'llvm-17',
'llvm-17[liftingbits-llvm]'
]
target_arch: [ 'x64', 'arm64' ]

Expand Down
46 changes: 32 additions & 14 deletions ports/llvm-17/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO llvm/llvm-project
REF llvmorg-${VERSION}
SHA512 df68879cb3f23489e19bbec4aac1898d213e837132072f8bbc1a49eb561c8cc7ccdb6ae9202b68b0915c84c8f2b41e536ab690697eb8ab8c9f44d5ae600b575b
HEAD_REF release/17.x
PATCHES
0001-Fix-install-paths.patch
0006-Fix-libffi.patch
0020-fix-FindZ3.cmake.patch
0021-fix-find_dependency.patch
0026-fix-prefix-path-calc.patch
0029-Do-not-attempt-macro-expansion-on-invalid-sourceloc.patch
)

if("liftingbits-llvm" IN_LIST FEATURES)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO trail-of-forks/llvm-project
REF b779442fffcf46f2dfc104217e1413d7d5b538d6
SHA512 700ddc8c4b39b260a2041385128ef2bbe3bf6c0ff45d933d3d50d15f737892e2c7e817a4a11cda606b91364b99b10c884b76e040b321696effac7ce172720552
HEAD_REF main
PATCHES
0001-Fix-install-paths.patch
0006-Fix-libffi.patch
0020-fix-FindZ3.cmake.patch
0021-fix-find_dependency.patch
0026-fix-prefix-path-calc.patch
0029-Do-not-attempt-macro-expansion-on-invalid-sourceloc.patch
)
else()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO llvm/llvm-project
REF llvmorg-${VERSION}
SHA512 df68879cb3f23489e19bbec4aac1898d213e837132072f8bbc1a49eb561c8cc7ccdb6ae9202b68b0915c84c8f2b41e536ab690697eb8ab8c9f44d5ae600b575b
HEAD_REF release/17.x
PATCHES
0001-Fix-install-paths.patch
0006-Fix-libffi.patch
0020-fix-FindZ3.cmake.patch
0021-fix-find_dependency.patch
0026-fix-prefix-path-calc.patch
0029-Do-not-attempt-macro-expansion-on-invalid-sourceloc.patch
)
endif()

string(REPLACE "." ";" VERSION_LIST ${VERSION})
list(GET VERSION_LIST 0 LLVM_VERSION_MAJOR)
Expand Down
15 changes: 14 additions & 1 deletion ports/llvm-17/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@
"utils"
],
"features": {
"liftingbits-llvm": {
"description": "Custom llvm source tree that allows for custom calling convention registration. These custom calling conventions allow for specifying binary level compatibility.",
"dependencies": [
{
"name": "llvm-17",
"default-features": false,
"features": [
"libunwind",
"enable-rtti"
]
}
]
},
"bolt": {
"description": "BOLT is a post-link optimizer developed to speed up large applications.",
"dependencies": [
Expand Down Expand Up @@ -439,4 +452,4 @@
"description": "Build LLVM utils."
}
}
}
}

0 comments on commit bf2255c

Please sign in to comment.