configure: add --disable-mpers and --enable-mpers=check options

On architectures supporting multiple personalities, multiple
personalities support in strace is required for proper decoding of
structures used by tracees with personalities that differ from the
personality of strace.

New configure options control whether multiple personalities support
in strace is mandatory, optional, or disabled.

The default is changed from what is now equivalent of
--enable-mpers=check (automatically detect whether required mpers
support could be enabled) to --enable-mpers (terminate the build
if required mpers support could not be enabled).

* configure.ac (AC_ARG_ENABLE([mpers])): New option.
* m4/mpers.m4 (st_MPERS): Use enable_mpers.  Terminate the build
if mpers could not be enabled and enable_mpers==yes.
* strace.spec.in: Specify --enable-mpers=check to %configure.
* debian/rules (build/Makefile, build64/Makefile): Specify
--enable-mpers=check to configure.

Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
Suggested-by: DJ Delorie <dj@redhat.com>
This commit is contained in:
Eugene Syromyatnikov 2018-01-10 03:43:41 +01:00 committed by Dmitry V. Levin
parent 649dd83545
commit 3eb199a29d
4 changed files with 31 additions and 3 deletions

View File

@ -962,6 +962,19 @@ if test "$arch" = mips && test "$no_create" != yes; then
fi
fi
AC_ARG_ENABLE([mpers],
[AS_HELP_STRING([--enable-mpers=yes|no|check],
[whether to enable multiple personalities support required
for proper decoding of structures used by tracees with
personalities that differ from the personality of strace,
default is yes.])],
[case "$enableval" in
yes|no|check) enable_mpers="$enableval" ;;
*) AC_MSG_ERROR([bad value $enableval for enable-mpers option.
Valid options are: yes, no, check.]) ;;
esac],
[enable_mpers=yes])
st_MPERS([m32], [aarch64|powerpc64|riscv|sparc64|tile|x32|x86_64])
st_MPERS([mx32], [x86_64])

4
debian/rules vendored
View File

@ -53,11 +53,11 @@ endif
build/Makefile:
mkdir -p $(@D)
cd $(@D); sh ../configure --prefix=/usr $(CONFIG_OPTS)
cd $(@D); sh ../configure --enable-mpers=check --prefix=/usr $(CONFIG_OPTS)
build64/Makefile:
mkdir -p $(@D)
cd $(@D); CC="$(CC64)" sh ../configure --prefix=/usr --build=$(DEB_BUILD_GNU_TYPE) --host=$(HOST64)
cd $(@D); CC="$(CC64)" sh ../configure --enable-mpers=check --prefix=/usr --build=$(DEB_BUILD_GNU_TYPE) --host=$(HOST64)
clean:
dh_testdir

View File

@ -89,6 +89,11 @@ pushdef([st_cv_mpers], [st_cv_$1_mpers])
case "$arch" in
[$2])
if test "$enable_mpers" = no; then
st_cv_runtime=no
st_cv_mpers=no
else
AH_TEMPLATE([HAVE_GNU_STUBS_32_H],
[Define to 1 if you have the <gnu/stubs-32.h> header file.])
AH_TEMPLATE([HAVE_GNU_STUBS_X32_H],
@ -147,6 +152,16 @@ case "$arch" in
fi
fi
CFLAGS="$saved_CFLAGS"
fi
test "$st_cv_mpers" = yes ||
st_cv_mpers=no
AC_MSG_CHECKING([whether to enable $1 personality support])
AC_MSG_RESULT([$st_cv_mpers])
if test "$enable_mpers" = yes && test "$st_cv_mpers" != yes; then
AC_MSG_ERROR([Cannot enable $1 personality support])
fi
;;
*)

View File

@ -65,7 +65,7 @@ kver="$(echo -e '#include <linux/version.h>\nLINUX_VERSION_CODE' | gcc -E -P -)"
printf 'kernel-headers %%s.%%s.%%s\n' $(($kver/65536)) $(($kver/256%%256)) $(($kver%%256))
echo 'END OF BUILD ENVIRONMENT INFORMATION'
%configure
%configure --enable-mpers=check
make %{?_smp_mflags}
%install