Skip to content

Commit 5a6b335

Browse files
committed
ci: symlink repo prebuilt ld.lld as host ld (build.sh scrubs HOSTLDFLAGS)
1 parent b41c4f3 commit 5a6b335

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/actions/build-kernel/action.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ runs:
1212
if: false
1313
uses: ./.github/actions/set-kernel-config
1414

15+
- name: 'Provide host ld from repo prebuilts'
16+
shell: bash
17+
run: |
18+
# build.sh scrubs HOSTLDFLAGS from the env, so export it is useless.
19+
# Instead, put the repo-synced ld.lld on PATH as "ld": the prebuilt
20+
# clang defaults to the "ld" name and the runner image has no binutils.
21+
LDLLD=$(find "${{ github.workspace }}/kernel/prebuilts/clang" -name "ld.lld" -type f 2>/dev/null | sort | head -n 1)
22+
if [ -n "$LDLLD" ]; then
23+
sudo ln -sf "$LDLLD" /usr/local/bin/ld
24+
which ld && ld --version | head -n 1
25+
else
26+
echo "WARNING: prebuilt ld.lld not found under kernel/prebuilts/clang" >&2
27+
fi
28+
1529
- name: 'Build Kernel'
1630
shell: bash
1731
working-directory: ${{ github.workspace }}/kernel

0 commit comments

Comments
 (0)