[Buildroot] [PATCH 1/1] package/sg3_utils: fix uclibc-ng build

Fabrice Fontaine fontaine.fabrice at gmail.com
Tue Nov 16 17:13:13 UTC 2021


Fix the following build failure raised since bump to version 1.47 in
commit 710b0eaebeb25d7718bfb10e87f0d67adfaf8c2f:

/home/buildroot/autobuild/instance-3/output-1/host/opt/ext-toolchain/arm-buildroot-uclinux-uclibcgnueabi/bin/ld.real: sg_dd.o: in function `sg_read_low.constprop.0':
sg_dd.c:(.text+0xc6c): undefined reference to `sg_chk_n_print3'

Fixes:
 - http://autobuild.buildroot.org/results/38a0dfc70a21ce574368b7a485deb231f778b3e7

Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
---
 ...002-configure.ac-fix-uclibc-ng-build.patch | 36 +++++++++++++++++++
 package/sg3_utils/sg3_utils.mk                |  2 ++
 2 files changed, 38 insertions(+)
 create mode 100644 package/sg3_utils/0002-configure.ac-fix-uclibc-ng-build.patch

diff --git a/package/sg3_utils/0002-configure.ac-fix-uclibc-ng-build.patch b/package/sg3_utils/0002-configure.ac-fix-uclibc-ng-build.patch
new file mode 100644
index 0000000000..4c475ee1ff
--- /dev/null
+++ b/package/sg3_utils/0002-configure.ac-fix-uclibc-ng-build.patch
@@ -0,0 +1,36 @@
+From 1e95d5b8c507a49f6d15d2795dc46d82b4d1ded0 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice at gmail.com>
+Date: Tue, 16 Nov 2021 08:41:48 +0100
+Subject: [PATCH] configure.ac: fix uclibc-ng build
+
+Fix the following build failure with uclibc-ng raised because SG_IO is
+not defined:
+
+/home/buildroot/autobuild/instance-3/output-1/host/opt/ext-toolchain/arm-buildroot-uclinux-uclibcgnueabi/bin/ld.real: sg_dd.o: in function `sg_read_low.constprop.0':
+sg_dd.c:(.text+0xc6c): undefined reference to `sg_chk_n_print3'
+
+Fixes:
+ - http://autobuild.buildroot.org/results/38a0dfc70a21ce574368b7a485deb231f778b3e7
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
+[Upstream status: https://github.com/doug-gilbert/sg3_utils/pull/8]
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0a65d94..23378ad 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -107,7 +107,7 @@ case "${host}" in
+ 		AC_DEFINE_UNQUOTED(HAVE_NVME, 1, [Found NVMe])
+ 		check_for_getrandom
+                 CFLAGS="$CFLAGS -D__USE_MINGW_ANSI_STDIO";;
+-        *-*-linux-gnu* | *-*-linux*)
++        *-*-linux-gnu* | *-*-linux* | *-*-uclinux-gnu* | *-*-uclinux*)
+                 AC_DEFINE_UNQUOTED(SG_LIB_LINUX, 1, [sg3_utils on linux])
+ 		check_for_linux_sg_v4_hdr
+ 		check_for_getrandom
+-- 
+2.33.0
+
diff --git a/package/sg3_utils/sg3_utils.mk b/package/sg3_utils/sg3_utils.mk
index 055f7befb9..e357fc1dde 100644
--- a/package/sg3_utils/sg3_utils.mk
+++ b/package/sg3_utils/sg3_utils.mk
@@ -13,6 +13,8 @@ ifeq ($(BR2_PACKAGE_SG3_UTILS_PROGS),y)
 SG3_UTILS_LICENSE += , GPL-2.0+ (programs), BSD-2-Clause (programs)
 endif
 SG3_UTILS_LICENSE_FILES = COPYING BSD_LICENSE
+# We're patching configure.ac
+SG3_UTILS_AUTORECONF = YES
 
 # install the libsgutils2 library
 SG3_UTILS_INSTALL_STAGING = YES
-- 
2.33.0



More information about the buildroot mailing list