@@ -106,9 +106,30 @@ jobs:
106106 - name : Verify static linking (Linux)
107107 if : matrix.use_cross
108108 run : |
109+ echo "=== Checking binary type ==="
109110 file target/${{ matrix.target }}/release/create-wallet
110- # Verify it's statically linked (should show "statically linked")
111- file target/${{ matrix.target }}/release/create-wallet | grep -i static || echo "Warning: May not be fully static"
111+
112+ echo "=== Verifying static linking ==="
113+ # The binary should be "statically linked" or "static-pie linked" - fail if not
114+ file target/${{ matrix.target }}/release/create-wallet | grep -qE "(statically linked|static-pie linked)" || {
115+ echo "ERROR: Binary is not statically linked!"
116+ exit 1
117+ }
118+
119+ echo "=== Checking for dynamic dependencies ==="
120+ # ldd should show "statically linked", "not a dynamic executable", or fail for cross-compiled binaries
121+ LDD_OUTPUT=$(ldd target/${{ matrix.target }}/release/create-wallet 2>&1) || true
122+ if echo "$LDD_OUTPUT" | grep -qE "(statically linked|not a dynamic executable)"; then
123+ echo "SUCCESS: No dynamic dependencies"
124+ echo "$LDD_OUTPUT"
125+ elif echo "$LDD_OUTPUT" | grep -qE "(cannot execute|wrong ELF class|cannot open)"; then
126+ echo "SUCCESS: Cross-compiled binary (ldd cannot analyze, but file confirmed static linking)"
127+ echo "$LDD_OUTPUT"
128+ else
129+ echo "ERROR: Binary has dynamic dependencies:"
130+ echo "$LDD_OUTPUT"
131+ exit 1
132+ fi
112133
113134 - name : Upload artifact
114135 uses : actions/upload-artifact@v4
@@ -240,8 +261,29 @@ jobs:
240261 - name : Verify static linking (Linux)
241262 if : matrix.os == 'ubuntu-latest'
242263 run : |
264+ echo "=== Checking binary type ==="
243265 file ./create-wallet
244- ldd ./create-wallet 2>&1 || echo "Binary is statically linked (no dynamic dependencies)"
266+
267+ echo "=== Verifying no libc dependency ==="
268+ # The binary should be "statically linked" or "static-pie linked"
269+ file ./create-wallet | grep -qE "(statically linked|static-pie linked)" || {
270+ echo "ERROR: Binary is not statically linked!"
271+ file ./create-wallet
272+ exit 1
273+ }
274+
275+ # Verify ldd shows no dynamic dependencies
276+ LDD_OUTPUT=$(ldd ./create-wallet 2>&1)
277+ if echo "$LDD_OUTPUT" | grep -qE "(statically linked|not a dynamic executable)"; then
278+ echo "SUCCESS: Binary has no dynamic dependencies (including libc)"
279+ echo "$LDD_OUTPUT"
280+ else
281+ echo "ERROR: Binary has dynamic dependencies:"
282+ echo "$LDD_OUTPUT"
283+ exit 1
284+ fi
285+
286+ echo "=== All binaries verified as fully static ==="
245287
246288 - name : Extract and verify (Windows)
247289 if : matrix.os == 'windows-latest'
0 commit comments