lmbench: fix build with libtirpc
PATCH v4 1/1 lmbench: fix build with libtirpc
When linking with an external libtirpc, -ltirpc must come after lmbench.a in the linker command line. Use LDLIBS for that.
Fixes:
http://autobuild.buildroot.net/results/89e/89ee35561d3a49f38e9a747ed78a5846be4764c8/
http://autobuild.buildroot.net/results/409/4097b1c2585db2de517a8741174c02177aabee00/
and more.
Also, remove LMBENCH_LDLIBS assignment. This variable was not used before.
---
v4:
Add a comment in the commit log on LMBENCH_LDLIBS removal (Fabio Porcedda) Add Fabio's review and test tags
v3:
Edit scripts/build with sed instead of using a patch (Fabio Porcedda)
v2:
Rebase on current master (Fabio Porcedda)
--- package/lmbench/lmbench.mk | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
package/lmbench/lmbench.mk +6 -3
@@ -11,24 +11,27 @@ LMBENCH_LICENSE = lmbench license (based on GPLv2) LMBENCH_LICENSE_FILES = COPYING COPYING-2 LMBENCH_CFLAGS = $(TARGET_CFLAGS) -LMBENCH_LDLIBS = $(TARGET_LDFLAGS) ifeq ($(BR2_PACKAGE_LIBTIRPC),y) LMBENCH_DEPENDENCIES += host-pkgconf libtirpc LMBENCH_CFLAGS += $(shell $(PKG_CONFIG_HOST_BINARY) --cflags libtirpc) -LMBENCH_LDFLAGS += $(shell $(PKG_CONFIG_HOST_BINARY) --libs libtirpc) +LMBENCH_LDLIBS = $(shell $(PKG_CONFIG_HOST_BINARY) --libs libtirpc) endif define LMBENCH_CONFIGURE_CMDS $(call CONFIG_UPDATE,$(@D)) sed -i 's/CFLAGS=/CFLAGS+=/g' $(@D)/src/Makefile + sed -i 's/LDLIBS=/LDLIBS+=/g' $(@D)/scripts/build sed -i '/cd .*doc/d' $(@D)/src/Makefile sed -i '/include/d' $(@D)/src/Makefile touch $@ endef +# Note: there is a second stage 'make' invocation from the 'scripts/build' +# script. So the variables override below don't take direct effect in +# src/Makefile. define LMBENCH_BUILD_CMDS - $(MAKE) CFLAGS="$(LMBENCH_CFLAGS)" LDFLAGS="$(LMBENCH_LDFLAGS)" OS=$(ARCH) CC="$(TARGET_CC)" -C $(@D)/src + $(MAKE) CFLAGS="$(LMBENCH_CFLAGS)" LDLIBS="$(LMBENCH_LDLIBS)" OS=$(ARCH) CC="$(TARGET_CC)" -C $(@D)/src endef define LMBENCH_INSTALL_TARGET_CMDS
Signature · 1 line
2.1.4
Thomas Petazzoni
AppliedPATCH v4 1/1 lmbench: fix build with libtirpc
Dear Baruch Siach,
Quoted 7 lines · Baruch Siach
When linking with an external libtirpc, -ltirpc must come after lmbench.a in the linker command line. Use LDLIBS for that.
Fixes:
http://autobuild.buildroot.net/results/89e/89ee35561d3a49f38e9a747ed78a5846be4764c8/
http://autobuild.buildroot.net/results/409/4097b1c2585db2de517a8741174c02177aabee00/
Quoted 7 lines
and more.
Also, remove
LMBENCH_LDLIBSassignment. This variable was not used before.Reviewed-by Fabio Porcedda <[email protected]>Tested-by Fabio Porcedda <[email protected]>Signed-off-by Baruch Siach <[email protected]>
Applied, thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com