FS#58798 - strip mingw binaries
Attached to Project:
Pacman
Opened by Michel (xantares) - Wednesday, 30 May 2018, 17:15 GMT
Last edited by Allan McRae (Allan) - Thursday, 19 July 2018, 03:13 GMT
Opened by Michel (xantares) - Wednesday, 30 May 2018, 17:15 GMT
Last edited by Allan McRae (Allan) - Thursday, 19 July 2018, 03:13 GMT
|
Details
I would like makepkg to automatically strip the binaries of
mingw packages (mingw-w64-*).
Typically these kind of packages have these options: options=('!buildflags' 'staticlibs' '!strip') The !strip tells not to strip as binaries are not elf, but stripping is still needed, in the package section we always have to strip static (*.a), import (*.dll.a) and runtime libs (*.dll): ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a (with _arch in {i686-w64-mingw32, x86_64-w64-mingw32}) The ${_arch}-strip programs come from the mingw-w64-binutils package. |
This task depends upon
Closed by Allan McRae (Allan)
Thursday, 19 July 2018, 03:13 GMT
Reason for closing: Won't implement
Additional comments about closing: Use a libmakepkg tidy pass to do this.
Thursday, 19 July 2018, 03:13 GMT
Reason for closing: Won't implement
Additional comments about closing: Use a libmakepkg tidy pass to do this.
Do you think we should use the arch-dependent objcopy to create debug packages too? Does the logic we use, work for mingw binaries? See https://git.archlinux.org/pacman.git/tree/scripts/libmakepkg/tidy/strip.sh.in
Or, it might be as simple as offering a $STRIP or $STRIP_PREFIX configurable.
Essentially, just create a new file in /usr/share/makepkg/tidy/ and libmakepkg will automatically source it. See the format of the other files in there (as well as /usr/share/makepkg/tidy.sh itself) to see how each tidy/*.sh file defines a function and hooks that into makepkg's tidy_remove and tidy_modify arrays.