--- gir-paxctl-lt-wrapper.orig 2012-11-11 06:30:56.419744543 +0000 +++ gir-paxctl-lt-wrapper.orig 2013-01-29 21:51:49.229189680 +0000 @@ -1,9 +1,9 @@ -#!/bin/bash +#!/bin/sh # Wrapper for $(LIBTOOL) that performs PaX marking on the dumper binary # generated by g-ir-scanner. # PaX marking code stolen from pax-utils.eclass -flags=${1//-}; shift +flags=${1##-}; shift echo ${LIBTOOL} "$@" ${LIBTOOL} "$@" @@ -12,7 +12,12 @@ retval=$? files=$(find . -path "*tmp-introspect*/.libs/*") -if type -p paxctl > /dev/null; then +if command -v paxctl-ng > /dev/null && paxctl-ng -L; then + echo "PT PaX marking -${flags} ${files}" + for f in ${files}; do + paxctl-ng -L -${flags} "${f}" + done +elif command -v paxctl > /dev/null; then echo "PT PaX marking -${flags} ${files}" for f in ${files}; do # First, try modifying the existing PAX_FLAGS header @@ -23,11 +28,18 @@ if type -p paxctl > /dev/null; then # insert a PT_GNU_STACK header (works on ET_EXEC) paxctl -qC${flags} "${f}" && continue done -elif type -p scanelf > /dev/null; then +elif command -v scanelf > /dev/null; then # Try scanelf, the Gentoo swiss-army knife ELF utility # Currently this sets PT if it can, no option to control what it does. echo "Fallback PaX marking -${flags} ${files}" scanelf -Xxz ${flags} ${files} fi +if command -v paxctl-ng > /dev/null && paxctl-ng -l; then + echo "XT PaX marking -${flags} ${files}" + for f in ${files}; do + paxctl-ng -l -${flags} "${f}" + done +fi + exit ${retval}