Skip to content

Strip Windows binaries

Hanabishi Recca requested to merge (removed):strip into main

Makepkg only strips Linux binaries. This MR strips Windows binaries as well to save some extra space (~70 MiB).


Strip from mingw-w64-binutils seems to have the same result with regular strip from binutils. But as we pull it anyway, I thought why not to use it just in case.


I picked --strip-debug as a failsafe option as it should not affect anything. Makepkg uses a quite complicated strategy for Linux binaries and I'm not sure if it is really possible to replicate it for Windows binaries (readelf doesn't work on them obviously).

Technically, --strip-all could be used instead, it saves a lot more (~200 MiB). I tested it with several apps and they run just fine, but I don't know what will happen if you say compile something under Wine, i.e. linking against fully stripped libraries could fail afaik. So I didn't risk to apply it for everyone.

Maybe someone with more knowledge could confirm that --strip-all does not have any negative side effects in this case. Such optimization looks attractive.

Edited by Hanabishi Recca

Merge request reports