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
@@ -65,21 +66,22 @@ jobs:
6566 msvc: ''
6667 extra-values : |
6768 llvm-hash: dd7a3d4d798e30dfe53b5bbbbcd9a23c24ea1af9
68- llvm-id: {{ substr llvm-hash 0 7 }}
69- llvm-build-preset-prefix: {{#if optimized-debug}}debwithopt{{else}}{{lowercase build-type}}{{/if}}
69+ llvm-id: {{{ substr llvm-hash 0 7 } }}
70+ llvm-build-preset-prefix: {{#if optimized-debug}}debwithopt{{else}}{{{ lowercase build-type} }}{{/if}}
7071 llvm-build-preset-suffix: {{#if (ieq os 'windows') }}win{{else}}unix{{/if}}
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 }}-{{ llvm-hash }}
72+ llvm-build-preset: {{{ llvm-build-preset-prefix }}} -{{{ llvm-build-preset-suffix } }}
73+ llvm-compiler-key: {{{ compiler }}} -{{{ version } }}
74+ llvm-cache-key: llvm-libcxx-{{{ lowercase os }}} -{{{ llvm-compiler-key }}} -{{{ llvm-build-preset-prefix }}} -{{{ ubsan }}}-{{{ asan }}}-{{{ msan }}}-{{{ llvm-hash } }}
7475 llvm-root: ../third-party/llvm-project/install
75- llvm-archive-basename: llvm-{{ os }}-{{ llvm-build-preset-prefix }}-{{ llvm-id }}
76+ llvm-archive-basename: llvm-{{{ os }}} -{{{ llvm-build-preset-prefix }}} -{{{ llvm-id } }}
7677 llvm-archive-extension: {{#if (ieq os 'windows') }}7z{{else}}tar.bz2{{/if}}
77- llvm-archive-filename: {{ llvm-archive-basename }}.{{ llvm-archive-extension }}
78- mrdocs-ccflags: {{ ccflags }} {{#if (eq compiler 'gcc') }}-static{{/if}} {{#if asan }}-static-libasan{{/if}} {{#if tsan }}-static-libtsan {{/if}}
79- mrdocs-cxxflags: {{ cxxflags }} {{#if (eq compiler 'gcc') }}-static{{/if}} {{#if asan }}-static-libasan{{/if}} {{#if tsan }}-static-libtsan {{/if}}
78+ llvm-archive-filename: {{{ llvm-archive-basename }}} .{{{ llvm-archive-extension } }}
79+ mrdocs-ccflags: {{{ ccflags }}} {{#if (and ( eq compiler 'gcc') (not asan)) }}-static{{/if}}
80+ mrdocs-cxxflags: {{{ cxxflags }}} {{#if (and ( eq compiler 'gcc') (not asan)) }}-static{{/if}}
8081 mrdocs-package-generators: {{#if (ieq os 'windows') }}7Z ZIP WIX{{else}}TGZ TXZ{{/if}}
81- mrdocs-release-package-artifact: release-packages-{{ lowercase os }}
82+ mrdocs-release-package-artifact: release-packages-{{{ lowercase os } }}
8283 output-file : matrix.json
84+ trace-commands : true
8385
8486 # Set up the version as expected by the LLVM matrix script and @actions/core
8587 - name : Setup Node.js
@@ -215,7 +217,7 @@ jobs:
215217
216218 - name : Download LLVM Binaries
217219 id : llvm-download
218- if : steps.llvm-cache.outputs.cache-hit != 'true'
220+ if : steps.llvm-cache.outputs.cache-hit != 'true' && !(matrix.ubsan || matrix.asan || matrix.msan)
219221 run : |
220222 set -x
221223 url=https://mrdocs.com/llvm+clang/${{ matrix.llvm-archive-filename }}
@@ -260,6 +262,10 @@ jobs:
260262 build-type : ${{ matrix.build-type }}
261263 extra-args : |
262264 ${{ runner.os == 'Windows' && '-DLLVM_ENABLE_RUNTIMES=libcxx' || '-DLLVM_ENABLE_RUNTIMES=libcxx;libcxxabi;libunwind' }}
265+ # The UBSan vptr sanitizer needs RTTI.
266+ ${{ matrix.ubsan && '-DLLVM_ENABLE_RTTI=ON' }}
267+ # The LLVM_USE_SANITIZER option doesn't support GCC.
268+ ${{ !matrix.compiler == 'gcc' && matrix.ubsan && '-DLLVM_USE_SANITIZER=Undefined' }}
263269 cc : ${{ steps.setup-cpp.outputs.cc }}
264270 cxx : ${{ steps.setup-cpp.outputs.cxx }}
265271 generator : Ninja
0 commit comments