From 88c25e87a1591c836cc384f91d38628e0b5d7800 Mon Sep 17 00:00:00 2001 From: Ian Cooper Date: Mon, 27 Apr 2020 22:48:53 +0100 Subject: [PATCH] irqbalance: fix compilation for USE_GLIBC and BUILD_NLS cases The package Makefile was not taking into consideration that the build may be using BUILD_NLS with libintl-full and libiconv-full and was trying to link the wrong versions of these libraries in this case. The necessary flags are added by nls.mk to TARGET_LDFLAGS and can be passed to irqbalance's configure script for setting the GLIB2_LIBS variable instead of the explicit static link to the libiconv stub. The PKG_BUILD_DEPENDS line should be modified so as to add to and not override the definition set by nls.mk, which will ensure the right version of libiconv and libintl is built beforehand. A DEPENDS:= line should be added to the package definition using the variables defined in nls.mk, which will add the appropriate version of libintl and libiconv (vanilla or -full versions) If USE_GLIBC is true, then libpthread needs to be explicitly passed to the configure script in the GLIB2_LIBS variable for linking. Signed-off-by: Ian Cooper --- utils/irqbalance/Makefile | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/utils/irqbalance/Makefile b/utils/irqbalance/Makefile index 88172afdd..c3fb14e3c 100644 --- a/utils/irqbalance/Makefile +++ b/utils/irqbalance/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=irqbalance PKG_VERSION:=1.6.0 -PKG_RELEASE:=7 +PKG_RELEASE:=8 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_PROTO:=git @@ -23,15 +23,16 @@ PKG_REMOVE_FILES:=autogen.sh PKG_BUILD_PARALLEL:=1 -# -liconv due to glib2, to be revisited later include $(INCLUDE_DIR)/nls.mk include $(INCLUDE_DIR)/package.mk +PKG_BUILD_DEPENDS += glib2 + define Package/irqbalance - PKG_BUILD_DEPENDS:=glib2 SECTION:=utils CATEGORY:=Utilities + DEPENDS:=$(ICONV_DEPENDS) $(INTL_DEPENDS) TITLE:=IRQ usage balancing for multi-core systems URL:=https://github.com/Irqbalance/irqbalance endef @@ -49,9 +50,19 @@ CONFIGURE_ARGS+= \ --without-irqbalance-ui \ --enable-static=glib2 +GLIB2_LIBS="$(STAGING_DIR)/usr/lib/libglib-2.0.a" + +ifeq ($(CONFIG_BUILD_NLS),y) + GLIB2_LIBS += $(INTL_LDFLAGS) -lintl +endif + +ifeq ($(CONFIG_USE_GLIBC),y) + GLIB2_LIBS += -lpthread +endif + CONFIGURE_VARS += \ - GLIB2_LIBS="$(STAGING_DIR)/usr/lib/libglib-2.0.a \ - $(STAGING_DIR)/usr/lib/libiconv-stub/lib/libiconv.a" + GLIB2_LIBS="$(GLIB2_LIBS) \ + $(ICONV_LDFLAGS) -liconv" define Package/irqbalance/install $(INSTALL_DIR) $(1)/usr/sbin