From a29e7fb6765c0a08a3276a11a4da54dfdbdca703 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Sun, 6 Nov 2022 23:20:42 +0100 Subject: [PATCH] package/linux-tools: fix static build Pass TARGET_LDFLAGS (which contains -static) to fix the following static build failures with gpio, iio and pci: LINK lsgpio /home/autobuild/autobuild/instance-8/output-1/host/lib/gcc/arm-buildroot-linux-musleabi/10.4.0/../../../../arm-buildroot-linux-musleabi/bin/ld: /home/autobuild/autobuild/instance-8/output-1/host/lib/gcc/arm-buildroot-linux-musleabi/10.4.0/libgcc.a(_dvmd_lnx.o): in function `__aeabi_ldiv0': /home/autobuild/autobuild/instance-8/output-1/build/host-gcc-final-10.4.0/build/arm-buildroot-linux-musleabi/libgcc/../../../libgcc/config/arm/lib1funcs.S:1499: undefined reference to `raise' [...] LINK iio_event_monitor /home/thomas/autobuild/instance-2/output-1/host/lib/gcc/microblazeel-buildroot-linux-musl/11.3.0/../../../../microblazeel-buildroot-linux-musl/bin/ld: /home/thomas/autobuild/instance-2/output-1/host/lib/gcc/microblazeel-buildroot-linux-musl/11.3.0/libgcc.a(unwind-dw2.o): in function `size_of_encoded_value': /home/thomas/autobuild/instance-2/output-1/build/host-gcc-final-11.3.0/build/microblazeel-buildroot-linux-musl/libgcc/../../../libgcc/unwind-pe.h:88: undefined reference to `abort' Fixes: - http://autobuild.buildroot.org/results/f202eb843ef331939f5f12325bdbf2d0d664a7ce - http://autobuild.buildroot.org/results/504ec8be1ebd15c5da09f8b90bb723a58d4c58c5 Signed-off-by: Fabrice Fontaine Signed-off-by: Thomas Petazzoni --- package/linux-tools/linux-tool-gpio.mk.in | 2 +- package/linux-tools/linux-tool-iio.mk.in | 2 +- package/linux-tools/linux-tool-pci.mk.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package/linux-tools/linux-tool-gpio.mk.in b/package/linux-tools/linux-tool-gpio.mk.in index d5a0dbda38..e825db1b11 100644 --- a/package/linux-tools/linux-tool-gpio.mk.in +++ b/package/linux-tools/linux-tool-gpio.mk.in @@ -6,7 +6,7 @@ LINUX_TOOLS += gpio -GPIO_MAKE_OPTS = $(LINUX_MAKE_FLAGS) +GPIO_MAKE_OPTS = $(LINUX_MAKE_FLAGS) LDFLAGS="$(TARGET_LDFLAGS)" define GPIO_BUILD_CMDS $(Q)if ! grep install $(LINUX_DIR)/tools/gpio/Makefile >/dev/null 2>&1 ; then \ diff --git a/package/linux-tools/linux-tool-iio.mk.in b/package/linux-tools/linux-tool-iio.mk.in index a8cc89e830..27ab0ed7ed 100644 --- a/package/linux-tools/linux-tool-iio.mk.in +++ b/package/linux-tools/linux-tool-iio.mk.in @@ -6,7 +6,7 @@ LINUX_TOOLS += iio -IIO_MAKE_OPTS = $(LINUX_MAKE_FLAGS) +IIO_MAKE_OPTS = $(LINUX_MAKE_FLAGS) LDFLAGS="$(TARGET_LDFLAGS)" define IIO_BUILD_CMDS $(Q)if ! grep install $(LINUX_DIR)/tools/iio/Makefile >/dev/null 2>&1 ; then \ diff --git a/package/linux-tools/linux-tool-pci.mk.in b/package/linux-tools/linux-tool-pci.mk.in index 4ef0368a32..17246f5d7e 100644 --- a/package/linux-tools/linux-tool-pci.mk.in +++ b/package/linux-tools/linux-tool-pci.mk.in @@ -6,7 +6,7 @@ LINUX_TOOLS += pci -PCI_MAKE_OPTS = $(LINUX_MAKE_FLAGS) +PCI_MAKE_OPTS = $(LINUX_MAKE_FLAGS) LDFLAGS="$(TARGET_LDFLAGS)" define PCI_BUILD_CMDS $(Q)if ! grep install $(LINUX_DIR)/tools/pci/Makefile >/dev/null 2>&1 ; then \