22
22
- job_name : Linux x86_64 multilib
23
23
os : ubuntu-20.04
24
24
arch : x86_64
25
- bootstrap_cmake_flags : -DBUILD_LTO_LIBS=ON
26
25
# To improve portability of the generated binaries, link the C++ standard library statically.
27
26
extra_cmake_flags : >-
28
27
-DMULTILIB=ON
29
- -DBUILD_LTO_LIBS=ON
30
28
-DCMAKE_C_COMPILER=clang
31
29
-DCMAKE_CXX_COMPILER=clang++
32
30
-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++
39
37
os : ubuntu-22.04-arm # Ubuntu 20 not natively supported
40
38
container_image : ubuntu:20.04
41
39
arch : aarch64
42
- bootstrap_cmake_flags : >-
43
- -DBUILD_LTO_LIBS=ON
40
+ base_cmake_flags : >-
44
41
-DCOMPILER_RT_LIBDIR_OS=aarch64-unknown-linux-gnu
45
42
extra_cmake_flags : >-
46
- -DBUILD_LTO_LIBS=ON
47
- -DCOMPILER_RT_LIBDIR_OS=aarch64-unknown-linux-gnu
48
43
-DCMAKE_C_COMPILER=clang
49
44
-DCMAKE_CXX_COMPILER=clang++
50
45
-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++
@@ -55,30 +50,29 @@ jobs:
55
50
56
51
- job_name : Alpine musl x86_64
57
52
os : ubuntu-latest
58
- container_image : alpine:3.20
53
+ container_image : alpine:3.21
59
54
arch : x86_64
60
- bootstrap_cmake_flags : -DBUILD_LTO_LIBS=ON
61
- # TSan and XRay do not work.
62
- extra_cmake_flags : >-
63
- -DBUILD_LTO_LIBS=ON
55
+ base_cmake_flags : >-
56
+ -DCOMPILER_RT_LIBDIR_OS=linux
57
+ -DLDC_INSTALL_LLVM_RUNTIME_LIBS_ARCH=x86_64
64
58
-DLLVM_IS_SHARED=OFF
65
59
-DLDC_ENABLE_PLUGINS=OFF
66
60
-DLDC_DYNAMIC_COMPILE=OFF
67
- -DLDC_INSTALL_LTOPLUGIN=OFF
68
- -DCOMPILER_RT_LIBDIR_OS=linux
69
- -DLDC_INSTALL_LLVM_RUNTIME_LIBS_ARCH=x86_64
61
+ # TSan and XRay do not work.
62
+ extra_cmake_flags : >-
70
63
-DTEST_COMPILER_RT_LIBRARIES="profile;lsan;asan;msan;fuzzer"
71
- -DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++
64
+ -DLDC_INSTALL_LTOPLUGIN=OFF
72
65
-DLDC_FULLY_STATIC=ON
73
- -DD_COMPILER_FLAGS="-O -flto=full"
74
- # FIXME: -defaultlib=phobos2-ldc-lto,druntime-ldc-lto
75
- with_pgo : false
66
+ -DCMAKE_C_COMPILER=clang
67
+ -DCMAKE_CXX_COMPILER=clang++
68
+ -DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++
69
+ -DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto"
70
+ -DEXTRA_CXXFLAGS=-flto=full
71
+ with_pgo : true
76
72
77
73
- job_name : macOS x86_64
78
74
os : macos-13
79
75
arch : x86_64
80
- bootstrap_cmake_flags : >-
81
- -DBUILD_LTO_LIBS=ON
82
76
# https://github.com/ldc-developers/ldc/issues/4462:
83
77
# When using LTO, we need to explicitly export ~all symbols for plugin support via `ld64 -exported_symbol '__*'`.
84
78
# Additionally `-w` to suppress resulting linker warnings.
@@ -87,39 +81,31 @@ jobs:
87
81
# * Specify a macOS triple with OS version. And exclude LTO-able host druntime/Phobos because precompiled without OS version.
88
82
# * Manually specify the path to the bundled libLTO.dylib (broken for *universal* packages for LDC <= v1.40.0).
89
83
extra_cmake_flags : >-
90
- -DBUILD_LTO_LIBS=ON
91
84
-DD_COMPILER_FLAGS="-O -flto=full -L-exported_symbol '-L__*' -L-w -flto-binary=$PWD/../bootstrap-ldc/lib-x86_64/libLTO.dylib -mtriple=x86_64-apple-macos$MACOSX_DEPLOYMENT_TARGET"
92
85
-DEXTRA_CXXFLAGS=-flto=full
93
86
with_pgo : true
94
87
95
88
- job_name : macOS arm64
96
89
os : macos-15
97
90
arch : arm64
98
- bootstrap_cmake_flags : >-
99
- -DBUILD_LTO_LIBS=ON
100
91
extra_cmake_flags : >-
101
- -DBUILD_LTO_LIBS=ON
102
92
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w -flto-binary=$PWD/../bootstrap-ldc/lib-arm64/libLTO.dylib"
103
93
-DEXTRA_CXXFLAGS=-flto=full
104
94
with_pgo : true
105
95
106
96
- job_name : Windows x64
107
97
os : windows-2022
108
98
arch : x64
109
- bootstrap_cmake_flags : -DBUILD_LTO_LIBS=ON
110
99
extra_cmake_flags : >-
111
- -DBUILD_LTO_LIBS=ON
112
100
"-DD_COMPILER_FLAGS=-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto"
113
101
-DEXTRA_CXXFLAGS=-flto=full
114
102
with_pgo : true
115
103
116
104
- job_name : Windows x86
117
105
os : windows-2022
118
106
arch : x86
119
- bootstrap_cmake_flags : -DBUILD_LTO_LIBS=ON
120
107
# `RT_CFLAGS=-m32` needed to make 64-bit clang-cl output 32-bit code for druntime integration tests
121
108
extra_cmake_flags : >-
122
- -DBUILD_LTO_LIBS=ON
123
109
-DRT_CFLAGS=-m32
124
110
# Undefined symbol errors with FullLTO; ThinLTO used to work, but apparently miscompiles a lexer.d:138 assertion since v1.33.
125
111
# "-DD_COMPILER_FLAGS=-O -flto=thin -defaultlib=phobos2-ldc-lto,druntime-ldc-lto"
@@ -144,13 +130,15 @@ jobs:
144
130
else
145
131
# set up Alpine container
146
132
apk add \
147
- git cmake ninja-is-really-ninja g++ ldc llvm-dev llvm-static compiler-rt \
133
+ git cmake ninja-is-really-ninja g++ clang ldc lld llvm-dev llvm-static compiler-rt \
148
134
libxml2-static zstd-static zlib-static \
149
135
bash grep diffutils make curl 7zip perl
150
136
# create missing 7za symlink
151
137
ln -s 7z /usr/bin/7za
138
+ # make lld the default linker (note: /usr/bin/ld seems unused)
139
+ ln -sf /usr/bin/ld.lld /usr/x86_64-alpine-linux-musl/bin/ld
152
140
# create ../llvm symlink to distro LLVM (no prebuilt LDC-LLVM for musl)
153
- ln -s /usr/lib/llvm17 $(dirname $(pwd))/llvm
141
+ ln -s /usr/lib/llvm19 $(dirname $(pwd))/llvm
154
142
../llvm/bin/llvm-config --version
155
143
fi
156
144
- uses : actions/checkout@v4
@@ -168,7 +156,7 @@ jobs:
168
156
if : runner.os != 'macOS'
169
157
uses : ./.github/actions/2-build-bootstrap
170
158
with :
171
- cmake_flags : ${{ matrix.bootstrap_cmake_flags }}
159
+ cmake_flags : -DBUILD_LTO_LIBS=ON ${{ matrix.base_cmake_flags }}
172
160
arch : ${{ matrix.arch }}
173
161
# FIXME: on macOS, mixing newer LLVM from bootstrap LDC with older LLVM from Xcode clang is problematic,
174
162
# leading to sporadic 'libc++abi: Pure virtual function called!' compiler crashes etc.
@@ -184,12 +172,12 @@ jobs:
184
172
if : matrix.with_pgo
185
173
uses : ./.github/actions/2a-build-pgo
186
174
with :
187
- cmake_flags : ${{ matrix.bootstrap_cmake_flags }}
175
+ cmake_flags : ${{ matrix.base_cmake_flags }}
188
176
arch : ${{ matrix.arch }}
189
177
- name : Build LDC & LDC D unittests & defaultlib unittest runners
190
178
uses : ./.github/actions/3-build-native
191
179
with :
192
- cmake_flags : ${{ matrix.extra_cmake_flags }}
180
+ cmake_flags : -DBUILD_LTO_LIBS=ON ${{ matrix.base_cmake_flags }} ${{ matrix.extra_cmake_flags }}
193
181
arch : ${{ matrix.arch }}
194
182
with_pgo : ${{ matrix.with_pgo }}
195
183
@@ -280,13 +268,9 @@ jobs:
280
268
arch : x86_64
281
269
- name : Build bootstrap LDC
282
270
uses : ./.github/actions/2-build-bootstrap
283
- with :
284
- cmake_flags : ${{ matrix.bootstrap_cmake_flags }}
285
271
- name : Build LDC with PGO instrumentation & gather profile from compiling default libs
286
272
if : matrix.with_pgo
287
273
uses : ./.github/actions/2a-build-pgo
288
- with :
289
- cmake_flags : ${{ matrix.bootstrap_cmake_flags }}
290
274
- name : Cross-compile LDC to ${{ matrix.os }}-${{ matrix.arch }}
291
275
uses : ./.github/actions/3-build-cross
292
276
with :
0 commit comments