Skip to content

Commit fb7d3e6

Browse files
authored
Merge pull request #1153 from pkgxdev/static-libgcc
attempt to statically link libgcc on linux
2 parents e552733 + 28a09f9 commit fb7d3e6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.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)