From 06eacc370d643d1c55e5bc49edf9bfa66876f34f Mon Sep 17 00:00:00 2001 From: Bernd Kuhls Date: Sun, 4 Jan 2026 12:05:06 +0100 Subject: [PATCH] package/brltty: fix musl build Fixes: https://autobuild.buildroot.net/results/76d/76d18437241d1281566b76ed1cec2ba99c3532da/ The build error was not introduced by the recent bump to 6.8. The oldest build error with the previous brltty version 6.6 used in buildroot dates back to 2023: https://autobuild.buildroot.net/results/78a/78a7fe6edfb84c2b15fff32aa475c975ecd5bdbc/ and with brltty 6.4 to 2022: https://autobuild.buildroot.net/results/a5b/a5b338ce9865fc7afaecd9b671e6a8f290548374/ Signed-off-by: Bernd Kuhls Signed-off-by: Thomas Petazzoni --- .../0004-check-for-functions-inb-outb.patch | 98 +++++++++++++++++++ package/brltty/brltty.mk | 1 + 2 files changed, 99 insertions(+) create mode 100644 package/brltty/0004-check-for-functions-inb-outb.patch diff --git a/package/brltty/0004-check-for-functions-inb-outb.patch b/package/brltty/0004-check-for-functions-inb-outb.patch new file mode 100644 index 0000000000..64f2a2d7a7 --- /dev/null +++ b/package/brltty/0004-check-for-functions-inb-outb.patch @@ -0,0 +1,98 @@ +From 876bdd3153c791a51422a43403143ff10acb6e82 Mon Sep 17 00:00:00 2001 +From: Bernd Kuhls +Date: Sat, 3 Jan 2026 15:35:48 +0100 +Subject: [PATCH] check for functions inb & outb + +Musl C library provides sys/io.h but inb and outb are missing on some +archs. This patch adds a configure check ported from sane-backends: +https://github.com/solanoalves/sane-backend/blob/059b97962ecb1b1ab068f524988d16c5b55bbd29/configure.ac#L314 +to fix build errors detected by buildroot autobuilders: +https://autobuild.buildroot.net/results/76d/76d18437241d1281566b76ed1cec2ba99c3532da//build-end.log + +./ports_glibc.c: In function 'readPort1': +./ports_glibc.c:54:10: error: implicit declaration of function 'inb' [-Wimplicit-function-declaration] + 54 | return inb(port); + | ^~~ +./ports_glibc.c: In function 'writePort1': +./ports_glibc.c:63:3: error: implicit declaration of function 'outb' [-Wimplicit-function-declaration] + 63 | outb(value, port); + | ^~~~ + +Upstream: https://github.com/brltty/brltty/commit/85cadac951cda709ce53d49923114595c16a8f16 + +Signed-off-by: Bernd Kuhls +--- + Programs/ports_glibc.c | 4 ++-- + config.h.in | 3 +++ + configure.ac | 19 +++++++++++++++++++ + 3 files changed, 24 insertions(+), 2 deletions(-) + +diff --git a/Programs/ports_glibc.c b/Programs/ports_glibc.c +index 4233f9ea0..4a57f626d 100644 +--- a/Programs/ports_glibc.c ++++ b/Programs/ports_glibc.c +@@ -50,7 +50,7 @@ disablePorts (unsigned short int base, unsigned short int count) { + + unsigned char + readPort1 (unsigned short int port) { +-#ifdef HAVE_SYS_IO_H ++#ifdef BRLTTY_HAVE_SYS_IO_H_WITH_INB_OUTB + return inb(port); + #else /* HAVE_SYS_IO_H */ + return 0; +@@ -59,7 +59,7 @@ readPort1 (unsigned short int port) { + + void + writePort1 (unsigned short int port, unsigned char value) { +-#ifdef HAVE_SYS_IO_H ++#ifdef BRLTTY_HAVE_SYS_IO_H_WITH_INB_OUTB + outb(value, port); + #endif /* HAVE_SYS_IO_H */ + } +diff --git a/config.h.in b/config.h.in +index 537d3af92..edea70cea 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -331,6 +331,9 @@ extern "C" { + /* Define this if the header file sys/io.h exists. */ + #undef HAVE_SYS_IO_H + ++/* Define to 1 if you have the providing inb,outb. */ ++#undef BRLTTY_HAVE_SYS_IO_H_WITH_INB_OUTB ++ + /* Define this if the header file sys/modem.h exists. */ + #undef HAVE_SYS_MODEM_H + +diff --git a/configure.ac b/configure.ac +index b78d482f6..0a2a70dd0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -961,6 +961,25 @@ AC_CHECK_FUNCS([shmget shm_open]) + AC_CHECK_FUNCS([getpeereid getpeerucred getzoneid]) + AC_CHECK_FUNCS([mempcpy wmempcpy]) + ++dnl sys/io.h might provide ioperm but not inb,outb (like for ++dnl non i386/x32/x86_64 with musl libc) ++if test "${ac_cv_header_sys_io_h}" = "yes"; then ++ AC_MSG_CHECKING([for inb,outb (provided by sys/io.h)]) ++ AC_LINK_IFELSE( ++ [AC_LANG_PROGRAM([[#include ]], ++ [[inb(0);outb(0,0);]])], ++ [AC_MSG_RESULT([yes]) ++ brltty_cv_have_sys_io_h_with_inb_outb="yes"], ++ [AC_MSG_RESULT([no]) ++ brltty_cv_have_sys_io_h_with_inb_outb="no" ++ AC_MSG_WARN([sys/io.h does not provide inb,outb (non i386/x32/x86_64 arch?)])]) ++ if test "$brltty_cv_have_sys_io_h_with_inb_outb" = "yes"; then ++ AC_DEFINE(BRLTTY_HAVE_SYS_IO_H_WITH_INB_OUTB, 1, [Define to 1 if you have the providing inb,outb.]) ++ fi ++else ++ brltty_cv_have_sys_io_h_with_inb_outb="no" ++fi ++ + case "${host_os}" + in + cygwin*|mingw*) +-- +2.47.3 + diff --git a/package/brltty/brltty.mk b/package/brltty/brltty.mk index 5e24288cbb..4952210121 100644 --- a/package/brltty/brltty.mk +++ b/package/brltty/brltty.mk @@ -40,6 +40,7 @@ BRLTTY_CONF_OPTS = \ # Autoreconf is needed because we're patching configure.ac in # 0001-Fix-linking-error-on-mips64el and # 0002-configure.ac-link-fv-driver-with-ltinfo-only-if-avai. +# 0004-check-for-functions-inb-outb.patch # However, a plain autoreconf doesn't work, because this package # is only autoconf-based. define BRLTTY_AUTOCONF