From 5ccdd5408afee846e2c3f7dc7f7359a8821faba8 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 7 Apr 2026 12:09:22 +0200 Subject: install LLD as well --- .github/actions/check-lld/action.yml | 41 ++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 6 ++++++ README.md | 1 + action.yml | 7 +++++- 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 .github/actions/check-lld/action.yml diff --git a/.github/actions/check-lld/action.yml b/.github/actions/check-lld/action.yml new file mode 100644 index 0000000..5bb25b6 --- /dev/null +++ b/.github/actions/check-lld/action.yml @@ -0,0 +1,41 @@ +name: Check LLD +description: Check LLD +inputs: + version: + description: Specific version to check + required: false +runs: + using: composite + steps: + - run: | + function Check-Exe { + param( + [Parameter(Mandatory=$true)] + [string] $Exe, + [Parameter(Mandatory=$true)] + [string] $HelpString + ) + + echo (Get-Command $Exe).Path + $output = & $Exe --version 2>&1 + echo $output + + $($output | Select-String -Pattern $HelpString -SimpleMatch -Quiet) -or $(throw "Unexpected `$Exe --version` output") + } + + $version = '${{ inputs.version }}' + + $driver_exe = 'lld' + # Although the output of `lld --version` claims that it's ld-link on + # Windows, the Chocolatey version at least still uses ld.lld as on + # Linux. + $real_exe = 'ld.lld' + + if ($version) { + $driver_exe = "$driver_exe-$version" + $real_exe = "$real_exe-$version" + } + + Check-Exe $driver_exe 'lld is a generic driver' + Check-Exe $real_exe "LLD $version" + shell: pwsh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d70af44..90b254c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,6 +32,8 @@ jobs: uses: ./.github/actions/run-foo - name: Check symlinks uses: ./.github/actions/check-cc + - name: Check lld + uses: ./.github/actions/check-lld versions: strategy: @@ -64,3 +66,7 @@ jobs: uses: ./.github/actions/check-cc with: version: '${{ matrix.version }}' + - name: Check lld + uses: ./.github/actions/check-lld + with: + version: '${{ matrix.version }}' diff --git a/README.md b/README.md index 56a5e34..8f5e57e 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ API | ------- | --------- | ----------- | clang | clang-4.0 | `clang` binary name | clangxx | clang++-7 | `clang++` binary name +| lld | ld.lld-10 | `ld.lld` binary name Supported versions ------------------ diff --git a/action.yml b/action.yml index db008dd..cb35e52 100644 --- a/action.yml +++ b/action.yml @@ -107,6 +107,7 @@ runs: $clang = 'clang' $clangxx = 'clang++' + $lld = 'ld.lld' if ($linux_host) { $pkg_clang = 'clang' @@ -114,6 +115,7 @@ runs: $pkg_clang_tidy = 'clang-tidy' $pkg_llvm = 'llvm' $pkg_gxx = 'g++' + $pkg_lld = 'lld' if (!$latest) { $pkg_version = Format-UpstreamVersion $version @@ -123,14 +125,16 @@ runs: $pkg_clang_format = "$pkg_clang_format-$pkg_version" $pkg_clang = "$pkg_clang_tidy-$pkg_version" $pkg_llvm = "$pkg_llvm-$pkg_version" + $pkg_lld = "$pkg_lld-$pkg_version" $clang = "$clang-$pkg_version" $clangxx = "$clangxx-$pkg_version" + $lld = "$lld-$pkg_version" } if (!$x64) { $pkg_gxx = 'g++-multilib' } - $packages = $pkg_clang,$pkg_clang_format,$pkg_clang_tidy,$pkg_llvm,$pkg_gxx + $packages = $pkg_clang,$pkg_clang_format,$pkg_clang_tidy,$pkg_llvm,$pkg_gxx,$pkg_lld Install-Package $packages } elseif ($windows_host) { @@ -144,6 +148,7 @@ runs: echo "clang=$clang" >> $env:GITHUB_OUTPUT echo "clangxx=$clangxx" >> $env:GITHUB_OUTPUT + echo "lld=$lld" >> $env:GITHUB_OUTPUT shell: pwsh - run: | -- cgit v1.3