File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -221,7 +221,18 @@ jobs:
221221 mv riscv.tar.xz ${{ steps.toolchain-name-generator.outputs.TOOLCHAIN_NAME }}.tar.xz
222222 - name : strip binaries
223223 run : |
224- find /mnt/riscv -type f -exec strip {} \;
224+ # Strip all ELF binaries in the toolchain
225+ # finds all of the files in /mnt/riscv, checks if they are ELF files, and strips them
226+ # strip itself would be fine running on any files, it will just complain if they are
227+ # not valid binaries. But that would capture the `.a` archives as well,
228+ # which we do not want to strip. Doing so would make linking them later problematic.
229+ # The logic:
230+ # 1. Find all files under /mnt/riscv
231+ # 2. For each file, run `file` command to check its type
232+ # 3. If the output of `file` contains "ELF", it is an ELF binary
233+ # 4. Strip that file
234+ # 5. Ignore others
235+ find /mnt/riscv -type f -exec sh -c 'file "$1" | grep -q "ELF" && strip "$1"' _ {} \;
225236 - name : tarball build stripped
226237 if : ${{ inputs.strip == 'stripped' || inputs.strip == 'both' }}
227238 run : |
You can’t perform that action at this time.
0 commit comments