Skip to content

Commit 40e599f

Browse files
authored
Bump to LLVM 18.1.7 (#29)
Changes: https://discourse.llvm.org/t/18-1-7-released/79433 The LLVM release doesn't contain any changes that affect us directly, we're updating the version just to track the latest release. However, taking this opportunity to add `llvm-objcopy` to the set of tools - it will be used at some point to separate debugging information from the shared libraries we build at application build time.
1 parent 97b574b commit 40e599f

File tree

10 files changed

+34
-8
lines changed

10 files changed

+34
-8
lines changed

.gdn/.gdnsuppress

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@
5656
],
5757
"justification": "Unable to resolve BA2007 identified in external LLVM CMake configuration.",
5858
"createdDate": "2024-02-15 00:04:36Z"
59+
},
60+
"02dc21533e1f4f27353d0c34284a2ebf6d7357c7f7d0f9879fed4993728069e3": {
61+
"signature": "02dc21533e1f4f27353d0c34284a2ebf6d7357c7f7d0f9879fed4993728069e3",
62+
"alternativeSignatures": [
63+
"6b50835be7f05c09d9c68d8cc7e3a0e3316c84e040b919b2ab7dbc4e228323fe"
64+
],
65+
"memberOf": [
66+
"default"
67+
],
68+
"justification": "Unable to resolve BA2007 identified in external LLVM CMake configuration.",
69+
"createdDate": "2024-06-11 17:44:37Z"
5970
}
6071
}
6172
}

build-common.cmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@ set HOST_ARTIFACTS_DIR=%ARTIFACTS_DIR%\%HOST%
66
set HOST_ARTIFACTS_BIN_DIR=%HOST_ARTIFACTS_DIR%\bin
77
set CMAKE_VS_GENERATOR=Visual Studio 17 2022
88
set MSVC_RUNTIME_LIBRARY="MultiThreaded"
9+
set CXXFLAGS=/Qspectre /sdl /guard:cf
10+
set CFLAGS=/Qspectre /sdl /guard:cf
911

1012
mkdir %HOST_ARTIFACTS_BIN_DIR%

build-llvm.cmd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ set SOURCE_DIR=%MY_DIR%external\llvm\llvm
44

55
set PROJECTS=lld
66
set TARGETS=X86;ARM;AArch64
7-
set BINARIES=llvm-mc.exe llvm-strip.exe lld.exe llc.exe
7+
set BINARIES=llvm-mc.exe llvm-objcopy.exe llvm-strip.exe lld.exe llc.exe
88
set PDBS=llvm-mc.pdb llvm-objcopy.pdb llvm-strip.pdb lld.pdb llc.pdb
99

1010
set HOST_BUILD_DIR=%BUILD_DIR%\%HOST%\llvm
1111
set HOST_BIN_DIR=%HOST_BUILD_DIR%\Release\bin
1212

1313
set LLVM_VERSION_FILE=%HOST_ARTIFACTS_DIR%\llvm-version.txt
14-
set CXXFLAGS="/Qspectre /sdl /guard:cf"
1514

1615
if exist %HOST_BUILD_DIR% (rmdir /S /Q %HOST_BUILD_DIR%)
1716
mkdir %HOST_BUILD_DIR%
@@ -44,6 +43,8 @@ cmake -G "%CMAKE_VS_GENERATOR%" -A x64 ^
4443
-DLLVM_ENABLE_TERMINFO=OFF ^
4544
-DLLVM_ENABLE_THREADS=OFF ^
4645
-DLLVM_ENABLE_ZLIB=OFF ^
46+
-DLLVM_ENABLE_ZSTD=OFF ^
47+
-DLLVM_USE_STATIC_ZSTD=ON ^
4748
-DLLVM_INCLUDE_BENCHMARKS=OFF ^
4849
-DLLVM_INCLUDE_EXAMPLES=OFF ^
4950
-DLLVM_INCLUDE_TESTS=OFF ^
@@ -68,7 +69,7 @@ IF %ERRORLEVEL% GEQ 1 EXIT /B 4
6869
msbuild /p:Configuration=Release /m tools\llc\llc.vcxproj
6970
IF %ERRORLEVEL% GEQ 1 EXIT /B 5
7071

71-
move %HOST_BIN_DIR%\llvm-objcopy.exe %HOST_BIN_DIR%\llvm-strip.exe
72+
copy %HOST_BIN_DIR%\llvm-objcopy.exe %HOST_BIN_DIR%\llvm-strip.exe
7273
IF %ERRORLEVEL% GEQ 1 EXIT /B 6
7374

7475
copy %HOST_BIN_DIR%\llvm-objcopy.pdb %HOST_BIN_DIR%\llvm-strip.pdb

