libmakepkg: Support file 5.33's application/x-pie-executable

file 5.33 introduces a new MIME type "application/x-pie-executable",
which is used for relocatable binaries. makepkg ignored these binaries
and did not attempt to strip them.

Handle the new MIME type like the old "application/x-sharedlib".
Stripping the binaries with --strip-unneeded to keep relocation
information should be the correct thing to do.

file 5.33 also misidentifies actual libraries as PIE executables, so we
didn't strip any shared libraries, either. We now work around this bug.

Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Jan Alexander Steffens (heftig) 2018-04-20 19:46:16 +02:00 committed by Allan McRae
parent 40937b381a
commit 03272ad571
2 changed files with 4 additions and 2 deletions

View file

@ -193,8 +193,8 @@ Options
for details. for details.
**STRIP_SHARED=**"--strip-unneeded":: **STRIP_SHARED=**"--strip-unneeded"::
Options to be used when stripping shared libraries. See linkman:strip[1] Options to be used when stripping shared libraries or PIE executables.
for details. See linkman:strip[1] for details.
**STRIP_STATIC=**"--strip-debug":: **STRIP_STATIC=**"--strip-debug"::
Options to be used when stripping static libraries. See linkman:strip[1] Options to be used when stripping static libraries. See linkman:strip[1]

View file

@ -125,6 +125,8 @@ tidy_strip() {
esac;; esac;;
*application/x-executable*) # Binaries *application/x-executable*) # Binaries
strip_flags="$STRIP_BINARIES";; strip_flags="$STRIP_BINARIES";;
*application/x-pie-executable*) # Relocatable binaries
strip_flags="$STRIP_SHARED";;
*) *)
continue ;; continue ;;
esac esac