diff options
Diffstat (limited to 'dev-util/strace/files')
-rw-r--r-- | dev-util/strace/files/strace-6.5-static.patch | 178 |
1 files changed, 178 insertions, 0 deletions
diff --git a/dev-util/strace/files/strace-6.5-static.patch b/dev-util/strace/files/strace-6.5-static.patch new file mode 100644 index 000000000000..67e4b05ca856 --- /dev/null +++ b/dev-util/strace/files/strace-6.5-static.patch @@ -0,0 +1,178 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -54,6 +54,15 @@ AC_SUBST([STRACE_MANPAGE_DATE], [strace_manpage_date]) + AC_DEFINE([SLM_MANPAGE_DATE], "[slm_manpage_date]", [Date]) + AC_SUBST([SLM_MANPAGE_DATE], [slm_manpage_date]) + ++AC_ARG_ENABLE([static], ++ [AS_HELP_STRING([--enable-static], ++ [link strace statically])], ++ [], [enable_static=no]) ++if test "$enable_static" = "yes"; then ++ # Add -pthread since strace wants -lrt for timer_create, and -lrt uses -lpthread. ++ LDFLAGS="$LDFLAGS -pthread -static" ++fi ++ + AC_C_BIGENDIAN + + dnl arch-specific default for --enable-gcc-Werror +--- a/m4/st_libdw.m4 ++++ b/m4/st_libdw.m4 +@@ -8,7 +8,6 @@ + AC_DEFUN([st_ARG_LIBDW], [dnl + + : ${libdw_CPPFLAGS=} +-: ${libdw_CFLAGS=} + : ${libdw_LDFLAGS=} + : ${libdw_LIBS=} + +@@ -34,48 +33,14 @@ AC_DEFUN([st_LIBDW], [dnl + have_libdw= + + AS_IF([test "x$with_libdw" != xno && test "x$use_unwinder" = x], +- [saved_CPPFLAGS="$CPPFLAGS" +- saved_CFLAGS="$CFLAGS" +- CPPFLAGS="$CPPFLAGS $libdw_CPPFLAGS" +- CFLAGS="$CFLAGS $libdw_CFLAGS" +- +- AC_CHECK_HEADERS([elfutils/libdwfl.h], +- [AC_CHECK_LIB([dw], [dwfl_linux_proc_attach], +- [libdw_LIBS="-ldw $libdw_LIBS" +- AC_CACHE_CHECK([for elfutils version], +- [st_cv_ELFUTILS_VERSION], +- [[st_cv_ELFUTILS_VERSION="$(echo _ELFUTILS_VERSION | +- $CPP $CPPFLAGS -P -imacros elfutils/version.h - | +- grep '^[0-9]')" +- test -n "$st_cv_ELFUTILS_VERSION" || +- st_cv_ELFUTILS_VERSION=0 +- ]] +- ) +- AS_IF([test "$st_cv_ELFUTILS_VERSION" -ge 164], +- [have_libdw=yes], +- [AS_IF([test "x$with_libdw" = xyes], +- [AC_MSG_ERROR([elfutils version >= 164 is required for stack tracing support])], +- [AC_MSG_WARN([elfutils version >= 164 is required for stack tracing support])] +- ) +- ] +- ) +- ], +- [AS_IF([test "x$with_libdw" = xyes], +- [AC_MSG_FAILURE([failed to find dwfl_linux_proc_attach in libdw])], +- ) +- ], +- [$libdw_LDFLAGS $libdw_LIBS] +- ) +- ], +- [AS_IF([test "x$with_libdw" = xyes], +- [AC_MSG_FAILURE([failed to find elfutils/libdwfl.h])] +- ) +- ] +- ) +- +- CFLAGS="$saved_CFLAGS" +- CPPFLAGS="$saved_CPPFLAGS" +- ] ++ [if test "$enable_static" = "yes"; then ++ PKG_CHECK_MODULES_STATIC([LIBDW], [libdw >= 0.164]) ++ else ++ PKG_CHECK_MODULES([LIBDW], [libdw >= 0.164]) ++ fi ++ have_libdw=yes ++ libdw_CPPFLAGS="$LIBDW_CFLAGS" ++ libdw_LIBS="$LIBDW_LIBS"] + ) + + AS_IF([test "x$have_libdw" = xyes], +@@ -84,7 +49,6 @@ AS_IF([test "x$have_libdw" = xyes], + [Whether to use libdw for stack tracing] + ) + AC_SUBST(libdw_CPPFLAGS) +- AC_SUBST(libdw_CFLAGS) + AC_SUBST(libdw_LDFLAGS) + AC_SUBST(libdw_LIBS) + ] +--- a/m4/st_libunwind.m4 ++++ b/m4/st_libunwind.m4 +@@ -28,64 +28,14 @@ AC_ARG_WITH([libunwind], + AC_DEFUN([st_LIBUNWIND], [dnl + + AS_IF([test "x$with_libunwind" != xno && test "x$use_unwinder" = x], +- [saved_CPPFLAGS="$CPPFLAGS" +- CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS" +- +- AC_CHECK_HEADERS([libunwind-ptrace.h], +- [saved_LDFLAGS="$LDFLAGS" +- LDFLAGS="$LDFLAGS $libunwind_LDFLAGS" +- +- AC_CHECK_LIB([unwind], [backtrace], +- [libunwind_LIBS="-lunwind $libunwind_LIBS" +- +- AC_MSG_CHECKING([for unw_create_addr_space in libunwind-generic]) +- saved_LIBS="$LIBS" +- LIBS="-lunwind-generic $libunwind_LIBS $LIBS" +- +- AC_LINK_IFELSE( +- [AC_LANG_PROGRAM([[#include <libunwind-ptrace.h>]], +- [[return !unw_create_addr_space(0, 0)]]) +- ], +- [AC_MSG_RESULT([yes]) +- libunwind_LIBS="-lunwind-generic $libunwind_LIBS" +- +- AC_CHECK_LIB([unwind-ptrace], [_UPT_create], +- [libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS" +- use_unwinder=libunwind +- ], +- [if test "x$with_libunwind" != xcheck; then +- AC_MSG_FAILURE([failed to find _UPT_create in libunwind-ptrace]) +- fi +- ], +- [$libunwind_LIBS] +- ) +- ], +- [AC_MSG_RESULT([no]) +- if test "x$with_libunwind" != xcheck; then +- AC_MSG_FAILURE([failed to find unw_create_addr_space in libunwind-generic]) +- fi +- ] +- ) +- +- LIBS="$saved_LIBS" +- ], +- [if test "x$with_libunwind" != xcheck; then +- AC_MSG_FAILURE([failed to find libunwind]) +- fi +- ], +- [$libunwind_LIBS] +- ) +- +- LDFLAGS="$saved_LDFLAGS" +- ], +- [if test "x$with_libunwind" != xcheck; then +- AC_MSG_FAILURE([failed to find libunwind-ptrace.h]) +- fi +- ] +- ) +- +- CPPFLAGS="$saved_CPPFLAGS" +- ] ++ [if test "$enable_static" = "yes"; then ++ PKG_CHECK_MODULES_STATIC([LIBUNWIND], [libunwind libunwind-generic libunwind-ptrace]) ++ else ++ PKG_CHECK_MODULES([LIBUNWIND], [libunwind libunwind-generic libunwind-ptrace]) ++ fi ++ use_unwinder="libunwind" ++ libunwind_CPPFLAGS="$LIBUNWIND_CFLAGS" ++ libunwind_LIBS="$LIBUNWIND_LIBS"] + ) + + if test "x$use_unwinder" = xlibunwind; then +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -417,7 +417,6 @@ libstrace_a_SOURCES += unwind.c unwind.h + if USE_LIBDW + libstrace_a_SOURCES += unwind-libdw.c + strace_CPPFLAGS += $(libdw_CPPFLAGS) +-strace_CFLAGS += $(libdw_CFLAGS) + strace_LDFLAGS += $(libdw_LDFLAGS) + strace_LDADD += $(libdw_LIBS) + endif |