void-packages/srcpkgs/freeipmi/patches/fix-build-musl-non-x86.patch

24 lines
842 B
Diff

Musl, unlike glibc, provides inb/outb but only on x86.
Additionally, the iopl call is generally useless outside x86.
--- a/libfreeipmi/driver/ipmi-kcs-driver.c
+++ b/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);