Summary: | sys-process/htop-2.1.0 - htop-Process.o: In function `Process_writeField': Process.c:(.text+0xe4b): undefined reference to `minor' | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Piotr Karbowski (RETIRED) <slashbeast> |
Component: | Current packages | Assignee: | Christian Ruppert (idl0r) <idl0r> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bkohler, dschridde+gentoobugs, polynomial-c |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | htop-2.1.0-check-sysmacros.patch |
Description
Piotr Karbowski (RETIRED)
![]() I think HAVE_SYS_SYSMACROS_H doesn't get defined unless we put sys/sysmacros.h into AC_CHECK_HEADERS in configure.ac. Maybe something like this: --- a/configure.ac +++ b/configure.ac @@ -56,7 +56,7 @@ # ---------------------------------------------------------------------- AC_HEADER_DIRENT AC_HEADER_STDC -AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h],[:],[ +AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/param.h sys/sysmacros.h sys/time.h unistd.h],[:],[ missing_headers="$missing_headers $ac_header" ]) AC_CHECK_HEADERS([execinfo.h],[:],[:]) --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -25,6 +25,7 @@ #include <time.h> #include <assert.h> #include <sys/types.h> +#include <sys/sysmacros.h> #include <fcntl.h> #ifdef HAVE_DELAYACCT --- a/Process.c +++ b/Process.c @@ -19,6 +19,9 @@ #include <sys/param.h> #include <sys/stat.h> #include <sys/types.h> +#ifdef HAVE_SYS_SYSMACROS_H +# include <sys/sysmacros.h> /* for major, minor */ +#endif #include <unistd.h> #include <stdlib.h> #include <signal.h> Seems like it's the case. I can build htop with your patch. I'm not sure this patch is technically correct since autoreconf will die if sys/sysmacros.h is missing, rather than just detect it's missing and not define HAVE_SYS_SYSMACROS_H for that case. But someone with more autotools skills will have to chime in here, I think. (In reply to Ben Kohler from comment #3) > I'm not sure this patch is technically correct since autoreconf will die if > sys/sysmacros.h is missing, rather than just detect it's missing and not > define HAVE_SYS_SYSMACROS_H for that case. > > But someone with more autotools skills will have to chime in here, I think. You are right: if test ! -z "$missing_headers"; then AC_MSG_ERROR([missing headers: $missing_headers]) fi The solution is to patch it like this: # Checks for header files. # ---------------------------------------------------------------------- AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h],[:],[ missing_headers="$missing_headers $ac_header" ]) -AC_CHECK_HEADERS([execinfo.h],[:],[:]) +AC_CHECK_HEADERS([execinfo.h sys/sysmacros.h],[:],[:]) # Checks for typedefs, structures, and compiler characteristics. In that case sys/sysmacros.h is not added to the headers configure.ac bails on when missing, but it just passes and goes on (`:`) instead. Created attachment 520968 [details, diff]
htop-2.1.0-check-sysmacros.patch
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=711f07a43b5e011123a93e7b09edcdce1008f4cd commit 711f07a43b5e011123a93e7b09edcdce1008f4cd Author: Lars Wendler <polynomial-c@gentoo.org> AuthorDate: 2018-02-26 12:34:55 +0000 Commit: Lars Wendler <polynomial-c@gentoo.org> CommitDate: 2018-02-26 12:34:55 +0000 sys-process/htop: Replaced sysmacros patch with a much better one. See https://github.com/hishamhm/htop/pull/746 Closes: https://bugs.gentoo.org/648630 Package-Manager: Portage-2.3.24, Repoman-2.3.6 sys-process/htop/files/htop-2.1.0-sysmacros.patch | 91 ++++++++++++++++------- 1 file changed, 66 insertions(+), 25 deletions(-) |