package/htop: not available for uClibc static builds
PATCH 1/1 package/htop: not available for uClibc static builds
htop wants to use backtrace() when available.
However, on uClibc this causes two problems:
- backtrace() is not in libc but in a separate library, libubacktrace
- backtrace() uses dladdr() which is not available for static builds
The first point is easy to solve with a bit of hackery in configure.ac, with AC_SEARCH_LIBS([backtrace], [ubacktrace] ...).
The second point is more tricky, as this can not easily be solved with simple autotools macros. Instead, we just shoehorn -ldl in the LIBS variable from htop.mk when doing a uClibc static build.
Fixes:
http://autobuild.buildroot.org/results/cde/cdea351fad7a0f61ddec3e6a141da8da0523a902/
---
It is to be noted that a dynamic build does not need -lubacktrace. Weird...
--- package/htop/0001-check-backtrace-lib.patch | 18 ++++++++++++++++++ package/htop/htop.mk | 6 ++++++ 2 files changed, 24 insertions(+) create mode 100644 package/htop/0001-check-backtrace-lib.patch
package/htop/0001-check-backtrace-lib.patch new file +18 -0
@@ -0,0 +1,18 @@ +diff --git a/configure.ac b/configure.ac +index eb055b5..2864e91 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -59,7 +59,12 @@ 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], ++ # Some libces (e.g. uClibc) may have backtrace() in a helper library ++ [AC_SEARCH_LIBS([backtrace], [ubacktrace], ++ [], [AC_MSG_ERROR([cannot find a library providing backtrace()])])], ++ [:]) ++ + + # Checks for typedefs, structures, and compiler characteristics. + # ----------------------------------------------------------------------
package/htop/htop.mk +6 -0
@@ -12,6 +12,12 @@ HTOP_CONF_ENV = HTOP_NCURSES_CONFIG_SCRIPT=$(STAGING_DIR)/usr/bin/ncurses5-confi HTOP_LICENSE = GPLv2 HTOP_LICENSE_FILES = COPYING +HTOP_AUTORECONF = YES + +ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC)$(BR2_STATIC_LIBS),yy) +HTOP_CONF_OPTS += LIBS=-ldl +endif + ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y) HTOP_CONF_OPTS += --enable-unicode else
Signature · 1 line
2.7.4
PATCH 1/1 package/htop: not available for uClibc static builds
Hello,
package/htop/htop.mk HTOP_CONF_ENV = HTOP_NCURSES_CONFIG_SCRIPT=$(STAGING_DIR)/usr/bin/ncurses5-confi · line 19
Quoted 3 lines · Yann E. MORIN
package/htop/htop.mk +3
-0+ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC)$(BR2_STATIC_LIBS),yy) +HTOP_CONF_OPTS += LIBS=-ldl +endif
Using libdl when BR2_STATIC_LIBS=y ? This seems odd, no ?
Is libdl even available on noMMU architectures that only support the FLAT binary format ?
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 1/1 package/htop: not available for uClibc static builds
In reply to Yann E. MORINHi,
Yann E. MORIN wrote,
Quoted 5 lines
htop wants to use
backtrace()when available.However, on uClibc this causes two problems:
-
backtrace()is not in libc but in a separate library, libubacktrace
Not in the version Buildroot's internal toolchain uses now. But it is only available when UCLIBC_HAS_BACKTRACE is enabled.
It seems Synopsis external toolchain uses an old uClibc-ng version before extra libubacktrace library was included in libc.a/libc.so.
best regards
Waldemar