Skip to content

Commit 28a09f9

Browse files
committed
Statically link libgcc on linux
1 parent e552733 commit 28a09f9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/cd.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,18 @@ jobs:
106106

107107
- run: |
108108
cargo build --release
109+
if: ${{ runner.os != 'Linux' }}
110+
111+
# hack to statically link libgcc
112+
- run: |
113+
echo '#!/bin/bash' > linkerdriver.wrap
114+
echo 'exec "${CC:-cc}" "${@/-lgcc_s/-lgcc_eh}"' >> linkerdriver.wrap
115+
chmod +x ./linkerdriver.wrap
116+
117+
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER="$PWD/linkerdriver.wrap" cargo build --release
118+
if: ${{ runner.os == 'Linux' }}
119+
120+
- run: |
109121
mv target/release/pkgx .
110122
strip ./pkgx
111123

0 commit comments

Comments
 (0)