]> granicus.if.org Git - strace/commitdiff
configure: add --disable-mpers and --enable-mpers=check options
authorEugene Syromyatnikov <evgsyr@gmail.com>
Wed, 10 Jan 2018 02:43:41 +0000 (03:43 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 11 Jan 2018 23:09:56 +0000 (23:09 +0000)
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>
configure.ac
debian/rules
m4/mpers.m4
strace.spec.in

index 259413e952881bcf342e8d53807162a901f7b86c..ca140a2514dcd64041b2b3350ac005d15cb080d5 100644 (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])
 
index d03cd5cee8eb2002c19d106220dbf461d75b29cb..6c9fbc0534257d119f08f9a4024724cb6b55a9fe 100755 (executable)
@@ -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
index 01e965188c6049dddd4245822f8c4bc5094068ae..a6647bf2b4ed81af0ef29d14367cbb542d688f72 100644 (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
        ;;
 
        *)
index 6664a88f767c74671fd4d76c67551ce467c6e5e0..2a7ded7411449fb909b3c0ae6197b0d0ef010910 100644 (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