4141 standards : ' 20'
4242 latest-factors : |
4343 msvc Optimized-Debug
44- gcc Coverage
44+ gcc UBSan Coverage
45+ clang UBSan
4546 factors : ' '
4647 runs-on : |
4748 apple-clang: macos-15
@@ -64,21 +65,22 @@ jobs:
6465 msvc: ''
6566 extra-values : |
6667 llvm-hash: dd7a3d4d798e30dfe53b5bbbbcd9a23c24ea1af9
67- llvm-id: {{ substr llvm-hash 0 7 }}
68- llvm-build-preset-prefix: {{#if optimized-debug}}debwithopt{{else}}{{lowercase build-type}}{{/if}}
68+ llvm-id: {{{ substr llvm-hash 0 7 } }}
69+ llvm-build-preset-prefix: {{#if optimized-debug}}debwithopt{{else}}{{{ lowercase build-type} }}{{/if}}
6970 llvm-build-preset-suffix: {{#if (ieq os 'windows') }}win{{else}}unix{{/if}}
70- llvm-build-preset: {{ llvm-build-preset-prefix }}-{{ llvm-build-preset-suffix }}
71- llvm-compiler-key: {{ compiler }}-{{ version }}
72- llvm-cache-key: llvm-libcxx-{{ lowercase os }}-{{ llvm-compiler-key }}-{{ llvm-build-preset-prefix }}-{{ llvm-hash }}
71+ llvm-build-preset: {{{ llvm-build-preset-prefix }}} -{{{ llvm-build-preset-suffix } }}
72+ llvm-compiler-key: {{{ compiler }}} -{{{ version } }}
73+ llvm-cache-key: llvm-libcxx-{{{ lowercase os }}} -{{{ llvm-compiler-key }}} -{{{ llvm-build-preset-prefix }}} -{{{ ubsan }}}-{{{ asan }}}-{{{ msan }}}-{{{ llvm-hash } }}
7374 llvm-root: ../third-party/llvm-project/install
74- llvm-archive-basename: llvm-{{ os }}-{{ llvm-build-preset-prefix }}-{{ llvm-id }}
75+ llvm-archive-basename: llvm-{{{ os }}} -{{{ llvm-build-preset-prefix }}} -{{{ llvm-id } }}
7576 llvm-archive-extension: {{#if (ieq os 'windows') }}7z{{else}}tar.bz2{{/if}}
76- llvm-archive-filename: {{ llvm-archive-basename }}.{{ llvm-archive-extension }}
77- mrdocs-ccflags: {{ ccflags }} {{#if (eq compiler 'gcc') }}-static{{/if}} {{#if asan }}-static-libasan{{/if}} {{#if tsan }}-static-libtsan {{/if}}
78- mrdocs-cxxflags: {{ cxxflags }} {{#if (eq compiler 'gcc') }}-static{{/if}} {{#if asan }}-static-libasan{{/if}} {{#if tsan }}-static-libtsan {{/if}}
77+ llvm-archive-filename: {{{ llvm-archive-basename }}} .{{{ llvm-archive-extension } }}
78+ mrdocs-ccflags: {{{ ccflags }}} {{#if (and ( eq compiler 'gcc') (not asan)) }}-static{{/if}}
79+ mrdocs-cxxflags: {{{ cxxflags }}} {{#if (and ( eq compiler 'gcc') (not asan)) }}-static{{/if}}
7980 mrdocs-package-generators: {{#if (ieq os 'windows') }}7Z ZIP WIX{{else}}TGZ TXZ{{/if}}
80- mrdocs-release-package-artifact: release-packages-{{ lowercase os }}
81+ mrdocs-release-package-artifact: release-packages-{{{ lowercase os } }}
8182 output-file : matrix.json
83+ trace-commands : true
8284
8385 # Set up the version as expected by the LLVM matrix script and @actions/core
8486 - name : Setup Node.js
@@ -214,7 +216,7 @@ jobs:
214216
215217 - name : Download LLVM Binaries
216218 id : llvm-download
217- if : steps.llvm-cache.outputs.cache-hit != 'true'
219+ if : steps.llvm-cache.outputs.cache-hit != 'true' && !(matrix.ubsan || matrix.asan || matrix.msan)
218220 run : |
219221 set -x
220222 url=https://mrdocs.com/llvm+clang/${{ matrix.llvm-archive-filename }}
@@ -259,6 +261,10 @@ jobs:
259261 build-type : ${{ matrix.build-type }}
260262 extra-args : |
261263 ${{ runner.os == 'Windows' && '-DLLVM_ENABLE_RUNTIMES=libcxx' || '-DLLVM_ENABLE_RUNTIMES=libcxx;libcxxabi;libunwind' }}
264+ # The UBSan vptr sanitizer needs RTTI.
265+ ${{ matrix.ubsan && '-DLLVM_ENABLE_RTTI=ON' }}
266+ # The LLVM_USE_SANITIZER option doesn't support GCC.
267+ ${{ !matrix.compiler == 'gcc' && matrix.ubsan && '-DLLVM_USE_SANITIZER=Undefined' }}
262268 cc : ${{ steps.setup-cpp.outputs.cc }}
263269 cxx : ${{ steps.setup-cpp.outputs.cxx }}
264270 generator : Ninja
0 commit comments