From 8f0972e9b79271b05099467f40afc729f7983d2c Mon Sep 17 00:00:00 2001 From: q66 Date: Wed, 18 Dec 2019 04:36:29 +0100 Subject: [PATCH] freeipmi: fix build on non-x86 musl --- .../patches/fix-build-musl-non-x86.patch | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 srcpkgs/freeipmi/patches/fix-build-musl-non-x86.patch diff --git a/srcpkgs/freeipmi/patches/fix-build-musl-non-x86.patch b/srcpkgs/freeipmi/patches/fix-build-musl-non-x86.patch new file mode 100644 index 0000000000..0389182dad --- /dev/null +++ b/srcpkgs/freeipmi/patches/fix-build-musl-non-x86.patch @@ -0,0 +1,23 @@ +Musl, unlike glibc, provides inb/outb but only on x86. +Additionally, the iopl call is generally useless outside x86. + +--- libfreeipmi/driver/ipmi-kcs-driver.c ++++ libfreeipmi/driver/ipmi-kcs-driver.c +@@ -162,7 +162,7 @@ + #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) + # define _INB(port) inb (port) + # define _OUTB(data, port) outb (port, data) +-#elif defined(HAVE_IOPL) ++#elif defined(HAVE_IOPL) && (defined(__x86_64__) || defined(__i386__)) + # define _INB(port) inb (port) + # define _OUTB(data, port) outb (data, port) + #else +@@ -509,7 +508,7 @@ ipmi_kcs_ctx_io_init (ipmi_kcs_ctx_t ctx) + } + #endif /* !USE_IOPERM */ + #else /* !__FreeBSD__ */ +-#if HAVE_IOPL ++#if defined(HAVE_IOPL) && (defined(__x86_64__) || defined(__i386__)) + if (iopl (3) < 0) + { + KCS_ERRNO_TO_KCS_ERRNUM (ctx, errno);