From 8e7cd6279c90a73ffbe951f1fb238c46d24499cc Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Wed, 7 Aug 2019 16:44:04 +0100 Subject: [PATCH] lm_sensors: fix glibc-2.30 --- .../patches/lm_sensors-02-PR192.patch | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 packages/addons/addon-depends/system-tools-depends/lm_sensors/patches/lm_sensors-02-PR192.patch diff --git a/packages/addons/addon-depends/system-tools-depends/lm_sensors/patches/lm_sensors-02-PR192.patch b/packages/addons/addon-depends/system-tools-depends/lm_sensors/patches/lm_sensors-02-PR192.patch new file mode 100644 index 0000000000..aa177b5493 --- /dev/null +++ b/packages/addons/addon-depends/system-tools-depends/lm_sensors/patches/lm_sensors-02-PR192.patch @@ -0,0 +1,48 @@ +From ee1aba92d670701b2aa3d798f1c3c84061eca554 Mon Sep 17 00:00:00 2001 +From: Lucas Magasweran +Date: Wed, 7 Aug 2019 14:43:23 +0200 +Subject: [PATCH] makefile: use target arch when determining what programs to + compile + +`uname -m` lists the host machine architecture. To support cross-compilation +the Makefile should detect the compiler's target architecture. This approach +uses the `gcc`/`clang` compatible `-dumpmachine` option and parses the first +word in the tuple representing the target architecture. + +Renaming `MACHINE` to `ARCH` to match cross-compiler conventions for +specifying the target architecture (e.g. +`make ARCH=arm CC=arm-linux-gnueabi-gcc`) + +Just like for PPC the `isadump` and `isaset` tools should not be compiled +on ARM. This has the side affect of "fixing" the ARM build with glibc-2.30, +which removed `sys/io.h` I/O port functions. + +Fixes #190 + +Signed-off-by: Lucas Magasweran +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 2f5859f0..47ffe788 100644 +--- a/Makefile ++++ b/Makefile +@@ -77,7 +77,7 @@ LIBINCLUDEDIR := $(INCLUDEDIR)/sensors + # manual pages will be installed. + MANDIR := $(PREFIX)/man + +-MACHINE := $(shell uname -m) ++ARCH := $(firstword $(subst -, ,$(shell $(CC) -dumpmachine))) + + # Extra non-default programs to build; e.g., sensord + #PROG_EXTRA := sensord +@@ -109,7 +109,7 @@ BUILD_STATIC_LIB := 1 + SRCDIRS := lib prog/detect prog/pwm \ + prog/sensors ${PROG_EXTRA:%=prog/%} etc + # Only build isadump and isaset on x86 machines. +-ifneq (,$(findstring $(MACHINE), i386 i486 i586 i686 x86_64)) ++ifneq (,$(findstring $(ARCH), i386 i486 i586 i686 x86_64)) + SRCDIRS += prog/dump + endif + SRCDIRS += lib/test