Skip to content

Commit

Permalink
Added explicit use of lld and llvm-ar to msys2 github workflow
Browse files Browse the repository at this point in the history
The clangx64ninja build test env explicitly specified only the clang/++
compiler env.vars (CC, CXX, OBJC, OBJCXX), which leaves meson to guess
at what static & dynamic linkers to use.  Unfortunately, it can decide
to go for the gnu 'ld.bfd' linker, which might sometimes be compatible
with clang-compiled objects but is not compatible with clang's LTO byte-
code output. Now we explictly use all llvm-based tools by adding -
- ..._LD=ld.lld
- AR=llvm-ar

Tried and failed using `..._LD=ld.lld`.  Meson seems to use the _LD
linker env.var value to directly invoke -
`clang -Wl,--version -fuse-ld=ld.lld`
which doesn't work; needs to be 'lld' (`..._LD=lld`) it seems.
  • Loading branch information
GertyP committed Sep 2, 2023
1 parent af8c9f8 commit 74432d1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/msys2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ jobs:
mingw-w64-${{ matrix.MSYS2_ARCH }}-python-jsonschema
mingw-w64-${{ matrix.MSYS2_ARCH }}-${{ matrix.TOOLCHAIN }}
- name: Conditional lld install
run: |
pacman -S --noconfirm mingw-w64-${{ matrix.MSYS2_ARCH }}-lld
if: ${{ matrix.COMPILER == 'clang' }}

- name: Install dependencies
run: |
python3 -m pip --disable-pip-version-check install gcovr pefile pytest pytest-subtests pytest-xdist coverage
Expand Down Expand Up @@ -111,9 +116,14 @@ jobs:
if [[ '${{ matrix.COMPILER }}' == 'clang' ]]; then
export CC=clang
export CC_LD=lld
export CXX=clang++
export CXX_LD=lld
export OBJC=clang
export OBJC_LD=lld
export OBJCXX=clang++
export OBJCXX_LD=lld
export AR=llvm-ar
fi
if [[ "${{ matrix.MSYS2_CURSES }}" != "" ]]; then
Expand Down

0 comments on commit 74432d1

Please sign in to comment.