42
42
latest-factors : |
43
43
msvc Optimized-Debug
44
44
gcc UBSan Coverage
45
- clang UBSan ASan
45
+ clang UBSan ASan MSan
46
46
apple-clang UBSan ASan
47
47
factors : ' '
48
48
runs-on : |
66
66
clang: git build-essential pkg-config python3 curl openjdk-11-jdk pkg-config libncurses-dev libxml2-utils libxml2-dev g++-14=14.2.0-4ubuntu2~24.04
67
67
msvc: ''
68
68
extra-values : |
69
+ use-libcxx: {{#if (and (or (ieq compiler 'clang') (ieq compiler 'apple-clang')) (or ubsan asan msan)) }}true{{else}}false{{/if}}
70
+ libcxx-path: ../third-party/libcxx
69
71
llvm-hash: a1b6e7ff393533a5c4f3bdfd4efe5da106e2de2b
70
72
llvm-build-preset-prefix: {{#if optimized-debug}}debwithopt{{else}}{{{lowercase build-type}}}{{/if}}
71
73
llvm-build-preset-os: {{#if (ieq os 'windows') }}win{{else}}unix{{/if}}
@@ -77,10 +79,13 @@ jobs:
77
79
llvm-archive-extension: {{#if (ieq os 'windows') }}7z{{else}}tar.bz2{{/if}}
78
80
llvm-archive-filename: {{{ llvm-archive-basename }}}.{{{ llvm-archive-extension }}}
79
81
llvm-sanitizer-config: {{#if (and (ne compiler 'clang') (ne compiler 'apple-clang'))}}{{else if ubsan}}Undefined{{else if asan}}Address{{else if msan}}MemoryWithOrigins{{/if}}
80
- mrdocs-flags: {{#if (and (eq compiler 'gcc') (not asan)) }}-static{{/if}}{{#if (and (eq compiler 'clang') msan) }}-fsanitize-memory-track-origins{{/if}}
81
- mrdocs-ccflags: {{{ ccflags }}} {{{ mrdocs-flags }}}
82
- mrdocs-cxxflags: {{{ cxxflags }}} {{{ mrdocs-flags }}}
83
- mrdocs-linkflags: {{#if asan }}-fsanitize=address{{/if}}
82
+ common-flags: -gz=zstd {{#if msan }}-fsanitize-memory-track-origins {{/if}}
83
+ common-ccflags: {{{ ccflags }}} {{{ common-flags }}}
84
+ common-cxxflags: {{{ cxxflags }}} {{#if (ieq use-libcxx 'true') }}-nostdinc++ -isystem{{{ libcxx-path }}}/include/c++/v1{{/if}}
85
+ common-ldflags: {{{ ldflags }}} {{#if (ieq use-libcxx 'true') }}-nostdlib++ -L{{{ libcxx-path }}}/lib -lc++abi -lc++ -Wl,-rpath,{{{ libcxx-path }}}/lib {{/if}}
86
+ mrdocs-flags: {{#if (and (eq compiler 'gcc') (not asan)) }}-static{{/if}}
87
+ mrdocs-ccflags: {{{ common-ccflags }}} {{{ mrdocs-flags }}}
88
+ mrdocs-cxxflags: {{{ common-cxxflags }}} {{{ mrdocs-flags }}}
84
89
mrdocs-package-generators: {{#if (ieq os 'windows') }}7Z ZIP WIX{{else}}TGZ TXZ{{/if}}
85
90
mrdocs-release-package-artifact: release-packages-{{{ lowercase os }}}
86
91
output-file : matrix.json
@@ -224,6 +229,35 @@ jobs:
224
229
fi
225
230
echo -E "third-party-dir=$third_party_dir" >> $GITHUB_OUTPUT
226
231
232
+ - name : Install libc++
233
+ uses :
alandefreitas/cpp-actions/[email protected]
234
+ if : matrix.use-libcxx == 'true'
235
+ with :
236
+ cmake-version : ' >=3.26'
237
+ source-dir : ../third-party/llvm-project/runtimes
238
+ git-repository : https://github.com/llvm/llvm-project.git
239
+ git-tag : llvmorg-21.1.0
240
+ download-dir : ../third-party/llvm-project
241
+ build-dir : ${{ matrix.libcxx-path }}
242
+ build-type : ${{ matrix.build-type }}
243
+ extra-args : |
244
+ -D LLVM_USE_SANITIZER=${{ matrix.llvm-sanitizer-config }}
245
+ -D LLVM_OPTIMIZED_TABLEGEN=ON
246
+ -D LLVM_ENABLE_LIBCXX=OFF
247
+ -D LLVM_ENABLE_PROJECT=""
248
+ -D LLVM_ENABLE_RUNTIMES="libcxx;libcxxabi"
249
+ -D LLVM_ENABLE_PIC=ON
250
+ -D LIBCXXABI_USE_LLVM_UNWINDER=OFF
251
+
252
+ cc : ${{ steps.setup-cpp.outputs.cc }}
253
+ cxx : ${{ steps.setup-cpp.outputs.cxx }}
254
+ ccflags : -gz=zstd
255
+ cxxflags : -gz=zstd
256
+ generator : Ninja
257
+ install : false
258
+ run-tests : false
259
+ trace-commands : true
260
+
227
261
- name : Cached LLVM Binaries
228
262
id : llvm-cache
229
263
uses : actions/cache@v4
@@ -279,11 +313,14 @@ jobs:
279
313
build-type : ${{ matrix.build-type }}
280
314
# The LLVM_USE_SANITIZER option doesn't support GCC.
281
315
extra-args : |
282
- -DLLVM_USE_SANITIZER=${{ matrix.llvm-sanitizer-config }}
316
+ -D LLVM_USE_SANITIZER="${{ matrix.llvm-sanitizer-config }}"
317
+ -D LLVM_OPTIMIZED_TABLEGEN=ON
318
+ -D CMAKE_SHARED_LINKER_FLAGS="${{ matrix.common-ldflags }}"
319
+ -D CMAKE_ENABLE_LIBCXX=OFF
283
320
cc : ${{ steps.setup-cpp.outputs.cc }}
284
321
cxx : ${{ steps.setup-cpp.outputs.cxx }}
285
- ccflags : -gz=zstd
286
- cxxflags : -gz=zstd
322
+ ccflags : ${{ matrix.common-ccflags }}
323
+ cxxflags : ${{ matrix.common-cxxflags }}
287
324
generator : Ninja
288
325
install : true
289
326
install-prefix : ${sourceDir}/../install
@@ -306,10 +343,12 @@ jobs:
306
343
build-dir : ${sourceDir}/build
307
344
cc : ${{ steps.setup-cpp.outputs.cc }}
308
345
cxx : ${{ steps.setup-cpp.outputs.cxx }}
309
- ccflags : ${{ matrix.ccflags }}
310
- cxxflags : ${{ matrix.cxxflags }}
346
+ ccflags : ${{ matrix.common- ccflags }}
347
+ cxxflags : ${{ matrix.common- cxxflags }}
311
348
build-type : ${{ matrix.build-type }}
312
349
shared : false
350
+ extra-args : |
351
+ -D CMAKE_STATIC_LINKER_FLAGS="${{ matrix.common-ldflags }}"
313
352
install : true
314
353
install-prefix : ${sourceDir}/install
315
354
run-tests : false
@@ -325,11 +364,12 @@ jobs:
325
364
build-dir : ${sourceDir}/build
326
365
cc : ${{ steps.setup-cpp.outputs.cc }}
327
366
cxx : ${{ steps.setup-cpp.outputs.cxx }}
328
- ccflags : ${{ matrix.ccflags }}
329
- cxxflags : ${{ matrix.cxxflags }}
367
+ ccflags : ${{ matrix.common- ccflags }}
368
+ cxxflags : ${{ matrix.common- cxxflags }}
330
369
build-type : Release
331
370
shared : false
332
371
extra-args : |
372
+ -D CMAKE_SHARED_LINKER_FLAGS="${{ matrix.common-ldflags }}"
333
373
-D LIBXML2_WITH_PROGRAMS=ON
334
374
-D LIBXML2_WITH_FTP=OFF
335
375
-D LIBXML2_WITH_HTTP=OFF
@@ -388,11 +428,11 @@ jobs:
388
428
install-prefix : .local
389
429
extra-args : |
390
430
-D MRDOCS_BUILD_DOCS=OFF
391
- -D CMAKE_EXE_LINKER_FLAGS=${{ matrix.mrdocs-linkflags }}
392
- -D LLVM_ROOT=${{ steps.resolve-third-party-dir.outputs.third-party-dir }}/llvm-project/install
393
- -D Clang_ROOT=${{ steps.resolve-third-party-dir.outputs.third-party-dir }}/llvm-project/install
394
- -D duktape_ROOT=${{ steps.resolve-third-party-dir.outputs.third-party-dir }}/duktape/install
395
- -D Duktape_ROOT=${{ steps.resolve-third-party-dir.outputs.third-party-dir }}/duktape/install
431
+ -D CMAKE_EXE_LINKER_FLAGS=" ${{ matrix.common-ldflags }}"
432
+ -D LLVM_ROOT=" ${{ steps.resolve-third-party-dir.outputs.third-party-dir }}/llvm-project/install"
433
+ -D Clang_ROOT=" ${{ steps.resolve-third-party-dir.outputs.third-party-dir }}/llvm-project/install"
434
+ -D duktape_ROOT=" ${{ steps.resolve-third-party-dir.outputs.third-party-dir }}/duktape/install"
435
+ -D Duktape_ROOT=" ${{ steps.resolve-third-party-dir.outputs.third-party-dir }}/duktape/install"
396
436
${{ runner.os == 'Windows' && '-D libxml2_ROOT=../third-party/libxml2/install' || '' }}
397
437
${{ runner.os == 'Windows' && '-D LibXml2_ROOT=../third-party/libxml2/install' || '' }}
398
438
export-compile-commands : true
0 commit comments