Skip to content

Commit 433a88c

Browse files
committed
Static libc++ will break clang
1 parent 33acf50 commit 433a88c

File tree

3 files changed

+8
-38
lines changed

3 files changed

+8
-38
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ jobs:
6666

6767
- name: Build toolchain
6868
run: |
69-
rm -f /ucrt64/lib/libzstd.dll.a
7069
cp -r $GITHUB_WORKSPACE /c/ondk
7170
cd /c/ondk
7271
bash build-windows.sh

build-windows.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@ clean_storage() {
2626
'/c/Program Files/PostgreSQL' '/c/Program Files/dotnet' \
2727
"$JAVA_HOME_8_X64" "$JAVA_HOME_11_X64" "$JAVA_HOME_17_X64" \
2828
"$GOROOT_1_15_X64" "$GOROOT_1_16_X64" "$GOROOT_1_17_X64" "$GOROOT_1_18_X64"
29+
30+
# Remove libzstd.dll.a to make sure zstd is statically linked
31+
rm -f /ucrt64/lib/libzstd.dll.a
2932
}
3033

3134
build() {
3235
set_llvm_cfg LLVM_USE_SYMLINKS TRUE
3336
# BUG: llvm.use-libcxx will not actually set LLVM_ENABLE_LIBCXX
3437
set_llvm_cfg LLVM_ENABLE_LIBCXX TRUE
35-
# BUG: libstdc++ is incompatible when LTO is enabled, force use libc++
38+
# MinGW libstdc++ is incompatible with clang when LTO is enabled, we have to use libc++
3639
set_build_cfg llvm.use-libcxx true
37-
set_build_cfg llvm.static-libstdcpp true
3840
set_build_cfg rust.use-lld self-contained
3941
set_build_cfg dist.include-mingw-linker true
4042

@@ -45,7 +47,11 @@ build() {
4547

4648
collect() {
4749
cd out
50+
51+
# Remove unused files
4852
find . -name '*.old' -delete
53+
rm -rf lib/rustlib/$TRIPLE/bin/*
54+
4955
cp -af ../rust/build/$TRIPLE/llvm/bin llvm-bin || true
5056
cp -an ../rust/build/$TRIPLE/llvm/bin/. llvm-bin/.
5157
cp -af ../rust/build/tmp/dist/lib/rustlib/. lib/rustlib/.

patches/static_link_libcxx.patch

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)