|
9 | 9 | if: github.event_name == 'create' && github.event.ref_type == 'tag' |
10 | 10 | name: Release |
11 | 11 | runs-on: [self-hosted, linux, x64, kvm] |
| 12 | + env: |
| 13 | + # Static link host tools so they don't depend on build host's glibc version |
| 14 | + HOSTLDFLAGS: "-static -lz" |
12 | 15 | steps: |
13 | 16 | - name: Code checkout |
14 | 17 | uses: actions/checkout@v4 |
|
21 | 24 | - name: Build (aarch64) |
22 | 25 | run: ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make Image.gz -j `nproc` |
23 | 26 | - name: Build kernel modules (aarch64) |
24 | | - # HOSTLDFLAGS=-static makes scripts tools (modpost, etc.) statically linked |
25 | | - # so they don't depend on the build host's glibc version. -lz needed for objtool. |
26 | | - run: ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- HOSTLDFLAGS="-static -lz" make modules -j `nproc` |
| 27 | + run: ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make modules -j `nproc` |
27 | 28 | - name: Package kernel headers (aarch64) |
28 | 29 | run: | |
29 | 30 | KVER=$(ARCH=arm64 make -s kernelrelease) |
|
51 | 52 | - name: Build kernel (x86-64) |
52 | 53 | run: CFLAGS="-Wa,-mx86-used-note=no" make bzImage -j `nproc` |
53 | 54 | - name: Build kernel modules (x86-64) |
54 | | - # HOSTLDFLAGS=-static makes scripts tools (modpost, etc.) statically linked |
55 | | - # so they don't depend on the build host's glibc version. -lz needed for objtool. |
56 | | - run: HOSTLDFLAGS="-static -lz" make modules -j `nproc` |
| 55 | + run: make modules -j `nproc` |
57 | 56 | - name: Package kernel headers (x86-64) |
58 | 57 | run: | |
59 | 58 | KVER=$(make -s kernelrelease) |
|
72 | 71 | |
73 | 72 | echo "Kernel headers packaged for ${KVER}:" |
74 | 73 | du -sh kernel-headers-x86_64.tar.gz |
| 74 | + - name: Verify tools are statically linked |
| 75 | + run: | |
| 76 | + echo "Checking that host tools are statically linked..." |
| 77 | + FAILED=0 |
| 78 | + for tool in kernel-headers-x86/scripts/basic/fixdep \ |
| 79 | + kernel-headers-x86/scripts/mod/modpost \ |
| 80 | + kernel-headers-x86/tools/objtool/objtool; do |
| 81 | + if [ -f "$tool" ]; then |
| 82 | + if file "$tool" | grep -q "statically linked"; then |
| 83 | + echo "✓ $tool: statically linked" |
| 84 | + else |
| 85 | + echo "✗ $tool: DYNAMICALLY LINKED - this will cause glibc compatibility issues!" |
| 86 | + file "$tool" |
| 87 | + FAILED=1 |
| 88 | + fi |
| 89 | + fi |
| 90 | + done |
| 91 | + if [ $FAILED -eq 1 ]; then |
| 92 | + echo "ERROR: Some tools are dynamically linked. Check HOSTLDFLAGS setting." |
| 93 | + exit 1 |
| 94 | + fi |
| 95 | + echo "All tools verified as statically linked." |
75 | 96 | - name: Create release |
76 | 97 | id: create_release |
77 | 98 | uses: actions/create-release@v1 |
|
0 commit comments