kumquat-buildroot/package/linux-tools/linux-tool-pci.mk.in
Fabrice Fontaine a29e7fb676 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 <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-11-07 23:08:55 +01:00

28 lines
754 B
Makefile

################################################################################
#
# pci
#
################################################################################
LINUX_TOOLS += pci
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 \
echo "Your kernel version is too old and does not have install section in the pci tools." ; \
echo "At least kernel 4.20 must be used." ; \
exit 1 ; \
fi
$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/pci \
$(PCI_MAKE_OPTS)
endef
define PCI_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/pci \
$(PCI_MAKE_OPTS) \
DESTDIR=$(TARGET_DIR) \
install
endef