From 4caa10faa85c1d67c91fc6870ce8956471e74e9d Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 8 Jan 2024 20:12:39 -0800 Subject: tgt: Fix build with musl Signed-off-by: Khem Raj --- .../tgt/files/musl-__wordsize.patch | 41 ++++++++++++++++++++++ meta-networking/recipes-extended/tgt/tgt_1.0.90.bb | 6 ++-- 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 meta-networking/recipes-extended/tgt/files/musl-__wordsize.patch diff --git a/meta-networking/recipes-extended/tgt/files/musl-__wordsize.patch b/meta-networking/recipes-extended/tgt/files/musl-__wordsize.patch new file mode 100644 index 0000000000..ac758cc39d --- /dev/null +++ b/meta-networking/recipes-extended/tgt/files/musl-__wordsize.patch @@ -0,0 +1,41 @@ +The definition of __WORDSIZE is found in + +Upstream-Status: Pending +Signed-off-by: Khem Raj + +--- a/usr/iscsi/iscsid.h ++++ b/usr/iscsi/iscsid.h +@@ -22,6 +22,9 @@ + #include + #include + #include ++#if !defined(__GLIBC__) ++#include ++#endif + + #include "transport.h" + #include "list.h" +--- a/usr/tgtd.h ++++ b/usr/tgtd.h +@@ -1,6 +1,9 @@ + #ifndef __TARGET_DAEMON_H + #define __TARGET_DAEMON_H + ++#if !defined(__GLIBC__) ++#include ++#endif + #include "log.h" + #include "scsi_cmnd.h" + #include "tgtadm_error.h" +--- a/usr/util.h ++++ b/usr/util.h +@@ -19,6 +19,9 @@ + #include + #include + #include ++#if !defined(__GLIBC__) ++#include ++#endif + + #include "be_byteshift.h" + diff --git a/meta-networking/recipes-extended/tgt/tgt_1.0.90.bb b/meta-networking/recipes-extended/tgt/tgt_1.0.90.bb index f68ae99db5..35995f7876 100644 --- a/meta-networking/recipes-extended/tgt/tgt_1.0.90.bb +++ b/meta-networking/recipes-extended/tgt/tgt_1.0.90.bb @@ -7,9 +7,10 @@ DEPENDS = "sg3-utils libaio" SRCREV = "df991fa788e22cd8b8e3013cfae306988c19c3d0" SRC_URI = "git://github.com/fujita/tgt.git;branch=master;protocol=https \ - file://0001-Correct-the-path-of-header-files-check-in-Yocto-buil.patch \ + file://0001-Correct-the-path-of-header-files-check-in-Yocto-buil.patch \ file://0001-usr-Makefile-WARNING-fix.patch \ file://usr-Makefile-apply-LDFLAGS-to-all-executables.patch \ + file://musl-__wordsize.patch \ " SRC_URI += "file://tgtd.init \ file://tgtd.service \ @@ -18,8 +19,6 @@ SRC_URI += "file://tgtd.init \ S = "${WORKDIR}/git" -COMPATIBLE_HOST:libc-musl = "null" - CONFFILES:${PN} += "${sysconfdir}/tgt/targets.conf" inherit update-rc.d systemd @@ -29,6 +28,7 @@ SYSTEMD_AUTO_ENABLE:${PN} = "disable" CFLAGS += ' -I. -DUSE_SIGNALFD -DUSE_TIMERFD -D_GNU_SOURCE -DTGT_VERSION=\\"1.0.63\\" -DBSDIR=\\"${libdir}/backing-store\\"' +CFLAGS:append:libc-musl = " -D_LARGEFILE64_SOURCE" #do_compile() { # oe_runmake SYSROOT="${STAGING_DIR_TARGET}" -e programs conf scripts #} -- cgit v1.2.3-54-g00ecf