build-llvm.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ function configure()
4646
-DLLVM_ENABLE_THREADS=OFF \
4747
-DLLVM_ENABLE_ZLIB=OFF \
4848
-DLLVM_ENABLE_ZSTD=OFF \
49+
-DLLVM_USE_STATIC_ZSTD=ON \
4950
-DLLVM_INCLUDE_BENCHMARKS=OFF \
5051
-DLLVM_INCLUDE_EXAMPLES=OFF \
5152
-DLLVM_INCLUDE_TESTS=OFF \
@@ -96,7 +97,7 @@ function build()
9697
ninja -j${JOBS} lld
9798
ninja -j${JOBS} llc
9899

99-
mv "${HOST_BIN_DIR}/llvm-objcopy" "${HOST_BIN_DIR}/llvm-strip"
100+
cp -P -a "${HOST_BIN_DIR}/llvm-objcopy" "${HOST_BIN_DIR}/llvm-strip"
100101
grep 'CMAKE_PROJECT_VERSION:' "${MY_BUILD_DIR}/CMakeCache.txt" | cut -d '=' -f 2 > "${LLVM_VERSION_FILE}"
101102

102103
for b in ${LLVM_BINARIES}; do

build-tools/automation/azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ extends:
113113
lsb-release patchutils diffstat xz-utils python3-dev libedit-dev libncurses5-dev swig
114114
python3-six python3-sphinx binutils-dev libxml2-dev libjsoncpp-dev pkg-config lcov
115115
procps help2man zlib1g-dev g++-multilib libjs-mathjax python3-recommonmark libpfm4-dev
116-
python3-setuptools libz3-dev ccache
116+
python3-setuptools libz3-dev ccache libzstd-dev
117117
displayName: Install LLVM build dependencies
118118
119119
- script: sudo apt-get -f -u install mingw-w64 libz-mingw-w64-dev
@@ -169,7 +169,7 @@ extends:
169169
export HOMEBREW_NO_INSTALL_UPGRADE=1 && brew install cmake ninja ccache
170170
displayName: Install LLVM build dependencies
171171
172-
- script: export HOMEBREW_NO_INSTALL_UPGRADE=1 && brew install make xz
172+
- script: export HOMEBREW_NO_INSTALL_UPGRADE=1 && brew install make xz zstd
173173
displayName: Install Xamarin.Android Utilities build dependencies
174174

175175
- script: bash ./build-llvm.sh

common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ ARTIFACTS_DIR="${MY_DIR}/artifacts"
7070
HOST_ARTIFACTS_DIR="${ARTIFACTS_DIR}/${HOST}"
7171
HOST_ARTIFACTS_BIN_DIR="${HOST_ARTIFACTS_DIR}/bin"
7272
HOST_ARTIFACTS_LIB_DIR="${HOST_ARTIFACTS_DIR}/lib"
73-
LLVM_BINARIES="llvm-mc llvm-strip lld llc"
73+
LLVM_BINARIES="llvm-mc llvm-objcopy llvm-strip lld llc"
7474
LLVM_PREFIXED_BINARIES="$(make_prefixed_binaries strip) $(make_prefixed_binaries ld)"
7575
XA_UTILS_BINARIES="as"
7676
XA_UTILS_PREFIXED_BINARIES="$(make_prefixed_binaries as)"

package.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@ function prepare()
6565

6666
cp -P -a "${artifacts_source_bin}/llvm-objcopy.pdb" "${artifacts_dest_bin}/llvm-objcopy.pdb"
6767
cp -P -a "${artifacts_source_bin}/lld.pdb" "${artifacts_dest_bin}/lld.pdb"
68+
make_windows_wrapper_scripts "scripts/llvm-objcopy.cmd.in" "${artifacts_source_bin}" "objcopy"
6869
make_windows_wrapper_scripts "scripts/llvm-strip.cmd.in" "${artifacts_source_bin}" "strip"
6970
make_windows_wrapper_scripts "scripts/gas.cmd.in" "${artifacts_source_bin}" "as"
7071
make_windows_wrapper_scripts "scripts/ld.cmd.in" "${artifacts_source_bin}" "ld"
7172
else
73+
make_unix_wrapper_scripts "scripts/llvm-objcopy.sh" "${artifacts_source_bin}" "objcopy"
7274
make_unix_wrapper_scripts "scripts/llvm-strip.sh" "${artifacts_source_bin}" "strip"
7375
make_unix_wrapper_scripts "scripts/gas.sh" "${artifacts_source_bin}" "as"
7476
make_unix_wrapper_scripts "scripts/ld.sh" "${artifacts_source_bin}" "ld"

scripts/llvm-objcopy.cmd.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@echo off
2+
setlocal
3+
set BINARIES_DIRECTORY=%~dp0
4+
5+
set "BINARIES_DIRECTORY=" && "%BINARIES_DIRECTORY%llvm-objcopy.exe" %*
6+
if not ERRORLEVEL 0 exit /b %errorlevel%

scripts/llvm-objcopy.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash -e
2+
MY_DIR="$(cd $(dirname $0);pwd)"
3+
exec "${MY_DIR}"/llvm-objcopy "$@"

0 commit comments

Comments
 (0)