From patchwork Fri Jul 7 21:34:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 27083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01276EB64D9 for ; Fri, 7 Jul 2023 21:34:45 +0000 (UTC) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mx.groups.io with SMTP id smtpd.web11.6622.1688765681895885432 for ; Fri, 07 Jul 2023 14:34:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20221208 header.b=V5RnMkBp; spf=pass (domain: gmail.com, ip: 209.85.214.180, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1b89600a37fso12852925ad.2 for ; Fri, 07 Jul 2023 14:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688765681; x=1691357681; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=2VuTPqFhIVFdAoiEn9rm/bMakMhYvkdTtst3M7LqUCY=; b=V5RnMkBpuzZelwElm4P6x1q4owGhzSJRv35Csih01I9XNQDspphMY7VIlTz1KuZSwD 83BeDdBf7K0zPAG1+yp/jy4vGc5WemfyLoqNbu2zGUf2IHRuB9VB2Rnoh5S0HllUEBrH yEK0gC4c4SDVRQrgOswyB3rOtZZX/XpLYYUJXIhgYw4KDOPzjqQpv94MyZYVXy4XNLZt JIWU1XRkVSSlLbQOPrQhqrS/qrGg2HxMDSqmKpIQvfT+AmVeBzBKz1dhcB33eMeylION KumZmreZtZkZdsQieaMUCU8whlGc2X7Z1OIxD57FfSwjki2tXqoXMf48HKKBnYyMDzpZ jk4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688765681; x=1691357681; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2VuTPqFhIVFdAoiEn9rm/bMakMhYvkdTtst3M7LqUCY=; b=kguOCgAvvEj/iQlDK9DkaZaDQyFfI4OA6nvd5qMxiI9vgsZIgI0GnM+hOTTxs68OnH qHTJ16USsG7VlgH6kGCgt1brAM1kO78U8f12Bemx7/8i5xwVMabIuk5ydwChE6Pa92T1 qTaofAKJFLvawvQu5e1lA8AkIWxUbkVJUol8RVxFrfduHHUamZZKQEWt5ZaIA3E+X7Xd yfQ1xMd10xN9yDzYytajXDIFMnQcWgS3UJd+qReYjAALQZnb7RxXjJg12VUL4MOsTsOm Vr0RtddOx1OWgOuaHAM+85oYtR+W0wGzYlIRHbeqJzsQFATY18s4O158JRN0XcrFh6P/ CT2w== X-Gm-Message-State: ABy/qLbtauMan4HarRQfJWntdCwYjuV8Vt+0UtjttKJO4IeLhhI/Hawe T5ZsSuHVDri4mjNxZv0uPTAVwzGB5GY= X-Google-Smtp-Source: APBJJlEEhdRljHy4/LUYuV3zJLEmbvRDsH3g17wZ/FAdt8/BbAALiaxGbdkqlN5pwLmK9RnYgmCZxQ== X-Received: by 2002:a17:902:b494:b0:1b6:771a:3516 with SMTP id y20-20020a170902b49400b001b6771a3516mr4651963plr.22.1688765680735; Fri, 07 Jul 2023 14:34:40 -0700 (PDT) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:d380::2823]) by smtp.gmail.com with ESMTPSA id x19-20020a170902821300b001b23eb0b4bbsm3689687pln.147.2023.07.07.14.34.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jul 2023 14:34:40 -0700 (PDT) From: Khem Raj To: openembedded-devel@lists.openembedded.org Cc: Khem Raj Subject: [meta-python][PATCH 1/2] python3-grpcio-tools: Fix build with musl Date: Fri, 7 Jul 2023 14:34:37 -0700 Message-ID: <20230707213438.4112432-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 07 Jul 2023 21:34:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/103715 Signed-off-by: Khem Raj --- .../0001-direct_mmap-Use-off_t-on-linux.patch | 37 +++++++++++++++++++ .../python/python3-grpcio-tools_1.56.0.bb | 1 + 2 files changed, 38 insertions(+) create mode 100644 meta-python/recipes-devtools/python/python3-grpcio-tools/0001-direct_mmap-Use-off_t-on-linux.patch diff --git a/meta-python/recipes-devtools/python/python3-grpcio-tools/0001-direct_mmap-Use-off_t-on-linux.patch b/meta-python/recipes-devtools/python/python3-grpcio-tools/0001-direct_mmap-Use-off_t-on-linux.patch new file mode 100644 index 0000000000..9b3e5d4a5f --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-grpcio-tools/0001-direct_mmap-Use-off_t-on-linux.patch @@ -0,0 +1,37 @@ +From 45fdade6c0415ec5af3f9312e6311a4ccc682a7b Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 28 Dec 2022 18:24:21 -0800 +Subject: [PATCH] direct_mmap: Use off_t on linux + +off64_t is not provided without defining _LARGEFILE64_SOURCE on musl +this define is not defined automatically like glibc where it gets +defined when _GNU_SOURCE is defined. Using off_t makes it portable +across musl/glibc and for using 64bit off_t on glibc 32bit systems +-D_FILE_OFFSET_BITS=64 can be defined during build via CXXFLAGS + +Upstream-Status: Submitted [https://github.com/abseil/abseil-cpp/pull/1349] +Signed-off-by: Khem Raj +--- + absl/base/internal/direct_mmap.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/third_party/abseil-cpp/absl/base/internal/direct_mmap.h ++++ b/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +@@ -72,7 +72,7 @@ namespace base_internal { + // Platform specific logic extracted from + // https://chromium.googlesource.com/linux-syscall-support/+/master/linux_syscall_support.h + inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd, +- off64_t offset) noexcept { ++ off_t offset) noexcept { + #if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \ + defined(__m68k__) || defined(__sh__) || \ + (defined(__hppa__) && !defined(__LP64__)) || \ +@@ -102,7 +102,7 @@ inline void* DirectMmap(void* start, siz + #else + return reinterpret_cast( + syscall(SYS_mmap2, start, length, prot, flags, fd, +- static_cast(offset / pagesize))); ++ offset / pagesize)); + #endif + #elif defined(__s390x__) + // On s390x, mmap() arguments are passed in memory. diff --git a/meta-python/recipes-devtools/python/python3-grpcio-tools_1.56.0.bb b/meta-python/recipes-devtools/python/python3-grpcio-tools_1.56.0.bb index eb1994d7ce..8fbe1fa91f 100644 --- a/meta-python/recipes-devtools/python/python3-grpcio-tools_1.56.0.bb +++ b/meta-python/recipes-devtools/python/python3-grpcio-tools_1.56.0.bb @@ -11,6 +11,7 @@ DEPENDS += "${PYTHON_PN}-grpcio" SRC_URI += "file://0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch \ file://0001-protobuf-Disable-musttail-attribute-on-mips.patch \ + file://0001-direct_mmap-Use-off_t-on-linux.patch \ " SRC_URI[sha256sum] = "39f5877cea514b3da9f2683dfb3ffb45ef47b05f4ff39c287d7d61c5057f48b8" From patchwork Fri Jul 7 21:34:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 27084 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02582EB64DA for ; Fri, 7 Jul 2023 21:34:45 +0000 (UTC) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mx.groups.io with SMTP id smtpd.web10.6703.1688765682504859281 for ; Fri, 07 Jul 2023 14:34:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20221208 header.b=sb+8uPE2; spf=pass (domain: gmail.com, ip: 209.85.214.175, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1b8062c1ee1so15924755ad.3 for ; Fri, 07 Jul 2023 14:34:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688765682; x=1691357682; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=m/Fw1rAB9h9Wq8+Revc4SP9q6Folk9H6TLprsSIp3Bo=; b=sb+8uPE2U5uxhb6TLjrjM0deHhywucwB/xO/KRW2ioKC+VGEN9C9cI/wbQ2gb6TcJ7 vHWudqdBSCSTf9zwzpgEmofp0MKKEVjJp2Ehnk5u5T2FqmQ2TJNi1qqkQyWSMHHi9tVx uImY3YKr1VBdvNF2tzIic0MrhSVfvp5Z1QPEh2Ka/xVfMKOTFshk6uzgZPPoXSNwe8UR 0c9QAuM5h084jaitviPUndw8jlD9y+s5oYsC2J2UkqL8D77lJXklxL9X6iWjKhFr7aLP 7oySak36Eba3+dvFRPFyUbrwoL0NA+S/PPOGlMDdhp9K7UfTGOk4HpwWXn/vgG0eiqwi ymoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688765682; x=1691357682; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m/Fw1rAB9h9Wq8+Revc4SP9q6Folk9H6TLprsSIp3Bo=; b=GNMSC64/RYlo5VlRXxHdLfQOfYA5DjuSQeGVwGQBH2znpGZKFO6VghWkI1L5b+FsmZ DwcHD2GPQuBu/Wu01Xkb45RU6yXUbPnx65TxieBXCaokHhZ+Sdo/PpGndbY0tu1jrJKu BLJTdY0ZfDgldrlDJ1iqFmAF5FdLBIEXWDqHCeymdUxKjzvHIaX+EAYMkJJGXED9T9mm xameTpgsPMTSSmLbTdhcmI405mW4tdC3W6VzxB7qo5ToXYnH46aXBJvI6KflFu3OnBpQ Mdv3Tx2WuX78qvvzdwnMxkLzyTPRt9G1S9vQZ9S3wbn6T4tX5U8C/ArqIfG0g3bL7Aox 4o4g== X-Gm-Message-State: ABy/qLakkfSrrPjGjphO90NTdRuxzQuzILQ1PD1+9ltELr/okEDA0MQR 1Jx79UJzFer75lM/rKY9B/473QQ5u3U= X-Google-Smtp-Source: APBJJlF6waNo4lS6L96HwT+5YLUT8TNwCGJ7WU55CT8Zfh7/of7Y79dndS9bFtTbZSmgArNIhmj+Zg== X-Received: by 2002:a17:902:c951:b0:1b8:3e15:46a1 with SMTP id i17-20020a170902c95100b001b83e1546a1mr7932131pla.67.1688765681535; Fri, 07 Jul 2023 14:34:41 -0700 (PDT) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:d380::2823]) by smtp.gmail.com with ESMTPSA id x19-20020a170902821300b001b23eb0b4bbsm3689687pln.147.2023.07.07.14.34.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jul 2023 14:34:41 -0700 (PDT) From: Khem Raj To: openembedded-devel@lists.openembedded.org Cc: Khem Raj Subject: [meta-oe][PATCH 2/2] thin-provisioning-tools: Fix build on musl. Date: Fri, 7 Jul 2023 14:34:38 -0700 Message-ID: <20230707213438.4112432-2-raj.khem@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707213438.4112432-1-raj.khem@gmail.com> References: <20230707213438.4112432-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 07 Jul 2023 21:34:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/103716 Signed-off-by: Khem Raj --- .../0001-Replace-LFS-functions.patch | 91 +++++++++++++++++++ .../thin-provisioning-tools_1.0.4.bb | 2 + 2 files changed, 93 insertions(+) create mode 100644 meta-oe/recipes-support/thin-provisioning-tools/thin-provisioning-tools/0001-Replace-LFS-functions.patch diff --git a/meta-oe/recipes-support/thin-provisioning-tools/thin-provisioning-tools/0001-Replace-LFS-functions.patch b/meta-oe/recipes-support/thin-provisioning-tools/thin-provisioning-tools/0001-Replace-LFS-functions.patch new file mode 100644 index 0000000000..a9f1c8601d --- /dev/null +++ b/meta-oe/recipes-support/thin-provisioning-tools/thin-provisioning-tools/0001-Replace-LFS-functions.patch @@ -0,0 +1,91 @@ +From 289105253fbf342fd22cbcde2ccc1127f732ab09 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 7 Jul 2023 14:21:17 -0700 +Subject: [PATCH] Replace LFS functions + +The original functions are able to consume 64bit off_t now a days +therefore *64 equivalents can be replaced, as a side it fixes build with +musl. + +Upstream-Status: Submitted [https://github.com/jthornber/thin-provisioning-tools/pull/267] +Signed-off-by: Khem Raj +--- + src/file_utils.rs | 10 +++++----- + src/io_engine/base.rs | 4 ++-- + src/thin/trim.rs | 2 +- + 3 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/file_utils.rs b/src/file_utils.rs +index 0ca3c0f..d2b3ee9 100644 +--- a/src/file_utils.rs ++++ b/src/file_utils.rs +@@ -11,18 +11,18 @@ fn test_bit(mode: u32, flag: u32) -> bool { + (mode & libc::S_IFMT) == flag + } + +-fn is_file_or_blk_(info: &libc::stat64) -> bool { ++fn is_file_or_blk_(info: &libc::stat) -> bool { + test_bit(info.st_mode, libc::S_IFBLK) || test_bit(info.st_mode, libc::S_IFREG) + } + + // wrapper of libc::stat64 +-fn libc_stat64(path: &Path) -> io::Result { ++fn libc_stat64(path: &Path) -> io::Result { + let c_path = std::ffi::CString::new(path.as_os_str().as_bytes()) + .map_err(|e| io::Error::new(io::ErrorKind::InvalidInput, e.to_string()))?; + + unsafe { +- let mut st: libc::stat64 = std::mem::zeroed(); +- let r = libc::stat64(c_path.as_ptr(), &mut st); ++ let mut st: libc::stat = std::mem::zeroed(); ++ let r = libc::stat(c_path.as_ptr(), &mut st); + if r == 0 { + Ok(st) + } else { +@@ -56,7 +56,7 @@ fn get_device_size>(path: P) -> io::Result { + let fd = file.as_raw_fd(); + let mut cap = 0u64; + unsafe { +- if libc::ioctl(fd, BLKGETSIZE64 as libc::c_ulong, &mut cap) == 0 { ++ if libc::ioctl(fd, BLKGETSIZE64 as libc::c_int, &mut cap) == 0 { + Ok(cap) + } else { + Err(io::Error::last_os_error()) +diff --git a/src/io_engine/base.rs b/src/io_engine/base.rs +index 725ebf7..db6209f 100644 +--- a/src/io_engine/base.rs ++++ b/src/io_engine/base.rs +@@ -115,7 +115,7 @@ pub trait VectoredIo { + + fn read_vectored_at(file: &File, bufs: &mut [libc::iovec], pos: u64) -> io::Result { + let ptr = bufs.as_ptr(); +- let ret = match unsafe { libc::preadv64(file.as_raw_fd(), ptr, bufs.len() as i32, pos as i64) } ++ let ret = match unsafe { libc::preadv(file.as_raw_fd(), ptr, bufs.len() as i32, pos as i64) } + { + -1 => return Err(io::Error::last_os_error()), + n => n, +@@ -125,7 +125,7 @@ fn read_vectored_at(file: &File, bufs: &mut [libc::iovec], pos: u64) -> io::Resu + + fn write_vectored_at(file: &File, bufs: &[libc::iovec], pos: u64) -> io::Result { + let ptr = bufs.as_ptr(); +- let ret = match unsafe { libc::pwritev64(file.as_raw_fd(), ptr, bufs.len() as i32, pos as i64) } ++ let ret = match unsafe { libc::pwritev(file.as_raw_fd(), ptr, bufs.len() as i32, pos as i64) } + { + -1 => return Err(io::Error::last_os_error()), + n => n, +diff --git a/src/thin/trim.rs b/src/thin/trim.rs +index 3d938ca..91a53dd 100644 +--- a/src/thin/trim.rs ++++ b/src/thin/trim.rs +@@ -135,7 +135,7 @@ impl<'a> Iterator for RangeIterator<'a> { + const BLKDISCARD: u32 = 0x1277; + fn ioctl_blkdiscard(fd: i32, range: &[u64; 2]) -> std::io::Result<()> { + unsafe { +- if libc::ioctl(fd, BLKDISCARD as libc::c_ulong, range) == 0 { ++ if libc::ioctl(fd, BLKDISCARD as libc::c_int, range) == 0 { + Ok(()) + } else { + Err(std::io::Error::last_os_error()) +-- +2.41.0 + diff --git a/meta-oe/recipes-support/thin-provisioning-tools/thin-provisioning-tools_1.0.4.bb b/meta-oe/recipes-support/thin-provisioning-tools/thin-provisioning-tools_1.0.4.bb index 5a73024289..e79f62ff6e 100644 --- a/meta-oe/recipes-support/thin-provisioning-tools/thin-provisioning-tools_1.0.4.bb +++ b/meta-oe/recipes-support/thin-provisioning-tools/thin-provisioning-tools_1.0.4.bb @@ -10,6 +10,8 @@ S = "${WORKDIR}/git" SRC_URI = " \ git://github.com/jthornber/thin-provisioning-tools;branch=main;protocol=https \ " +SRC_URI:append:libc-musl = " file://0001-Replace-LFS-functions.patch" + SRCREV = "3baa3fa3a3e4f714e6170a4152b186f0fa1d76e1" UPSTREAM_CHECK_GITTAGREGEX = "v(?P\d+(\.\d+)+)"