tag 508265 + fixed-upstream thanksThis was fixed in 1.0.12 upstream. In fact, this is the only source change between 1.0.11 and 1.0.12. The other difference is that the configure is compiled with autoconf 2.63 instead of 2.61, and an autoconf-generated “compile” script was added. A diff between the upstream versions (excluding ./configure) is attached.
The upstream change is slightly different from Stefan’s patch in that the #ifs have been reordered, but is functionally equivalent. We could add the upstream change as a dpatch, or we could upgrade the package to 1.0.12. The latter approach seems cleaner.
Assuming we decide to run with 1.0.12, I have attached a debdiff that updates the context in one of the dpatches against the regenerated ./configure in 1.0.12. I’ve verified that the binary packages build and that the kernel module builds and loads on amd64.
Only in sysprof-1.0.12: compile diff -ur --exclude=configure sysprof-1.0.11/configure.ac sysprof-1.0.12/configure.ac --- sysprof-1.0.11/configure.ac 2008-10-24 19:06:21.000000000 -0400 +++ sysprof-1.0.12/configure.ac 2008-12-03 20:48:51.000000000 -0500 @@ -1,6 +1,6 @@ AC_PREREQ(2.54) -AC_INIT([sysprof], [1.0.11]) +AC_INIT([sysprof], [1.0.12]) AC_CONFIG_SRCDIR(sysprof.glade) AM_INIT_AUTOMAKE(no-define) diff -ur --exclude=configure sysprof-1.0.11/Makefile.in sysprof-1.0.12/Makefile.in --- sysprof-1.0.11/Makefile.in 2008-10-24 19:06:47.000000000 -0400 +++ sysprof-1.0.12/Makefile.in 2008-12-03 20:48:54.000000000 -0500 @@ -194,8 +194,8 @@ check-recursive installcheck-recursive DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/configure AUTHORS \ COPYING ChangeLog INSTALL Makefile.am NEWS TODO aclocal.m4 \ - config.h.in configure configure.ac depcomp install-sh missing \ - mkinstalldirs + compile config.h.in configure configure.ac depcomp install-sh \ + missing mkinstalldirs SOURCES = $(sysprof_SOURCES) all: config.h diff -ur --exclude=configure sysprof-1.0.11/module/sysprof-module.c sysprof-1.0.12/module/sysprof-module.c --- sysprof-1.0.11/module/sysprof-module.c 2008-10-24 19:13:13.000000000 -0400 +++ sysprof-1.0.12/module/sysprof-module.c 2008-12-03 20:49:53.000000000 -0500 @@ -67,25 +67,27 @@ DECLARE_WAIT_QUEUE_HEAD (wait_for_exit); /* Macro the names of the registers that are used on each architecture */ -#if defined(CONFIG_X86_64) -# define REG_FRAME_PTR rbp -# define REG_INS_PTR rip -# define REG_STACK_PTR rsp -# define REG_STACK_PTR0 rsp0 -#elif defined(CONFIG_X86) -# if LINUX_VERSION_CODE >= KERNEL_VERSION (2,6,25) -# define REG_FRAME_PTR bp -# define REG_INS_PTR ip -# define REG_STACK_PTR sp -# define REG_STACK_PTR0 sp0 +#if !defined(CONFIG_X86_64) && !defined(CONFIG_X86) +# error Sysprof only supports the i386 and x86-64 architectures +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION (2,6,25) +# define REG_FRAME_PTR bp +# define REG_INS_PTR ip +# define REG_STACK_PTR sp +# define REG_STACK_PTR0 sp0 +#else +# if defined(CONFIG_X86_64) +# define REG_FRAME_PTR rbp +# define REG_INS_PTR rip +# define REG_STACK_PTR rsp +# define REG_STACK_PTR0 rsp0 # else # define REG_FRAME_PTR ebp # define REG_INS_PTR eip # define REG_STACK_PTR esp # define REG_STACK_PTR0 esp0 # endif -#else -# error Sysprof only supports the i386 and x86-64 architectures #endif typedef struct userspace_reader userspace_reader;
diff -ur sysprof-1.0.11.debian/debian/changelog sysprof-1.0.12.debian/debian/changelog --- sysprof-1.0.11.debian/debian/changelog 2008-12-13 16:31:42.000000000 -0500 +++ sysprof-1.0.12.debian/debian/changelog 2008-12-13 16:46:19.000000000 -0500 @@ -1,3 +1,10 @@ +sysprof (1.0.12-0.1) unstable; urgency=low + + * New upstream release. + + Fix compiling on amd64 with kernel >= 2.6.25 (Closes: #508265). + + -- Anders Kaseorg <ande...@mit.edu> Sat, 13 Dec 2008 16:44:40 -0500 + sysprof (1.0.11-0.1) unstable; urgency=low * Non-maintainer upload. diff -ur sysprof-1.0.11.debian/debian/patches/static_libbfd.dpatch sysprof-1.0.12.debian/debian/patches/static_libbfd.dpatch --- sysprof-1.0.11.debian/debian/patches/static_libbfd.dpatch 2008-12-13 16:31:42.000000000 -0500 +++ sysprof-1.0.12.debian/debian/patches/static_libbfd.dpatch 2008-12-13 16:53:12.000000000 -0500 @@ -9,14 +9,14 @@ --- sysprof-1.0.9~/configure 2007-10-21 23:42:22.000000000 +0200 +++ sysprof-1.0.9/configure 2008-01-25 19:19:41.000000000 +0100 @@ -3759,7 +3759,7 @@ - { echo "$as_me:$LINENO: result: $ac_cv_lib_bfd_bfd_get_error" >&5 - echo "${ECHO_T}$ac_cv_lib_bfd_bfd_get_error" >&6; } - if test $ac_cv_lib_bfd_bfd_get_error = yes; then + { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bfd_bfd_get_error" >&5 + $as_echo "$ac_cv_lib_bfd_bfd_get_error" >&6; } + if test "x$ac_cv_lib_bfd_bfd_get_error" = x""yes; then - DEP_LIBS="$DEP_LIBS -lbfd -liberty" + DEP_LIBS="$DEP_LIBS /usr/lib/libbfd.a -liberty" else - { { echo "$as_me:$LINENO: error: libbfd is required to compile sysprof" >&5 - echo "$as_me: error: libbfd is required to compile sysprof" >&2;} + { { $as_echo "$as_me:$LINENO: error: libbfd is required to compile sysprof" >&5 + $as_echo "$as_me: error: libbfd is required to compile sysprof" >&2;} diff -urNad sysprof-1.0.9~/configure.ac sysprof-1.0.9/configure.ac --- sysprof-1.0.9~/configure.ac 2007-10-21 23:42:16.000000000 +0200 +++ sysprof-1.0.9/configure.ac 2008-01-25 19:19:41.000000000 +0100