From patchwork Wed Dec 21 17:55:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 17090 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 46FE4C10F1B for ; Wed, 21 Dec 2022 17:56:05 +0000 (UTC) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mx.groups.io with SMTP id smtpd.web10.25704.1671645355384025393 for ; Wed, 21 Dec 2022 09:55:55 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=M93INk9H; spf=pass (domain: gmail.com, ip: 209.85.216.46, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f46.google.com with SMTP id o1-20020a17090a678100b00219cf69e5f0so3113788pjj.2 for ; Wed, 21 Dec 2022 09:55:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=gRaWmimR/UuiA2qyOcG35DWCbkk6P3FOlI/DKvTG0LQ=; b=M93INk9HwuuJqG2sVm5fDaXh1VAO8Iz6wLOOLcNkGgyENNRiYKDb0/vOsitku2bRn0 daOJyK/Kyqp1sblJ3K0/JjUPZqVz4y3yGjtpL4SGvBf2hEcamlA6IpD1FXaU5+xV6wlC Zh/4kaB908fLL3pYY4fwTvpjYtaHtmQCQylBf8JNEit8fXNLEgef7Cb1d+gxYsAwXokf Ud+vKZ8x4akUpjPtceire0W+cNritRFq7lyDGx3qsd67SCEEmmuVvVZddH+Ih56HlZNa quSAx9iEq+7tglkHb2rbGaok49W7tV19dra6NCxdCb6AL+EFF4iXb4Zp0u8PMu3pdm1Y iR2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=gRaWmimR/UuiA2qyOcG35DWCbkk6P3FOlI/DKvTG0LQ=; b=BwRGhX29ypzvsEFTmiSASWasoTAJlOdSsbqRvGM8SlSz8MzOxpvQQDgvMRhNXhdNUH 7x+zwBYMYSux0hFSwCqZHZ09YxXLC45YyXHvnNscqnQEiVH+EjT23RmuDhtR42j734/P Uji7+VhG+36MvK4Xfw0S0gIm8+5iqcaN9yuUTJUwu7jZ517BHZsmC+tgb6lBoCCIp3gp heYjDs/uWake/dGZFB6OHhk8cZHa38XDMgG68bfpM/1DdwGs9wkuHBdi3saTf7jiHoun wt4hLydQHl20sa9Ca5aX9i4tgdfQTwaNpSFh/zn5EeZ3a5ccktVKhFJkOWr9HqW3gML4 KHXA== X-Gm-Message-State: AFqh2krY6yaQpQTHRZfUxaJr8FbXmiVr9td1X+kWxHl9xBwvWhuHWxjM wo6IiymPHrsn3iKiZtS9B0QqospM3mo= X-Google-Smtp-Source: AMrXdXtjXBAtsY7UcrvSzNhpu4rEgycc3FPli4glfVK5crYbdBa5Nrc4lKvXKqV6Plj5oVBBjH9TCg== X-Received: by 2002:a17:90a:1642:b0:219:ba34:a60 with SMTP id x2-20020a17090a164200b00219ba340a60mr3168547pje.43.1671645354306; Wed, 21 Dec 2022 09:55:54 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::41f2]) by smtp.gmail.com with ESMTPSA id x11-20020a17090a294b00b00225a127b2a2sm1548943pjf.5.2022.12.21.09.55.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 09:55:53 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 1/9] libbsd: Fix build with largefile support Date: Wed, 21 Dec 2022 09:55:43 -0800 Message-Id: <20221221175551.1940464-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.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 ; Wed, 21 Dec 2022 17:56:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174926 Signed-off-by: Khem Raj --- ...e-off64_t-with-off_t-in-funopen_seek.patch | 34 +++++++++++++++++++ meta/recipes-support/libbsd/libbsd_0.11.7.bb | 4 ++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-support/libbsd/libbsd/0001-funopen-Replace-off64_t-with-off_t-in-funopen_seek.patch diff --git a/meta/recipes-support/libbsd/libbsd/0001-funopen-Replace-off64_t-with-off_t-in-funopen_seek.patch b/meta/recipes-support/libbsd/libbsd/0001-funopen-Replace-off64_t-with-off_t-in-funopen_seek.patch new file mode 100644 index 0000000000..45ecef041b --- /dev/null +++ b/meta/recipes-support/libbsd/libbsd/0001-funopen-Replace-off64_t-with-off_t-in-funopen_seek.patch @@ -0,0 +1,34 @@ +From 9c4e5f8984e46344c9e150764b8aa0a7a70b6cb5 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 15 Dec 2022 09:02:22 -0800 +Subject: [PATCH] funopen: Replace off64_t with off_t in funopen_seek + +AC_SYS_LARGEFILE in configure.ac is setting needed defines to make +64bit off_t on relevant platforms. + +Fixes build on musl + +| ../../../../../../../../workspace/sources/libbsd/src/funopen.c:68:28: error: unknown type name 'off64_t'; did you mean 'off_t'? +| funopen_seek(void *cookie, off64_t *offset, int whence) +| ^~~~~~~ +| off_t + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/libbsd/libbsd/-/merge_requests/24] +Signed-off-by: Khem Raj +--- + src/funopen.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/funopen.c b/src/funopen.c +index 1e6f43a..a9b40e8 100644 +--- a/src/funopen.c ++++ b/src/funopen.c +@@ -65,7 +65,7 @@ funopen_write(void *cookie, const char *buf, size_t size) + } + + static int +-funopen_seek(void *cookie, off64_t *offset, int whence) ++funopen_seek(void *cookie, off_t *offset, int whence) + { + struct funopen_cookie *cookiewrap = cookie; + off_t soff = *offset; diff --git a/meta/recipes-support/libbsd/libbsd_0.11.7.bb b/meta/recipes-support/libbsd/libbsd_0.11.7.bb index 7a1deed1f6..a9f7a00469 100644 --- a/meta/recipes-support/libbsd/libbsd_0.11.7.bb +++ b/meta/recipes-support/libbsd/libbsd_0.11.7.bb @@ -32,7 +32,9 @@ LICENSE:${PN} = "BSD-3-Clause & ISC & PD" LIC_FILES_CHKSUM = "file://COPYING;md5=75e85c5a558f86d10fbd5abc567ea5e6" SECTION = "libs" -SRC_URI = "https://libbsd.freedesktop.org/releases/${BPN}-${PV}.tar.xz" +SRC_URI = "https://libbsd.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ + file://0001-funopen-Replace-off64_t-with-off_t-in-funopen_seek.patch \ + " SRC_URI[sha256sum] = "9baa186059ebbf25c06308e9f991fda31f7183c0f24931826d83aa6abd8a0261" From patchwork Wed Dec 21 17:55:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 17095 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 84D30C4708D for ; Wed, 21 Dec 2022 17:56:05 +0000 (UTC) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mx.groups.io with SMTP id smtpd.web11.25613.1671645355992659364 for ; Wed, 21 Dec 2022 09:55:56 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=k+bnuUd6; spf=pass (domain: gmail.com, ip: 209.85.214.169, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f169.google.com with SMTP id n4so16288637plp.1 for ; Wed, 21 Dec 2022 09:55:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=jGEXA0kYgO2n27p2A/FUBOD6AqajVORnk+/7kqBm7Nk=; b=k+bnuUd6RWlPwvi9a9Rgv2AqyoDDNvQqNwm/9sDa6uQGQ7BH/nI4We99g22VDlxHuL rQQCp1LDRLU0jyR2v6KpZ5eTcAhb4iUcL83Fs85hdg+1M5fS8Gv/+p9hGPY9w6GFJ5mr tpzkV97Q/YwOnC+Rr7O87BEaQEcGrLlrEpcbXlAlOv3IQo70mZe2M6YoTGlazqE0k+zF KY8mNL6XbjxH98/1yoo32KVmitMAlA/c5N3ls+9M8/Zh7Gya+6MNkPx+x3CCp0Up+8rd QXkDcZ47UaPHUCDyqcQfASqTKGQrwNnoZZX1BOQA/E6ot29duYP89oPKy6orHVWpEsJ9 X9cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=jGEXA0kYgO2n27p2A/FUBOD6AqajVORnk+/7kqBm7Nk=; b=HbJcpP4IJkqDTh4bqXq6NoY+OA6TjAEYfy3cof1hUa0SmlJ/fjcDsK40inJnNWOjqp 1f6dn0GfFe+zeMJP3VXNhDpI4rLoYIBl1bVdruedESBYMUTZzC5wYTZcwN251iWWYsTz RSfe7izXRDlRbesh5epI9cBHaG67ts/wBxZUWr8WO1w5qWDsSODfrgK48OlY2sQBbsi7 MhXHWEqJKDBWAebi7tqyMPK2n0RtzYcMCicxuoyZAOASNZrDZQp2nC10lifcm0N9emus Wpzc55W5EVwSMH/+fGFDMxN8OsIlpQ+00fblMaFrzBW+OIuCaNYRgjiUJO+Ui5rH9ypv gpvw== X-Gm-Message-State: AFqh2kpRdZuw8fG4B0s6LeO84sBTB26vxEm7stxRum8IjvzOXtDg0kzf QVqpUciuNam1qe3t+Hj7w9/RcmXLusg= X-Google-Smtp-Source: AMrXdXvIm5YKtZq+SyI8w08dpGOzTTMJA6gdoGtKUnpjKIvLgeUXYZyd9PoIw6cORWWxhI5t4o21VQ== X-Received: by 2002:a17:90a:194:b0:223:f370:9614 with SMTP id 20-20020a17090a019400b00223f3709614mr3019868pjc.41.1671645354992; Wed, 21 Dec 2022 09:55:54 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::41f2]) by smtp.gmail.com with ESMTPSA id x11-20020a17090a294b00b00225a127b2a2sm1548943pjf.5.2022.12.21.09.55.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 09:55:54 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 2/9] gpgme: Fix with with largefile support Date: Wed, 21 Dec 2022 09:55:44 -0800 Message-Id: <20221221175551.1940464-2-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221175551.1940464-1-raj.khem@gmail.com> References: <20221221175551.1940464-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 ; Wed, 21 Dec 2022 17:56:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174927 Signed-off-by: Khem Raj --- ...ix-io.c-Use-off_t-instead-of-off64_t.patch | 42 +++++++++++++++++++ meta/recipes-support/gpgme/gpgme_1.18.0.bb | 1 + 2 files changed, 43 insertions(+) create mode 100644 meta/recipes-support/gpgme/gpgme/0001-posix-io.c-Use-off_t-instead-of-off64_t.patch diff --git a/meta/recipes-support/gpgme/gpgme/0001-posix-io.c-Use-off_t-instead-of-off64_t.patch b/meta/recipes-support/gpgme/gpgme/0001-posix-io.c-Use-off_t-instead-of-off64_t.patch new file mode 100644 index 0000000000..be58c42128 --- /dev/null +++ b/meta/recipes-support/gpgme/gpgme/0001-posix-io.c-Use-off_t-instead-of-off64_t.patch @@ -0,0 +1,42 @@ +From be33cf1812b4c2a3ed85fb2532992bfb2b27b3be Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 15 Dec 2022 08:44:13 -0800 +Subject: [PATCH] posix-io.c: Use off_t instead of off64_t + +configure.ac checks for largefile support via AC_SYS_LARGEFILE already, +therefore use off_t and ino_t instead of 64bit variants. Musl e.g. does +not define them without _LARGEFILE64_SOURCE and error is not seen on +glibc because _GNU_SOURCE defines _LARGEFILE64_SOURCE + +Fixes errors like below on 32-bit musl systems + +../../../../../../../../workspace/sources/gpgme/src/posix-io.c:77:3: error: unknown type name 'ino64_t'; did you mean 'int64_t'? + ino64_t d_ino; + ^~~~~~~ + int64_t + ^ +../../../../../../../../workspace/sources/gpgme/src/posix-io.c:78:3: error: unknown type name 'off64_t'; did you mean 'off_t'? + off64_t d_off; + ^~~~~~~ + +Upstream-Status: Submitted [https://lists.gnupg.org/pipermail/gnupg-devel/2022-December/035222.html] +Signed-off-by: Khem Raj +--- + src/posix-io.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/posix-io.c b/src/posix-io.c +index 0d0a98b..286a626 100644 +--- a/src/posix-io.c ++++ b/src/posix-io.c +@@ -74,8 +74,8 @@ + * define it ourselves. */ + struct linux_dirent64 + { +- ino64_t d_ino; +- off64_t d_off; ++ ino_t d_ino; ++ off_t d_off; + unsigned short d_reclen; + unsigned char d_type; + char d_name[]; diff --git a/meta/recipes-support/gpgme/gpgme_1.18.0.bb b/meta/recipes-support/gpgme/gpgme_1.18.0.bb index 40c41876fa..7ff4837d6f 100644 --- a/meta/recipes-support/gpgme/gpgme_1.18.0.bb +++ b/meta/recipes-support/gpgme/gpgme_1.18.0.bb @@ -21,6 +21,7 @@ SRC_URI = "${GNUPG_MIRROR}/gpgme/${BP}.tar.bz2 \ file://0007-python-Add-variables-to-tests.patch \ file://0008-do-not-auto-check-var-PYTHON.patch \ file://0001-use-closefrom-on-linux-and-glibc-2.34.patch \ + file://0001-posix-io.c-Use-off_t-instead-of-off64_t.patch \ " SRC_URI[sha256sum] = "361d4eae47ce925dba0ea569af40e7b52c645c4ae2e65e5621bf1b6cdd8b0e9e" From patchwork Wed Dec 21 17:55:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 17092 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 6AA2EC3DA79 for ; Wed, 21 Dec 2022 17:56:05 +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.25705.1671645356687858605 for ; Wed, 21 Dec 2022 09:55:56 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OspETfMB; 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 u7so8074770plq.11 for ; Wed, 21 Dec 2022 09:55:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=22adWtZz6ccwUWOv98BnBMIGxrxJQzUiBCG8CTgxVak=; b=OspETfMBG9NeraAjOnV8nhn2jhWBFoeVnDYfeAHhcH1krx8Z7z1TgfViIuP4/JN7tc niCg9UJAD3aqWYqj5uUD243HxSrFrZCF0Ptl9bJSgU4BYcBmKG72fhybZrhBWeDeawKK UyyC81+t9n6qdgA6rAuqmk/CER6tHcdwWRUa4vpHPUxMX4Nrx2UP5hwymOSHEf3maK5+ +t1MhgcsRuYHmHhS5V3keHxh7KXvxisWr6cbRO9uw79MUSMIRF1SbcDUB5YpRLXjSVa4 moDZGS0nHuaWKQYbzBbGtAzk977/9NxQRIWXell1pYvncXS3JJaeZ8B23BJfi3es8+Bv 7nTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=22adWtZz6ccwUWOv98BnBMIGxrxJQzUiBCG8CTgxVak=; b=n1cZJD4m01/k9bpU7I1CCuf2g0Rj+jo4Jj9cupOTdBcfmHFQRn1TGa7lqgDhJq2VGK 3jxdWGtZaqvTQwwLNCj+E0frvMbsxr28XkmYn6zLGHuOkaFphCu9f7xnxAS9o+dzooGy N9fJT3lERA9X4EH61VLAheaaxcAP9nJv+U/e5cPzOJDDsseOnXNU8E7H+mCPlB3l2SOe +rhdsUIaK5HAcDCKZ085hDM8QB6FtSpQshZq+Wo6hSMj1YE/W5w4PKk7IHrqIACm5GqA udpkW/eR8/4z3OfUeQs1KDWxZCG92AOKkoxvTG7/6d2E+roRWzKerPYugIBiR489UyrX lPtw== X-Gm-Message-State: AFqh2kr9Meoi0IY+tjK2D/PlfSOPNb4Cdwqz7lks+TvKcnDPs4wz3OAq QUJlpKam18mWz1i6F3SNep8kbAjZJoU= X-Google-Smtp-Source: AMrXdXsGFVIGNYg8v8vvmIaL8MvEOH/9Y1JuInzVmfSk0pxC//Lf6eNWZRuGKko3hMMGpImwstASpQ== X-Received: by 2002:a17:90a:4fe6:b0:219:9bae:6026 with SMTP id q93-20020a17090a4fe600b002199bae6026mr2954896pjh.45.1671645355822; Wed, 21 Dec 2022 09:55:55 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::41f2]) by smtp.gmail.com with ESMTPSA id x11-20020a17090a294b00b00225a127b2a2sm1548943pjf.5.2022.12.21.09.55.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 09:55:55 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 3/9] virglrenderer: Replace lseek64 with lseek Date: Wed, 21 Dec 2022 09:55:45 -0800 Message-Id: <20221221175551.1940464-3-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221175551.1940464-1-raj.khem@gmail.com> References: <20221221175551.1940464-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 ; Wed, 21 Dec 2022 17:56:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174928 Fix build with musl Signed-off-by: Khem Raj --- .../0001-Replace-lseek64-with-lseek.patch | 45 +++++++++++++++++++ .../virglrenderer/virglrenderer_0.10.3.bb | 1 + 2 files changed, 46 insertions(+) create mode 100644 meta/recipes-graphics/virglrenderer/virglrenderer/0001-Replace-lseek64-with-lseek.patch diff --git a/meta/recipes-graphics/virglrenderer/virglrenderer/0001-Replace-lseek64-with-lseek.patch b/meta/recipes-graphics/virglrenderer/virglrenderer/0001-Replace-lseek64-with-lseek.patch new file mode 100644 index 0000000000..a0278abd28 --- /dev/null +++ b/meta/recipes-graphics/virglrenderer/virglrenderer/0001-Replace-lseek64-with-lseek.patch @@ -0,0 +1,45 @@ +From a60f0658001d2e8e15ad980731d4130808d37d56 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 15 Dec 2022 12:58:57 -0800 +Subject: [PATCH] Replace lseek64 with lseek + +meson defined _FILE_OFFSET_BITS=64 unconditionally, this implies that +lseek and lseek64 are both same since they are using 64bit off_t, +replacing lseek64 with lseek also helps in compiling with latest musl C +library which has removed these from _GNU_SOURCE namespace unlike glibc +where _GNU_SOURCE also implies _LARGEFILE64_SOURCE and the definition of +lseek64 is still available. + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1003] +Signed-off-by: Khem Raj +--- + src/proxy/proxy_context.c | 2 +- + src/venus/vkr_context.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/proxy/proxy_context.c b/src/proxy/proxy_context.c +index f2a035b..f20f7c8 100644 +--- a/src/proxy/proxy_context.c ++++ b/src/proxy/proxy_context.c +@@ -319,7 +319,7 @@ validate_resource_fd_shm(int fd, uint64_t expected_size) + return false; + } + +- const uint64_t size = lseek64(fd, 0, SEEK_END); ++ const uint64_t size = lseek(fd, 0, SEEK_END); + if (size != expected_size) { + proxy_log("failed to validate shm size(%" PRIu64 ") expected(%" PRIu64 ")", size, + expected_size); +diff --git a/src/venus/vkr_context.c b/src/venus/vkr_context.c +index 9ecb9cd..1e5dc68 100644 +--- a/src/venus/vkr_context.c ++++ b/src/venus/vkr_context.c +@@ -359,7 +359,7 @@ vkr_context_get_blob_locked(struct virgl_context *base, + return ret; + + if (fd_type == VIRGL_RESOURCE_FD_DMABUF && +- (uint64_t)lseek64(fd, 0, SEEK_END) < blob_size) { ++ (uint64_t)lseek(fd, 0, SEEK_END) < blob_size) { + close(fd); + return -EINVAL; + } diff --git a/meta/recipes-graphics/virglrenderer/virglrenderer_0.10.3.bb b/meta/recipes-graphics/virglrenderer/virglrenderer_0.10.3.bb index 3480eb954d..5d483431a7 100644 --- a/meta/recipes-graphics/virglrenderer/virglrenderer_0.10.3.bb +++ b/meta/recipes-graphics/virglrenderer/virglrenderer_0.10.3.bb @@ -12,6 +12,7 @@ DEPENDS = "libdrm libepoxy virtual/egl virtual/libgbm" SRCREV = "0922041ec6730122e0fec11404e6859e2efc4bc0" SRC_URI = "git://gitlab.freedesktop.org/virgl/virglrenderer.git;branch=master;protocol=https \ file://0001-meson.build-use-python3-directly-for-python.patch \ + file://0001-Replace-lseek64-with-lseek.patch \ " S = "${WORKDIR}/git" From patchwork Wed Dec 21 17:55:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 17096 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 73FBEC3DA7C for ; Wed, 21 Dec 2022 17:56:05 +0000 (UTC) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mx.groups.io with SMTP id smtpd.web10.25706.1671645357563007509 for ; Wed, 21 Dec 2022 09:55:57 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QTHY6xGH; spf=pass (domain: gmail.com, ip: 209.85.214.179, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f179.google.com with SMTP id 17so16323810pll.0 for ; Wed, 21 Dec 2022 09:55:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=Eod0oeRvWvSVTtcw0q/ftnVPZEa0U470x2V4ByPOWBY=; b=QTHY6xGHuGSlUkLHvM4d2Y80iupYF8q/2v30aTRFdfI3gFT6RRCt+ekjoY8K65N7gZ VoH24e6SQ+yMi06ixHwQTUlUAom8R05dItskhbA9ey6DnRWI51VzdHZdS/tLqp6vWAKt 9yPeD4VNxS4MWtXIV8lCuLyHjbqWAQNxiVR7AQLEaBlexTAr7r/lLlE7K4mF6DHrop0d i0bfEMoBhqQqzTfiVh7PgjW3LrHk5+1/WSGSrM6qlrVN50hY67vmykJylj6oqGBPSPfz 8I2aNI1y/ZUMJ6hxGIJIq2Cj3fpUk85LaWnspsZttfmrxG11j8ReyKfva2sz0pDJkPUO sOqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Eod0oeRvWvSVTtcw0q/ftnVPZEa0U470x2V4ByPOWBY=; b=H4MIXbqsnbv6hnuV4gkqP7nMZwpTLBxZIrXfijBtF8tOHAkCpdCNEuW8RAp1lG7gCy gqjF9x98w3bYKPEgTLeVBC1GRUwQoDXiZRSi7mKfKTjqVq3b/UH1rBKPnFDJNqlWWDKA Sxi9Sgv8PNMj8eEzDPz6K4JP+6ykhoPZ12ipPK8vmfCnJ46sh3DzqrFpp/xwxpQi6QAq bzIGYG55muciaUjDFDlHj8sBwQJ/fMm70t8FJhDfy9hTht7UbGcqJyMbv6G8QpgzfwBK S0cHMjfgaHlJ31s08U5AHFrwKVDlpY5qPi1MIUMbug6uAkrH7gRAZET5aycuoH8psojX VDxQ== X-Gm-Message-State: AFqh2kq/DQaX+qEEl25SRTu9pVrsZhBuvcqApIDspL9OvyEKqIm58uH3 niAEPucfmw5f84HTG9iQqnIzhIlVxeI= X-Google-Smtp-Source: AMrXdXu21AZ4X9EYTp3DNYuBJ6QpWsSYIPt0sDx/8lyKrFkVcs6zkzJ48MzMqWV0/StYLdtV23s8/g== X-Received: by 2002:a17:90b:1091:b0:21e:1c03:3908 with SMTP id gj17-20020a17090b109100b0021e1c033908mr2596477pjb.15.1671645356688; Wed, 21 Dec 2022 09:55:56 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::41f2]) by smtp.gmail.com with ESMTPSA id x11-20020a17090a294b00b00225a127b2a2sm1548943pjf.5.2022.12.21.09.55.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 09:55:56 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 4/9] nfs-utils: Replace statfs64 with statfs Date: Wed, 21 Dec 2022 09:55:46 -0800 Message-Id: <20221221175551.1940464-4-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221175551.1940464-1-raj.khem@gmail.com> References: <20221221175551.1940464-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 ; Wed, 21 Dec 2022 17:56:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174929 Fixes LFS64 builds Signed-off-by: Khem Raj --- .../0001-Replace-statfs64-with-statfs.patch | 171 ++++++++++++++++++ .../nfs-utils/nfs-utils_2.6.2.bb | 1 + 2 files changed, 172 insertions(+) create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Replace-statfs64-with-statfs.patch diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Replace-statfs64-with-statfs.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Replace-statfs64-with-statfs.patch new file mode 100644 index 0000000000..40ceff9ae9 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Replace-statfs64-with-statfs.patch @@ -0,0 +1,171 @@ +From e89652b853ca7de671093ae44305fa3435e13d3d Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 15 Dec 2022 13:29:43 -0800 +Subject: [PATCH] Replace statfs64 with statfs + +autoconf AC_SYS_LARGEFILE is used by configure to add needed defines +when needed for enabling 64bit off_t, therefore replacing statfs64 with +statfs should be functionally same. Additionally this helps compiling +with latest musl where 64bit LFS functions like statfs64 and friends are +now moved under _LARGEFILE64_SOURCE feature test macro, this works on +glibc systems because _GNU_SOURCE macros also enables +_LARGEFILE64_SOURCE indirectly. This is not case with musl and this +latest issue is exposed. + +Upstream-Status: Submitted [https://lore.kernel.org/linux-nfs/20221215213605.4061853-1-raj.khem@gmail.com/T/#u] +Signed-off-by: Khem Raj +--- + support/export/cache.c | 14 +++++++------- + support/include/nfsd_path.h | 6 +++--- + support/misc/nfsd_path.c | 24 ++++++++++++------------ + utils/exportfs/exportfs.c | 4 ++-- + 4 files changed, 24 insertions(+), 24 deletions(-) + +diff --git a/support/export/cache.c b/support/export/cache.c +index a5823e9..2497d4f 100644 +--- a/support/export/cache.c ++++ b/support/export/cache.c +@@ -346,27 +346,27 @@ static int uuid_by_path(char *path, int type, size_t uuidlen, char *uuid) + + /* Possible sources of uuid are + * - blkid uuid +- * - statfs64 uuid ++ * - statfs uuid + * +- * On some filesystems (e.g. vfat) the statfs64 uuid is simply an ++ * On some filesystems (e.g. vfat) the statfs uuid is simply an + * encoding of the device that the filesystem is mounted from, so + * it we be very bad to use that (as device numbers change). blkid + * must be preferred. +- * On other filesystems (e.g. btrfs) the statfs64 uuid contains ++ * On other filesystems (e.g. btrfs) the statfs uuid contains + * important info that the blkid uuid cannot contain: This happens + * when multiple subvolumes are exported (they have the same +- * blkid uuid but different statfs64 uuids). ++ * blkid uuid but different statfs uuids). + * We rely on get_uuid_blkdev *knowing* which is which and not returning +- * a uuid for filesystems where the statfs64 uuid is better. ++ * a uuid for filesystems where the statfs uuid is better. + * + */ +- struct statfs64 st; ++ struct statfs st; + char fsid_val[17]; + const char *blkid_val = NULL; + const char *val; + int rc; + +- rc = nfsd_path_statfs64(path, &st); ++ rc = nfsd_path_statfs(path, &st); + + if (type == 0 && rc == 0) { + const unsigned long *bad; +diff --git a/support/include/nfsd_path.h b/support/include/nfsd_path.h +index 3b73aad..aa1e1dd 100644 +--- a/support/include/nfsd_path.h ++++ b/support/include/nfsd_path.h +@@ -7,7 +7,7 @@ + #include + + struct file_handle; +-struct statfs64; ++struct statfs; + + void nfsd_path_init(void); + +@@ -18,8 +18,8 @@ char * nfsd_path_prepend_dir(const char *dir, const char *pathname); + int nfsd_path_stat(const char *pathname, struct stat *statbuf); + int nfsd_path_lstat(const char *pathname, struct stat *statbuf); + +-int nfsd_path_statfs64(const char *pathname, +- struct statfs64 *statbuf); ++int nfsd_path_statfs(const char *pathname, ++ struct statfs *statbuf); + + char * nfsd_realpath(const char *path, char *resolved_path); + +diff --git a/support/misc/nfsd_path.c b/support/misc/nfsd_path.c +index 65e53c1..c3dea4f 100644 +--- a/support/misc/nfsd_path.c ++++ b/support/misc/nfsd_path.c +@@ -184,46 +184,46 @@ nfsd_path_lstat(const char *pathname, struct stat *statbuf) + return nfsd_run_stat(nfsd_wq, nfsd_lstatfunc, pathname, statbuf); + } + +-struct nfsd_statfs64_data { ++struct nfsd_statfs_data { + const char *pathname; +- struct statfs64 *statbuf; ++ struct statfs *statbuf; + int ret; + int err; + }; + + static void +-nfsd_statfs64func(void *data) ++nfsd_statfsfunc(void *data) + { +- struct nfsd_statfs64_data *d = data; ++ struct nfsd_statfs_data *d = data; + +- d->ret = statfs64(d->pathname, d->statbuf); ++ d->ret = statfs(d->pathname, d->statbuf); + if (d->ret < 0) + d->err = errno; + } + + static int +-nfsd_run_statfs64(struct xthread_workqueue *wq, ++nfsd_run_statfs(struct xthread_workqueue *wq, + const char *pathname, +- struct statfs64 *statbuf) ++ struct statfs *statbuf) + { +- struct nfsd_statfs64_data data = { ++ struct nfsd_statfs_data data = { + pathname, + statbuf, + 0, + 0 + }; +- xthread_work_run_sync(wq, nfsd_statfs64func, &data); ++ xthread_work_run_sync(wq, nfsd_statfsfunc, &data); + if (data.ret < 0) + errno = data.err; + return data.ret; + } + + int +-nfsd_path_statfs64(const char *pathname, struct statfs64 *statbuf) ++nfsd_path_statfs(const char *pathname, struct statfs *statbuf) + { + if (!nfsd_wq) +- return statfs64(pathname, statbuf); +- return nfsd_run_statfs64(nfsd_wq, pathname, statbuf); ++ return statfs(pathname, statbuf); ++ return nfsd_run_statfs(nfsd_wq, pathname, statbuf); + } + + struct nfsd_realpath_data { +diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c +index 0897b22..6d79a5b 100644 +--- a/utils/exportfs/exportfs.c ++++ b/utils/exportfs/exportfs.c +@@ -513,7 +513,7 @@ validate_export(nfs_export *exp) + */ + struct stat stb; + char *path = exportent_realpath(&exp->m_export); +- struct statfs64 stf; ++ struct statfs stf; + int fs_has_fsid = 0; + + if (stat(path, &stb) < 0) { +@@ -528,7 +528,7 @@ validate_export(nfs_export *exp) + if (!can_test()) + return; + +- if (!statfs64(path, &stf) && ++ if (!statfs(path, &stf) && + (stf.f_fsid.__val[0] || stf.f_fsid.__val[1])) + fs_has_fsid = 1; + diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.6.2.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.6.2.bb index 4b5c28c27b..21df1803c5 100644 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.6.2.bb +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.6.2.bb @@ -32,6 +32,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x file://clang-warnings.patch \ file://0005-mountd-Check-for-return-of-stat-function.patch \ file://0006-Fix-function-prototypes.patch \ + file://0001-Replace-statfs64-with-statfs.patch \ " SRC_URI[sha256sum] = "5200873e81c4d610e2462fc262fe18135f2dbe78b7979f95accd159ae64d5011" From patchwork Wed Dec 21 17:55:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 17093 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 6F492C4708E for ; Wed, 21 Dec 2022 17:56:05 +0000 (UTC) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mx.groups.io with SMTP id smtpd.web10.25707.1671645358659667465 for ; Wed, 21 Dec 2022 09:55:58 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dWnfZqbO; spf=pass (domain: gmail.com, ip: 209.85.216.50, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f50.google.com with SMTP id u5so16475332pjy.5 for ; Wed, 21 Dec 2022 09:55:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=BOlTQzFLLFbxUNekXg3mIfwt8CVmeOp5dNxUp3b0vgo=; b=dWnfZqbOAd2yLyn+o1HdGwS+lka2LRmMSi0orFW9vOMpxqS/7jLTa4M6zzSieqpoeZ gOOU1rddqGCSQJ37IGFlHAqtEaTneQQm21Iy6NcSJPN43OPtcbdueyRSfrWYszEzbize eINM7hB1OefsWGel6ntvAnXhmMDluVXo8qYVN5Vp91XeZIYt3vjrTsaPXLP629Exb3Qy LfvD7UJPRha6p1rdv96kRhcpitEpWMjDP15pl00CHa8XfdrmuFwkgwdyTj7dqJVAL+EO 5scbfIwiLNxAt67T/Cf9gwCDAoL3sEsw/bGoPAM+fFVlpJNb4fmtE5rJAdQOSXJGJ2kr 7reA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=BOlTQzFLLFbxUNekXg3mIfwt8CVmeOp5dNxUp3b0vgo=; b=dFCSiEXdhkW7MQTonqpuW63aZV3jYK5NEisX8EH7oP0m6phJwXiXfL1lM07euCN7bG 3wsoKzi1zRJgZI6d3mBfrY0zdC3js2AV3skhDPi7LGHLoL93PS/4Wff/mNrRVz5q0CCN hDOFdEKLAZxnyROgq6AJiSLcpxXly7BuThAuVhFw5wl2VmcUzYhcmJ55dPrzgn0X/DcY 3UR7JGbe8YMvwbOYB7F3XfUBV/SbPosWi/Ixc+1XHt+bdH+W+vWJAlcImZh8XMTUXX6O mYbIMtGI1nRHbhHA2qjZCtDlrAl0gjWhO6AKij2emqgsnF89a03YXS4+k+9+MaLM81ax 6XHw== X-Gm-Message-State: AFqh2kqQoCRpQdQ8a8LduBrAIZDLV3kK6VgBGB4R5GPumE5T5zj1ehmI jHqpYp80hWctScdx2UC0V0NqrVbNdbY= X-Google-Smtp-Source: AMrXdXsoATr97WdhUdfxkZxVD7L3eW2Ot2JcyDkN1QGw4B900mBfpbWzY4Cc1M0gTBu/3BDlJWisig== X-Received: by 2002:a17:90b:b03:b0:219:b79d:c2f4 with SMTP id bf3-20020a17090b0b0300b00219b79dc2f4mr2924514pjb.18.1671645357720; Wed, 21 Dec 2022 09:55:57 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::41f2]) by smtp.gmail.com with ESMTPSA id x11-20020a17090a294b00b00225a127b2a2sm1548943pjf.5.2022.12.21.09.55.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 09:55:57 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 5/9] alsa-utils: Replace off64_t with off_t Date: Wed, 21 Dec 2022 09:55:47 -0800 Message-Id: <20221221175551.1940464-5-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221175551.1940464-1-raj.khem@gmail.com> References: <20221221175551.1940464-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 ; Wed, 21 Dec 2022 17:56:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174930 Signed-off-by: Khem Raj --- ...lay-axfer-Replace-off64_t-with-off_t.patch | 272 ++++++++++++++++++ .../alsa/alsa-utils_1.2.8.bb | 4 +- 2 files changed, 275 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-multimedia/alsa/alsa-utils/0001-aplay-axfer-Replace-off64_t-with-off_t.patch diff --git a/meta/recipes-multimedia/alsa/alsa-utils/0001-aplay-axfer-Replace-off64_t-with-off_t.patch b/meta/recipes-multimedia/alsa/alsa-utils/0001-aplay-axfer-Replace-off64_t-with-off_t.patch new file mode 100644 index 0000000000..356c5964ae --- /dev/null +++ b/meta/recipes-multimedia/alsa/alsa-utils/0001-aplay-axfer-Replace-off64_t-with-off_t.patch @@ -0,0 +1,272 @@ +From 03553ccc6284a437576349b5a3c2ed0d7d4265e1 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 15 Dec 2022 14:04:10 -0800 +Subject: [PATCH] aplay,axfer: Replace off64_t with off_t + +Also replace lseek64 with lseek. + +_FILE_OFFSET_BITS=64 is passed to needed platforms since configure uses +AC_SYS_LARGEFILE macro. Therefore off_t is already 64-bit and lseek is +same as lseek64. + +Additionally this fixes buils with latest musl where these lfs64 +functions are moved out from _GNU_SOURCE and under _LARGEFILE64_SOURCE +macro alone. This makes the builds fail on 32-bit platforms even though +default off_t on musl is 64-bit always. + +Upstream-Status: Submitted [https://github.com/alsa-project/alsa-utils/pull/183] +Signed-off-by: Khem Raj +--- + aplay/aplay.c | 44 ++++++++++++++++++------------------- + axfer/container-voc.c | 2 +- + axfer/container.c | 6 ++--- + axfer/container.h | 2 +- + axfer/test/container-test.c | 4 ++-- + axfer/test/mapper-test.c | 2 +- + 6 files changed, 30 insertions(+), 30 deletions(-) + +diff --git a/aplay/aplay.c b/aplay/aplay.c +index 6ce7191..bd93be3 100644 +--- a/aplay/aplay.c ++++ b/aplay/aplay.c +@@ -141,7 +141,7 @@ static long term_c_lflag = -1; + static int dump_hw_params = 0; + + static int fd = -1; +-static off64_t pbrec_count = LLONG_MAX, fdcount; ++static off_t pbrec_count = LLONG_MAX, fdcount; + static int vocmajor, vocminor; + + static char *pidfile_name = NULL; +@@ -2356,7 +2356,7 @@ static void voc_play(int fd, int ofs, char *name) + u_char *data, *buf; + char was_extended = 0, output = 0; + u_short *sp, repeat = 0; +- off64_t filepos = 0; ++ off_t filepos = 0; + + #define COUNT(x) nextblock -= x; in_buffer -= x; data += x + #define COUNT1(x) in_buffer -= x; data += x +@@ -2490,7 +2490,7 @@ static void voc_play(int fd, int ofs, char *name) + d_printf("Repeat loop %d times\n", repeat); + #endif + if (filepos >= 0) { /* if < 0, one seek fails, why test another */ +- if ((filepos = lseek64(fd, 0, 1)) < 0) { ++ if ((filepos = lseek(fd, 0, 1)) < 0) { + error(_("can't play loops; %s isn't seekable\n"), name); + repeat = 0; + } else { +@@ -2512,7 +2512,7 @@ static void voc_play(int fd, int ofs, char *name) + else + d_printf("Neverending loop\n"); + #endif +- lseek64(fd, filepos, 0); ++ lseek(fd, filepos, 0); + in_buffer = 0; /* clear the buffer */ + goto Fill_the_buffer; + } +@@ -2578,9 +2578,9 @@ static void init_raw_data(void) + } + + /* calculate the data count to read from/to dsp */ +-static off64_t calc_count(void) ++static off_t calc_count(void) + { +- off64_t count; ++ off_t count; + + if (timelimit == 0) + if (sampleslimit == 0) +@@ -2589,7 +2589,7 @@ static off64_t calc_count(void) + count = snd_pcm_format_size(hwparams.format, sampleslimit * hwparams.channels); + else { + count = snd_pcm_format_size(hwparams.format, hwparams.rate * hwparams.channels); +- count *= (off64_t)timelimit; ++ count *= (off_t)timelimit; + } + return count < pbrec_count ? count : pbrec_count; + } +@@ -2750,7 +2750,7 @@ static void begin_au(int fd, size_t cnt) + /* closing .VOC */ + static void end_voc(int fd) + { +- off64_t length_seek; ++ off_t length_seek; + VocBlockType bt; + size_t cnt; + char dummy = 0; /* Write a Terminator */ +@@ -2770,15 +2770,15 @@ static void end_voc(int fd) + bt.datalen = (u_char) (cnt & 0xFF); + bt.datalen_m = (u_char) ((cnt & 0xFF00) >> 8); + bt.datalen_h = (u_char) ((cnt & 0xFF0000) >> 16); +- if (lseek64(fd, length_seek, SEEK_SET) == length_seek) ++ if (lseek(fd, length_seek, SEEK_SET) == length_seek) + xwrite(fd, &bt, sizeof(VocBlockType)); + } + + static void end_wave(int fd) + { /* only close output */ + WaveChunkHeader cd; +- off64_t length_seek; +- off64_t filelen; ++ off_t length_seek; ++ off_t filelen; + u_int rifflen; + + length_seek = sizeof(WaveHeader) + +@@ -2788,20 +2788,20 @@ static void end_wave(int fd) + cd.length = fdcount > 0x7fffffff ? LE_INT(0x7fffffff) : LE_INT(fdcount); + filelen = fdcount + 2*sizeof(WaveChunkHeader) + sizeof(WaveFmtBody) + 4; + rifflen = filelen > 0x7fffffff ? LE_INT(0x7fffffff) : LE_INT(filelen); +- if (lseek64(fd, 4, SEEK_SET) == 4) ++ if (lseek(fd, 4, SEEK_SET) == 4) + xwrite(fd, &rifflen, 4); +- if (lseek64(fd, length_seek, SEEK_SET) == length_seek) ++ if (lseek(fd, length_seek, SEEK_SET) == length_seek) + xwrite(fd, &cd, sizeof(WaveChunkHeader)); + } + + static void end_au(int fd) + { /* only close output */ + AuHeader ah; +- off64_t length_seek; ++ off_t length_seek; + + length_seek = (char *)&ah.data_size - (char *)&ah; + ah.data_size = fdcount > 0xffffffff ? 0xffffffff : BE_INT(fdcount); +- if (lseek64(fd, length_seek, SEEK_SET) == length_seek) ++ if (lseek(fd, length_seek, SEEK_SET) == length_seek) + xwrite(fd, &ah.data_size, sizeof(ah.data_size)); + } + +@@ -2828,11 +2828,11 @@ static void header(int rtype, char *name) + + /* playing raw data */ + +-static void playback_go(int fd, size_t loaded, off64_t count, int rtype, char *name) ++static void playback_go(int fd, size_t loaded, off_t count, int rtype, char *name) + { + int l, r; +- off64_t written = 0; +- off64_t c; ++ off_t written = 0; ++ off_t c; + + header(rtype, name); + set_params(); +@@ -3202,7 +3202,7 @@ static void capture(char *orig_name) + int filecount=0; /* number of files written */ + char *name = orig_name; /* current filename */ + char namebuf[PATH_MAX+2]; +- off64_t count, rest; /* number of bytes to capture */ ++ off_t count, rest; /* number of bytes to capture */ + struct stat statbuf; + + /* get number of bytes to capture */ +@@ -3273,7 +3273,7 @@ static void capture(char *orig_name) + /* capture */ + fdcount = 0; + while (rest > 0 && recycle_capture_file == 0 && !in_aborting) { +- size_t c = (rest <= (off64_t)chunk_bytes) ? ++ size_t c = (rest <= (off_t)chunk_bytes) ? + (size_t)rest : chunk_bytes; + size_t f = c * 8 / bits_per_frame; + size_t read = pcm_read(audiobuf, f); +@@ -3314,7 +3314,7 @@ static void capture(char *orig_name) + } while ((file_type == FORMAT_RAW && !timelimit && !sampleslimit) || count > 0); + } + +-static void playbackv_go(int* fds, unsigned int channels, size_t loaded, off64_t count, int rtype, char **names) ++static void playbackv_go(int* fds, unsigned int channels, size_t loaded, off_t count, int rtype, char **names) + { + int r; + size_t vsize; +@@ -3368,7 +3368,7 @@ static void playbackv_go(int* fds, unsigned int channels, size_t loaded, off64_t + } + } + +-static void capturev_go(int* fds, unsigned int channels, off64_t count, int rtype, char **names) ++static void capturev_go(int* fds, unsigned int channels, off_t count, int rtype, char **names) + { + size_t c; + ssize_t r; +diff --git a/axfer/container-voc.c b/axfer/container-voc.c +index ec0cfff..5941003 100644 +--- a/axfer/container-voc.c ++++ b/axfer/container-voc.c +@@ -775,7 +775,7 @@ static int write_block_terminator(struct container_context *cntr) + static int write_data_size(struct container_context *cntr, uint64_t byte_count) + { + struct builder_state *state = cntr->private_data; +- off64_t offset; ++ off_t offset; + uint8_t size_field[3]; + int err; + +diff --git a/axfer/container.c b/axfer/container.c +index 8c88d5c..379b72f 100644 +--- a/axfer/container.c ++++ b/axfer/container.c +@@ -113,11 +113,11 @@ enum container_format container_format_from_path(const char *path) + return CONTAINER_FORMAT_RAW; + } + +-int container_seek_offset(struct container_context *cntr, off64_t offset) ++int container_seek_offset(struct container_context *cntr, off_t offset) + { +- off64_t pos; ++ off_t pos; + +- pos = lseek64(cntr->fd, offset, SEEK_SET); ++ pos = lseek(cntr->fd, offset, SEEK_SET); + if (pos < 0) + return -errno; + if (pos != offset) +diff --git a/axfer/container.h b/axfer/container.h +index 71017a6..f6ce689 100644 +--- a/axfer/container.h ++++ b/axfer/container.h +@@ -107,7 +107,7 @@ int container_recursive_read(struct container_context *cntr, void *buf, + unsigned int byte_count); + int container_recursive_write(struct container_context *cntr, void *buf, + unsigned int byte_count); +-int container_seek_offset(struct container_context *cntr, off64_t offset); ++int container_seek_offset(struct container_context *cntr, off_t offset); + + extern const struct container_parser container_parser_riff_wave; + extern const struct container_builder container_builder_riff_wave; +diff --git a/axfer/test/container-test.c b/axfer/test/container-test.c +index e5b62dd..45b6c6a 100644 +--- a/axfer/test/container-test.c ++++ b/axfer/test/container-test.c +@@ -153,7 +153,7 @@ static int callback(struct test_generator *gen, snd_pcm_access_t access, + + for (i = 0; i < ARRAY_SIZE(entries); ++i) { + int fd; +- off64_t pos; ++ off_t pos; + + frames_per_second = entries[i]; + +@@ -172,7 +172,7 @@ static int callback(struct test_generator *gen, snd_pcm_access_t access, + frames_per_second, frame_buffer, frame_count, + trial->verbose); + +- pos = lseek64(fd, 0, SEEK_SET); ++ pos = lseek(fd, 0, SEEK_SET); + if (pos < 0) { + err = -errno; + break; +diff --git a/axfer/test/mapper-test.c b/axfer/test/mapper-test.c +index 477871d..6a389e9 100644 +--- a/axfer/test/mapper-test.c ++++ b/axfer/test/mapper-test.c +@@ -257,7 +257,7 @@ static int test_mapper(struct mapper_trial *trial, snd_pcm_access_t access, + goto end; + + for (i = 0; i < cntr_count; ++i) { +- off64_t pos = lseek64(cntr_fds[i], 0, SEEK_SET); ++ off_t pos = lseek(cntr_fds[i], 0, SEEK_SET); + if (pos != 0) { + err = -EIO; + goto end; diff --git a/meta/recipes-multimedia/alsa/alsa-utils_1.2.8.bb b/meta/recipes-multimedia/alsa/alsa-utils_1.2.8.bb index b355deacc8..46d39b0de8 100644 --- a/meta/recipes-multimedia/alsa/alsa-utils_1.2.8.bb +++ b/meta/recipes-multimedia/alsa/alsa-utils_1.2.8.bb @@ -24,7 +24,9 @@ PACKAGECONFIG[udev] = "--with-udev-rules-dir=`pkg-config --variable=udevdir udev PACKAGECONFIG[manpages] = "--enable-xmlto, --disable-xmlto, xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native" # alsa-utils specified in SRC_URI due to alsa-utils-scripts recipe -SRC_URI = "https://www.alsa-project.org/files/pub/utils/alsa-utils-${PV}.tar.bz2" +SRC_URI = "https://www.alsa-project.org/files/pub/utils/alsa-utils-${PV}.tar.bz2 \ + file://0001-aplay-axfer-Replace-off64_t-with-off_t.patch \ + " SRC_URI[sha256sum] = "e140fa604c351f36bd72167c8860c69d81b964ae6ab53992d6434dde38e9333c" # On build machines with python-docutils (not python3-docutils !!) installed From patchwork Wed Dec 21 17:55:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 17091 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 54313C46467 for ; Wed, 21 Dec 2022 17:56:05 +0000 (UTC) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mx.groups.io with SMTP id smtpd.web10.25708.1671645359477111026 for ; Wed, 21 Dec 2022 09:55:59 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=U1AHTUZz; spf=pass (domain: gmail.com, ip: 209.85.216.45, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f45.google.com with SMTP id w4-20020a17090ac98400b002186f5d7a4cso3149926pjt.0 for ; Wed, 21 Dec 2022 09:55:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=iHLoukGghhOl+eKvsdefEGUPSC+8832vZzZ1iMidWI8=; b=U1AHTUZz+ksBqY/TvC8uFc8Qs+D7Fk0THis+SXX5JmC8wilMq7NqXy1UCsKyEOzidw O/8PIAefKQvE1MhY/UlvwAVKE9ijKZtzeMZkLiLXdgPmEwi9yVh5+KZ8MPnTimoxbn0T AvnvLqmqXhM0moy6OVEXlxHt34OYMcSDb3MrTcyMWytJj8CJVOgwnd/+yAAG/V0siRr1 N9YREKybA6kq24Wsg0h4XZyWXVC7kSusR75XPKPLL7NJqa6ECHxTiwF6YICt5cvkCjFx z3/ZNNaEngRc/K69rIEA72lOwqh2V2xl83SspW51gBWKsqJGhWLg3S84oS71B6l0id65 5BLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=iHLoukGghhOl+eKvsdefEGUPSC+8832vZzZ1iMidWI8=; b=PQimaZTSczc+axeWDXEzEZmtUkopqSHD3hAiGwvzgQtUafDbP0JWiBTSSkh4RdJMH8 POHRQstBpOspJGaACpE0027WoRLsE6o1BeOTCF77KjBlIDi9re0Oml95V5Gjt2It3UNS +j0npkjmITL0gxF/8DzdtaL6jIsZxJHftSeXQCg6oBYw+vZ2o5VLHTw36LNalPx/8zGa aciLKzBwMo8c6LCEwjqJ9jmy1RjYZEkhNBL9peEbL5YBQz6/jRoT+UUlbHxuUexkX5ts kbWM7G+GWqAt2z9aDdnQvgulGxxOn3SCXikZs1IKsiT2uIvSeJnSdA70N6IKIL/oVQPM rwYg== X-Gm-Message-State: AFqh2koOSd4Fi1rP3VUZFrbal6CjGEbWUCQHSuRF9LIrVc/VHY9FfN5L y947G3v6yevhrTaOdpSYb6dA0ryNlLo= X-Google-Smtp-Source: AMrXdXtplX9SspQ6G/rZgACrRgPYA3BFXGsGqZ+besMcH1h2u416sl6mLqfxfqiOqh4NKmiegSPhaw== X-Received: by 2002:a17:90b:3d0b:b0:219:5955:7570 with SMTP id pt11-20020a17090b3d0b00b0021959557570mr2440516pjb.46.1671645358649; Wed, 21 Dec 2022 09:55:58 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::41f2]) by smtp.gmail.com with ESMTPSA id x11-20020a17090a294b00b00225a127b2a2sm1548943pjf.5.2022.12.21.09.55.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 09:55:58 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 6/9] lttng-tools: Fix build with largefile support Date: Wed, 21 Dec 2022 09:55:48 -0800 Message-Id: <20221221175551.1940464-6-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221175551.1940464-1-raj.khem@gmail.com> References: <20221221175551.1940464-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 ; Wed, 21 Dec 2022 17:56:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174931 Signed-off-by: Khem Raj --- ...pat-Define-off64_t-as-off_t-on-linux.patch | 35 +++++++++++++++++++ .../lttng/lttng-tools_2.13.8.bb | 1 + 2 files changed, 36 insertions(+) create mode 100644 meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch new file mode 100644 index 0000000000..e3d421f730 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch @@ -0,0 +1,35 @@ +From cc3e1abaa1e7ad85c6a299fe30a36e0cb732e1c8 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 15 Dec 2022 14:51:20 -0800 +Subject: [PATCH] compat: Define off64_t as off_t on linux + +This helps compile with latest musl, where off64_t is not defined +unless _LARGEFILE64_SOURCE is defined, on glibc _LARGEFILE64_SOURCE is +defined if _GNU_SOURCE is defined, so the problem is only seen with musl + +Upstream-Status: Submitted [https://github.com/lttng/lttng-tools/pull/164] +Signed-off-by: Khem Raj +--- + src/common/compat/fcntl.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/common/compat/fcntl.h b/src/common/compat/fcntl.h +index 5e566e50..d19a6ece 100644 +--- a/src/common/compat/fcntl.h ++++ b/src/common/compat/fcntl.h +@@ -7,7 +7,6 @@ + + #ifndef _COMPAT_FCNTL_H + #define _COMPAT_FCNTL_H +- + #include + #include + +@@ -22,6 +21,7 @@ typedef off64_t loff_t; + #endif + + #ifdef __linux__ ++typedef off_t off64_t; + extern int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes, + unsigned int flags); + #define lttng_sync_file_range(fd, offset, nbytes, flags) \ diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.13.8.bb b/meta/recipes-kernel/lttng/lttng-tools_2.13.8.bb index a814eb79f9..e64eeba635 100644 --- a/meta/recipes-kernel/lttng/lttng-tools_2.13.8.bb +++ b/meta/recipes-kernel/lttng/lttng-tools_2.13.8.bb @@ -37,6 +37,7 @@ SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \ file://lttng-sessiond.service \ file://determinism.patch \ file://disable-tests.patch \ + file://0001-compat-Define-off64_t-as-off_t-on-linux.patch \ " SRC_URI[sha256sum] = "b1e959579b260790930b20f3c7aa7cefb8a40e0de80d4a777c2bf78c6b353dc1" From patchwork Wed Dec 21 17:55:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 17088 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 4FC4CC4167B for ; Wed, 21 Dec 2022 17:56:05 +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.25705.1671645356687858605 for ; Wed, 21 Dec 2022 09:56:00 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Q9D7F1O0; 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 u7so8074934plq.11 for ; Wed, 21 Dec 2022 09:55:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=hgNrS1NW5GaKRi3KNKOeW5LJeiIuLkdPqHXGjNak6AU=; b=Q9D7F1O0or8UVl95zv4dM5NZDL9kc4JhxSQ36tQq2+AoUp5lY7ep8vTox1+MArD1Qn zxMrXUzMwQO9l67t8QnhZxnpZF0RavDfkN4lU+p1WlaWabta/CGJbE3HG+RjCse5NDl2 N5YDbqZFyLxS0za1Sah934sn3d3gOTDQUq5VnCnvYtSdcoM/yktS4LwnThfoZBZH6WB3 yRGiMxFOTbwsKFEqj18+DdR/PX+aaP0m029aBZmzb9od9Yy1OuOsfrMjy740+6evIYZX iCvvmjOBucupgL4OeYNFIb4QNUXc5M8VjHmNLsm0qYe+ZMzzR70c6BjcgG4hKIx6lmdW GV6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=hgNrS1NW5GaKRi3KNKOeW5LJeiIuLkdPqHXGjNak6AU=; b=dU3DoNYjDEbh7Uw+O51Py8HFtdI4slL+3QAoOkZ7igXOakZ1BaDrXYTuLPDaoFeCyG MGs2ivqiGlFVSJc0LWzdrlk+vtrlJ/vVXzIcfziBlavUemXwkmXAFTP+d99QnawAqY0T yLxiV16cusf/937k5KNHnMT+wGH8UOj2GCZlTV3wNI107/D9hVodCGh69BDEP6De3xPK p9oKU4bNwcK7ijH0C5zfcelwPg7EEcultSoLuSd4E59s5e+92tYuFv9eiE8aX3YT8lqv cS+h9z433rUg8fCt/4wzBLZ4504NfbI0+1iRnncVywBewwpWsCftvq3j0713s4AlKaCc bLkQ== X-Gm-Message-State: AFqh2kqJmf1j5olxOIN0DY52hCKfDYkktkUTqJa0A/c3cYEpyk1vJvGQ xUQH8HJr9VE6tsG3nw7Vw98P4AsvQF4= X-Google-Smtp-Source: AMrXdXsMhAgkTN4Dr8nNNTYG+rqA4oQLNjpNs6LnUPd7HlincEY/uLe58BJ4bBBto3s5vTxQCg1a6w== X-Received: by 2002:a17:90a:9606:b0:219:f7e5:cb56 with SMTP id v6-20020a17090a960600b00219f7e5cb56mr3157452pjo.20.1671645359399; Wed, 21 Dec 2022 09:55:59 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::41f2]) by smtp.gmail.com with ESMTPSA id x11-20020a17090a294b00b00225a127b2a2sm1548943pjf.5.2022.12.21.09.55.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 09:55:59 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 7/9] strace: Add knob to enable largefile support Date: Wed, 21 Dec 2022 09:55:49 -0800 Message-Id: <20221221175551.1940464-7-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221175551.1940464-1-raj.khem@gmail.com> References: <20221221175551.1940464-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 ; Wed, 21 Dec 2022 17:56:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174932 Signed-off-by: Khem Raj --- ...toconf-macro-to-detect-largefile-sup.patch | 27 ++++++++++++ ...002-tests-Replace-off64_t-with-off_t.patch | 43 +++++++++++++++++++ meta/recipes-devtools/strace/strace_6.0.bb | 2 + 3 files changed, 72 insertions(+) create mode 100644 meta/recipes-devtools/strace/strace/0001-configure-Use-autoconf-macro-to-detect-largefile-sup.patch create mode 100644 meta/recipes-devtools/strace/strace/0002-tests-Replace-off64_t-with-off_t.patch diff --git a/meta/recipes-devtools/strace/strace/0001-configure-Use-autoconf-macro-to-detect-largefile-sup.patch b/meta/recipes-devtools/strace/strace/0001-configure-Use-autoconf-macro-to-detect-largefile-sup.patch new file mode 100644 index 0000000000..76ca7a76a8 --- /dev/null +++ b/meta/recipes-devtools/strace/strace/0001-configure-Use-autoconf-macro-to-detect-largefile-sup.patch @@ -0,0 +1,27 @@ +From 470399f3636c412b74f9daf6ae430b13c3126f02 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 15 Dec 2022 15:54:27 -0800 +Subject: [PATCH] configure: Use autoconf macro to detect largefile support + +Adds --enable-largefile/--disable-largefile configure knobs +where default is to detect the support + +Upstream-Status: Submitted [https://github.com/strace/strace/pull/230] +Signed-off-by: Khem Raj +--- + configure.ac | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 4797b42dd..7d57fb254 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -43,6 +43,8 @@ AC_PROG_INSTALL + AC_PROG_RANLIB + AC_PROG_LN_S + ++AC_SYS_LARGEFILE ++ + AC_USE_SYSTEM_EXTENSIONS + AX_CODE_COVERAGE + diff --git a/meta/recipes-devtools/strace/strace/0002-tests-Replace-off64_t-with-off_t.patch b/meta/recipes-devtools/strace/strace/0002-tests-Replace-off64_t-with-off_t.patch new file mode 100644 index 0000000000..ce0428e977 --- /dev/null +++ b/meta/recipes-devtools/strace/strace/0002-tests-Replace-off64_t-with-off_t.patch @@ -0,0 +1,43 @@ +From 579b2ebe52d4b97f954e6188df2d07e137820075 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 15 Dec 2022 15:56:13 -0800 +Subject: [PATCH] tests: Replace off64_t with off_t + +when _FILE_OFFSET_BITS=64 then off_t is 64bit wide, this also fixes +build on musl where off64_t is not available without _LARGEFILE64_SOURCE + +Upstream-Status: Submitted [https://github.com/strace/strace/pull/230] +Signed-off-by: Khem Raj +--- + tests/readahead.c | 2 +- + tests/sync_file_range2.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/readahead.c b/tests/readahead.c +index 10723785c..b9597e697 100644 +--- a/tests/readahead.c ++++ b/tests/readahead.c +@@ -42,7 +42,7 @@ static const int fds[] = { + 0x7fffffff, + }; + +-static const off64_t offsets[] = { ++static const off_t offsets[] = { + -0x8000000000000000LL, + -0x5060708090a0b0c0LL, + -1LL, +diff --git a/tests/sync_file_range2.c b/tests/sync_file_range2.c +index 0f7c9e428..15a5fec71 100644 +--- a/tests/sync_file_range2.c ++++ b/tests/sync_file_range2.c +@@ -20,8 +20,8 @@ int + main(void) + { + const int fd = -1; +- const off64_t offset = 0xdeadbeefbadc0ded; +- const off64_t nbytes = 0xfacefeedcafef00d; ++ const off_t offset = 0xdeadbeefbadc0ded; ++ const off_t nbytes = 0xfacefeedcafef00d; + const unsigned int flags = -1; + + int rc = sync_file_range(fd, offset, nbytes, flags); diff --git a/meta/recipes-devtools/strace/strace_6.0.bb b/meta/recipes-devtools/strace/strace_6.0.bb index 4fa3589d15..7679235b01 100644 --- a/meta/recipes-devtools/strace/strace_6.0.bb +++ b/meta/recipes-devtools/strace/strace_6.0.bb @@ -13,6 +13,8 @@ SRC_URI = "https://strace.io/files/${PV}/strace-${PV}.tar.xz \ file://ptest-spacesave.patch \ file://0001-strace-fix-reproducibilty-issues.patch \ file://skip-load.patch \ + file://0001-configure-Use-autoconf-macro-to-detect-largefile-sup.patch \ + file://0002-tests-Replace-off64_t-with-off_t.patch \ " SRC_URI[sha256sum] = "92d720a666855e9f1c6a11512fd6e99674a82bbfe1442557815f2ce8e1293338" From patchwork Wed Dec 21 17:55:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 17089 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 3C377C4332F for ; Wed, 21 Dec 2022 17:56:05 +0000 (UTC) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mx.groups.io with SMTP id smtpd.web11.25617.1671645360958282586 for ; Wed, 21 Dec 2022 09:56:01 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aLoM+QDI; spf=pass (domain: gmail.com, ip: 209.85.214.178, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f178.google.com with SMTP id s7so16266604plk.5 for ; Wed, 21 Dec 2022 09:56:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=u7EUekXTWDoZ/WyTpbzFdtWbqhmEX26nmHtXoZ1beq8=; b=aLoM+QDIwBtbl/smNWKZR1tf3qdc6viBYxLKG42lH1qqyNxAVCLlyJ1H/0ell+wkrI /hs5q9ELDFcwsxcqkNQ1GkKPDChn4cvHAIlSAksM7bXls+P+FcQnC4yHpK8UiCSJtYpW 1dqDiHIAHSOUln84SMdVUi9kbKve7k/fPNKmlggzTT4M3sY3/DlM7p+eSofBayjHiBW4 p/LfrbUFuJALhR6Cwb/mxF4cipJqGUX78BadvIwQciEELx1W472IBqASvyR/ROY9dc58 3/+6UzWfzShtJshAkqMHCIzTFMWBAgQxO5g63V5Jg8LsVU8qW7VzyGdnriIY/aooZNDd mVhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=u7EUekXTWDoZ/WyTpbzFdtWbqhmEX26nmHtXoZ1beq8=; b=ucbzULdojIs2WD2tif4Y855f75SwHOgWiLguGH4qabjdzle/aPxlFFz9as/W/bbMDL i58IhPOset/dAuxA9IVCdRn9jvE16w9RgI4iCjnQwVoHdxeZY8h/8eXoGgG8I9aYaqUV 4NZjoRCUIBuP3a3MnrBxT2rj/mTrxjCJgMCRIiZid5wN0vpGZwBFCXNSGPDd3T1f3vfs npx/L32dZa5hFCdTi+3AL5g2ILYA/Q8JYTm4o6YRyzblpY9OI2CFJhUtyj93LjMRdm7t 10uTYgT45n3DKfrowFR5rOwJycs0H9MJHlQekgqpTj/iyGNYwFjvsD8dLlTK7qxW8g9D R8Bw== X-Gm-Message-State: AFqh2kr1+i7JloquVyn70Mje7bijkZ+zWgYfULtGkBXZ2ucWezOdgBpr sJmgXfX4onXHmcAG6aS09YMeGHgyvvA= X-Google-Smtp-Source: AMrXdXsRWyidMRY7gHPcoS61EEzs44Gawu8Bl5IOW1h/hFi6GxJsEwBGeJ6iD+QSTBiGREkjnpJZvw== X-Received: by 2002:a17:90b:2786:b0:221:7043:74c4 with SMTP id pw6-20020a17090b278600b00221704374c4mr2997814pjb.13.1671645360196; Wed, 21 Dec 2022 09:56:00 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::41f2]) by smtp.gmail.com with ESMTPSA id x11-20020a17090a294b00b00225a127b2a2sm1548943pjf.5.2022.12.21.09.55.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 09:55:59 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 8/9] numactl: Enable largefile support Date: Wed, 21 Dec 2022 09:55:50 -0800 Message-Id: <20221221175551.1940464-8-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221175551.1940464-1-raj.khem@gmail.com> References: <20221221175551.1940464-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 ; Wed, 21 Dec 2022 17:56:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174933 Signed-off-by: Khem Raj --- ...onfigure-Check-for-largefile-support.patch | 27 ++++++++ ...at64-fstat64-ftruncate64mmap64-with-.patch | 64 +++++++++++++++++++ meta/recipes-support/numactl/numactl_git.bb | 2 + 3 files changed, 93 insertions(+) create mode 100644 meta/recipes-support/numactl/numactl/0001-configure-Check-for-largefile-support.patch create mode 100644 meta/recipes-support/numactl/numactl/0002-shm.c-Replace-stat64-fstat64-ftruncate64mmap64-with-.patch diff --git a/meta/recipes-support/numactl/numactl/0001-configure-Check-for-largefile-support.patch b/meta/recipes-support/numactl/numactl/0001-configure-Check-for-largefile-support.patch new file mode 100644 index 0000000000..152eb2807b --- /dev/null +++ b/meta/recipes-support/numactl/numactl/0001-configure-Check-for-largefile-support.patch @@ -0,0 +1,27 @@ +From 61f910f5d12d6f6a66223b5af6d74e30ace3a2e1 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 15 Dec 2022 12:10:37 -0800 +Subject: [PATCH] configure: Check for largefile support + +This helps in using 64bit versions of off_t related functions + +Upstream-Status: Backport [https://github.com/numactl/numactl/pull/159] +Signed-off-by: Khem Raj +--- + configure.ac | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 8510fc5..d74bc6e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -14,6 +14,9 @@ LT_INIT + + AC_PROG_CC + ++# Check for enabling LFS support ++AC_SYS_LARGEFILE ++ + # Override CFLAGS so that we can specify custom CFLAGS for numademo. + AX_AM_OVERRIDE_VAR([CFLAGS]) + diff --git a/meta/recipes-support/numactl/numactl/0002-shm.c-Replace-stat64-fstat64-ftruncate64mmap64-with-.patch b/meta/recipes-support/numactl/numactl/0002-shm.c-Replace-stat64-fstat64-ftruncate64mmap64-with-.patch new file mode 100644 index 0000000000..03b98e0a2c --- /dev/null +++ b/meta/recipes-support/numactl/numactl/0002-shm.c-Replace-stat64-fstat64-ftruncate64mmap64-with-.patch @@ -0,0 +1,64 @@ +From 8a08d3583d77bebeb1763fb9b378899201ce5afa Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 15 Dec 2022 12:11:13 -0800 +Subject: [PATCH] shm.c: Replace stat64/fstat64/ftruncate64mmap64 with normal functions + +These functions were needed when _FILE_OFFSET_BITS was not 64, using +AC_SYS_LARGEFILE will detect it correctly and make the normal variants +of these functions behave same as their *64 counterparts. + +Upstream-Status: Backport [https://github.com/numactl/numactl/pull/159] +Signed-off-by: Khem Raj +--- + shm.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/shm.c b/shm.c +index 20537d9..5d0d1ab 100644 +--- a/shm.c ++++ b/shm.c +@@ -24,8 +24,8 @@ + #include + #include + #include +-#include + #include ++#include + #include + #include + #include +@@ -135,7 +135,7 @@ void attach_sysvshm(char *name, char *opt) + /* Attach a shared memory file. */ + void attach_shared(char *name, char *opt) + { +- struct stat64 st; ++ struct stat st; + + shmfd = open(name, O_RDWR); + if (shmfd < 0) { +@@ -146,14 +146,14 @@ void attach_shared(char *name, char *opt) + if (shmfd < 0) + nerror("cannot create file %s", name); + } +- if (fstat64(shmfd, &st) < 0) ++ if (fstat(shmfd, &st) < 0) + err("shm stat"); + /* the file size must be larger than mmap shmlen + shmoffset, otherwise SIGBUS + * will be caused when we access memory, because mmaped memory is no longer in + * the range of the file laster. + */ + if ((shmlen + shmoffset) > st.st_size) { +- if (ftruncate64(shmfd, shmlen + shmoffset) < 0) { ++ if (ftruncate(shmfd, shmlen + shmoffset) < 0) { + /* XXX: we could do it by hand, but it would it + would be impossible to apply policy then. + need to fix that in the kernel. */ +@@ -168,7 +168,7 @@ void attach_shared(char *name, char *opt) + + /* RED-PEN For shmlen > address space may need to map in pieces. + Left for some poor 32bit soul. */ +- shmptr = mmap64(NULL, shmlen, PROT_READ | PROT_WRITE, MAP_SHARED, shmfd, shmoffset); ++ shmptr = mmap(NULL, shmlen, PROT_READ | PROT_WRITE, MAP_SHARED, shmfd, shmoffset); + if (shmptr == (char*)-1) + err("shm mmap"); + } diff --git a/meta/recipes-support/numactl/numactl_git.bb b/meta/recipes-support/numactl/numactl_git.bb index 23be0a3b4f..0f71258bc3 100644 --- a/meta/recipes-support/numactl/numactl_git.bb +++ b/meta/recipes-support/numactl/numactl_git.bb @@ -18,6 +18,8 @@ SRC_URI = "git://github.com/numactl/numactl;branch=master;protocol=https \ file://Makefile \ file://run-ptest \ file://0001-define-run-test-target.patch \ + file://0001-configure-Check-for-largefile-support.patch \ + file://0002-shm.c-Replace-stat64-fstat64-ftruncate64mmap64-with-.patch \ " S = "${WORKDIR}/git" From patchwork Wed Dec 21 17:55:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 17094 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 4AA0AC41535 for ; Wed, 21 Dec 2022 17:56:05 +0000 (UTC) Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by mx.groups.io with SMTP id smtpd.web11.25618.1671645361923760519 for ; Wed, 21 Dec 2022 09:56:02 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dLPjO0U/; spf=pass (domain: gmail.com, ip: 209.85.216.42, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f42.google.com with SMTP id v23so11254190pju.3 for ; Wed, 21 Dec 2022 09:56:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=qbnN1TO2FvfJOAXVl0HoOQpwrr/VI/Kc+qah5KrD6MY=; b=dLPjO0U/cHbo678OwHUba/fXz/KdmrRK2wAPHoAVtwI4qWnW9/ciq4ziP5M8WrLETT yQfjabj9NkCBKy70NPGXBRIiQLyASCfbSkrJfLxBhPaAdAYK9u5UlZwIZ6M9LoilEGnn GalbF2nr7lzZ0x/ugoC58nXMXsep/b2aOTWraNsHnqMBjuZPxG8BP+dFfDYdoTCrI5cL rs5Tt6FVG00SuNhnOdFJAmvefVHlLCYq0ESzs9DXgNk92fA81od5MFcPB/fFIx1SQXhg pbfPSFbS1Nv5DHrDFTK1F/MGh5aPvmt/a5Ntps9E0vsG75nES4WuZleYQuUaYisMT5RQ W/xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=qbnN1TO2FvfJOAXVl0HoOQpwrr/VI/Kc+qah5KrD6MY=; b=PlDYV4IPUWQqNFhIuqALfY6J//v60SHunlyuxGqutAxK+xu1wdLtoQML1E0NJcUvju /o2cTyu/iw5In70ppiUJmYLBxCMpqSgzOHpevyTGEj30W66Zu8EdSBNeLptREERc/sxa eFeDWfjrLt9OvkuiRCVLp7Whgxmx5spXKTJrP/yN5GDJKtd0UVRQlDQL2Rnbw4+7fZnJ YKz7g2uWfzCW8VIYMKHG351XqbwYY4azb8IuYW2HFa2X+Un9ZEKy37Bd13rfddSTgAhO 4dlHVxUWx5SOMheYSlwMazdLIiNSrhoUZJN8iRGyRobtS6ryOWLAptmcFZM+SyUb/wYq mz2Q== X-Gm-Message-State: AFqh2krEf3LaEEivg0drgSo7L/3FQk1rRJBx/UN0+GEcGU/YWphdBnf/ TQqa8SB34E1EPGuiPc94VmEocM2RtFU= X-Google-Smtp-Source: AMrXdXuy+K2Pagu8ms3G9sROl7fHkl/v1jG42D7V+udV4JCCIUa2Q141+wpb49xUIbeV2fy9FBWEhg== X-Received: by 2002:a17:90a:5186:b0:219:ce62:7de8 with SMTP id u6-20020a17090a518600b00219ce627de8mr3096632pjh.43.1671645360981; Wed, 21 Dec 2022 09:56:00 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::41f2]) by smtp.gmail.com with ESMTPSA id x11-20020a17090a294b00b00225a127b2a2sm1548943pjf.5.2022.12.21.09.56.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 09:56:00 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 9/9] qemu: Fix build with largefile support Date: Wed, 21 Dec 2022 09:55:51 -0800 Message-Id: <20221221175551.1940464-9-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221175551.1940464-1-raj.khem@gmail.com> References: <20221221175551.1940464-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 ; Wed, 21 Dec 2022 17:56:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174934 drop using lfs64 specific functions and macros Signed-off-by: Khem Raj --- meta/recipes-devtools/qemu/qemu.inc | 2 + ...-user-blk-Replace-lseek64-with-lseek.patch | 37 ++ ...ce-use-of-lfs64-related-functions-an.patch | 358 ++++++++++++++++++ 3 files changed, 397 insertions(+) create mode 100644 meta/recipes-devtools/qemu/qemu/0001-contrib-vhost-user-blk-Replace-lseek64-with-lseek.patch create mode 100644 meta/recipes-devtools/qemu/qemu/0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index 0b24540bf9..27e3a8e259 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc @@ -28,6 +28,8 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ file://0009-Define-MAP_SYNC-and-MAP_SHARED_VALIDATE-on-needed-li.patch \ file://0010-hw-pvrdma-Protect-against-buggy-or-malicious-guest-d.patch \ file://0001-net-tulip-Restrict-DMA-engine-to-memories.patch \ + file://0001-contrib-vhost-user-blk-Replace-lseek64-with-lseek.patch \ + file://0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch \ file://arm-cpreg-fix.patch \ file://CVE-2022-3165.patch \ " diff --git a/meta/recipes-devtools/qemu/qemu/0001-contrib-vhost-user-blk-Replace-lseek64-with-lseek.patch b/meta/recipes-devtools/qemu/qemu/0001-contrib-vhost-user-blk-Replace-lseek64-with-lseek.patch new file mode 100644 index 0000000000..1838c88f0e --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/0001-contrib-vhost-user-blk-Replace-lseek64-with-lseek.patch @@ -0,0 +1,37 @@ +From 38f5c88bf296dbbc04dcd57f36d64695055a2d3f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 16 Dec 2022 20:19:49 -0800 +Subject: [PATCH 1/2] contrib/vhost-user-blk: Replace lseek64 with lseek + +64bit off_t is already in use since build uses _FILE_OFFSET_BITS=64 +already. Using lseek/off_t also makes it work with latest must without +using _LARGEFILE64_SOURCE macro. This macro is implied with _GNU_SOURCE +when using glibc but not with musl. + +Upstream-Status: Submitted [https://lists.gnu.org/archive/html/qemu-devel/2022-12/msg02840.html] +Signed-off-by: Khem Raj +Cc: Michael S. Tsirkin +CC: Raphael Norwitz +--- + contrib/vhost-user-blk/vhost-user-blk.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c +index aa99877fcd..7941694e53 100644 +--- a/contrib/vhost-user-blk/vhost-user-blk.c ++++ b/contrib/vhost-user-blk/vhost-user-blk.c +@@ -532,9 +532,9 @@ vub_get_blocksize(int fd) + static void + vub_initialize_config(int fd, struct virtio_blk_config *config) + { +- off64_t capacity; ++ off_t capacity; + +- capacity = lseek64(fd, 0, SEEK_END); ++ capacity = lseek(fd, 0, SEEK_END); + config->capacity = capacity >> 9; + config->blk_size = vub_get_blocksize(fd); + config->size_max = 65536; +-- +2.39.0 + diff --git a/meta/recipes-devtools/qemu/qemu/0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch b/meta/recipes-devtools/qemu/qemu/0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch new file mode 100644 index 0000000000..14b5338eb2 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch @@ -0,0 +1,358 @@ +From 71f14902256e3c3529710b713e1ea43100bf4c40 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 17 Dec 2022 08:37:46 -0800 +Subject: [PATCH 2/2] linux-user: Replace use of lfs64 related functions and + macros + +Builds defines -D_FILE_OFFSET_BITS=64 which makes the original functions +anf macros behave same as their 64 suffixed counterparts. This also +helps in compiling with latest musl C library, where these macros and +functions are no more available under _GNU_SOURCE feature macro + +Upstream-Status: Submitted [https://lists.gnu.org/archive/html/qemu-devel/2022-12/msg02841.html] +Signed-off-by: Khem Raj +Cc: Laurent Vivier +--- + linux-user/syscall.c | 153 +++++++++++-------------------------------- + 1 file changed, 39 insertions(+), 114 deletions(-) + +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index 1f8c10f8ef..30d83ed162 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -795,8 +795,8 @@ safe_syscall6(ssize_t, copy_file_range, int, infd, loff_t *, pinoff, + */ + #define safe_ioctl(...) safe_syscall(__NR_ioctl, __VA_ARGS__) + /* Similarly for fcntl. Note that callers must always: +- * pass the F_GETLK64 etc constants rather than the unsuffixed F_GETLK +- * use the flock64 struct rather than unsuffixed flock ++ * pass the F_GETLK etc constants rather than the unsuffixed F_GETLK ++ * use the flock struct rather than unsuffixed flock + * This will then work and use a 64-bit offset for both 32-bit and 64-bit hosts. + */ + #ifdef __NR_fcntl64 +@@ -6797,13 +6797,13 @@ static int target_to_host_fcntl_cmd(int cmd) + ret = cmd; + break; + case TARGET_F_GETLK: +- ret = F_GETLK64; ++ ret = F_GETLK; + break; + case TARGET_F_SETLK: +- ret = F_SETLK64; ++ ret = F_SETLK; + break; + case TARGET_F_SETLKW: +- ret = F_SETLKW64; ++ ret = F_SETLKW; + break; + case TARGET_F_GETOWN: + ret = F_GETOWN; +@@ -6817,17 +6817,6 @@ static int target_to_host_fcntl_cmd(int cmd) + case TARGET_F_SETSIG: + ret = F_SETSIG; + break; +-#if TARGET_ABI_BITS == 32 +- case TARGET_F_GETLK64: +- ret = F_GETLK64; +- break; +- case TARGET_F_SETLK64: +- ret = F_SETLK64; +- break; +- case TARGET_F_SETLKW64: +- ret = F_SETLKW64; +- break; +-#endif + case TARGET_F_SETLEASE: + ret = F_SETLEASE; + break; +@@ -6879,8 +6868,8 @@ static int target_to_host_fcntl_cmd(int cmd) + * them to 5, 6 and 7 before making the syscall(). Since we make the + * syscall directly, adjust to what is supported by the kernel. + */ +- if (ret >= F_GETLK64 && ret <= F_SETLKW64) { +- ret -= F_GETLK64 - 5; ++ if (ret >= F_GETLK && ret <= F_SETLKW) { ++ ret -= F_GETLK - 5; + } + #endif + +@@ -6913,55 +6902,11 @@ static int host_to_target_flock(int type) + return type; + } + +-static inline abi_long copy_from_user_flock(struct flock64 *fl, +- abi_ulong target_flock_addr) +-{ +- struct target_flock *target_fl; +- int l_type; +- +- if (!lock_user_struct(VERIFY_READ, target_fl, target_flock_addr, 1)) { +- return -TARGET_EFAULT; +- } +- +- __get_user(l_type, &target_fl->l_type); +- l_type = target_to_host_flock(l_type); +- if (l_type < 0) { +- return l_type; +- } +- fl->l_type = l_type; +- __get_user(fl->l_whence, &target_fl->l_whence); +- __get_user(fl->l_start, &target_fl->l_start); +- __get_user(fl->l_len, &target_fl->l_len); +- __get_user(fl->l_pid, &target_fl->l_pid); +- unlock_user_struct(target_fl, target_flock_addr, 0); +- return 0; +-} +- +-static inline abi_long copy_to_user_flock(abi_ulong target_flock_addr, +- const struct flock64 *fl) +-{ +- struct target_flock *target_fl; +- short l_type; +- +- if (!lock_user_struct(VERIFY_WRITE, target_fl, target_flock_addr, 0)) { +- return -TARGET_EFAULT; +- } +- +- l_type = host_to_target_flock(fl->l_type); +- __put_user(l_type, &target_fl->l_type); +- __put_user(fl->l_whence, &target_fl->l_whence); +- __put_user(fl->l_start, &target_fl->l_start); +- __put_user(fl->l_len, &target_fl->l_len); +- __put_user(fl->l_pid, &target_fl->l_pid); +- unlock_user_struct(target_fl, target_flock_addr, 1); +- return 0; +-} +- +-typedef abi_long from_flock64_fn(struct flock64 *fl, abi_ulong target_addr); +-typedef abi_long to_flock64_fn(abi_ulong target_addr, const struct flock64 *fl); ++typedef abi_long from_flock_fn(struct flock *fl, abi_ulong target_addr); ++typedef abi_long to_flock_fn(abi_ulong target_addr, const struct flock *fl); + + #if defined(TARGET_ARM) && TARGET_ABI_BITS == 32 +-struct target_oabi_flock64 { ++struct target_oabi_flock { + abi_short l_type; + abi_short l_whence; + abi_llong l_start; +@@ -6969,10 +6914,10 @@ struct target_oabi_flock64 { + abi_int l_pid; + } QEMU_PACKED; + +-static inline abi_long copy_from_user_oabi_flock64(struct flock64 *fl, ++static inline abi_long copy_from_user_oabi_flock(struct flock *fl, + abi_ulong target_flock_addr) + { +- struct target_oabi_flock64 *target_fl; ++ struct target_oabi_flock *target_fl; + int l_type; + + if (!lock_user_struct(VERIFY_READ, target_fl, target_flock_addr, 1)) { +@@ -6993,10 +6938,10 @@ static inline abi_long copy_from_user_oabi_flock64(struct flock64 *fl, + return 0; + } + +-static inline abi_long copy_to_user_oabi_flock64(abi_ulong target_flock_addr, +- const struct flock64 *fl) ++static inline abi_long copy_to_user_oabi_flock(abi_ulong target_flock_addr, ++ const struct flock *fl) + { +- struct target_oabi_flock64 *target_fl; ++ struct target_oabi_flock *target_fl; + short l_type; + + if (!lock_user_struct(VERIFY_WRITE, target_fl, target_flock_addr, 0)) { +@@ -7014,10 +6959,10 @@ static inline abi_long copy_to_user_oabi_flock64(abi_ulong target_flock_addr, + } + #endif + +-static inline abi_long copy_from_user_flock64(struct flock64 *fl, ++static inline abi_long copy_from_user_flock(struct flock *fl, + abi_ulong target_flock_addr) + { +- struct target_flock64 *target_fl; ++ struct target_flock *target_fl; + int l_type; + + if (!lock_user_struct(VERIFY_READ, target_fl, target_flock_addr, 1)) { +@@ -7038,10 +6983,10 @@ static inline abi_long copy_from_user_flock64(struct flock64 *fl, + return 0; + } + +-static inline abi_long copy_to_user_flock64(abi_ulong target_flock_addr, +- const struct flock64 *fl) ++static inline abi_long copy_to_user_flock(abi_ulong target_flock_addr, ++ const struct flock *fl) + { +- struct target_flock64 *target_fl; ++ struct target_flock *target_fl; + short l_type; + + if (!lock_user_struct(VERIFY_WRITE, target_fl, target_flock_addr, 0)) { +@@ -7060,7 +7005,7 @@ static inline abi_long copy_to_user_flock64(abi_ulong target_flock_addr, + + static abi_long do_fcntl(int fd, int cmd, abi_ulong arg) + { +- struct flock64 fl64; ++ struct flock fl64; + #ifdef F_GETOWN_EX + struct f_owner_ex fox; + struct target_f_owner_ex *target_fox; +@@ -7073,6 +7018,7 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg) + + switch(cmd) { + case TARGET_F_GETLK: ++ case TARGET_F_OFD_GETLK: + ret = copy_from_user_flock(&fl64, arg); + if (ret) { + return ret; +@@ -7082,32 +7028,11 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg) + ret = copy_to_user_flock(arg, &fl64); + } + break; +- + case TARGET_F_SETLK: + case TARGET_F_SETLKW: +- ret = copy_from_user_flock(&fl64, arg); +- if (ret) { +- return ret; +- } +- ret = get_errno(safe_fcntl(fd, host_cmd, &fl64)); +- break; +- +- case TARGET_F_GETLK64: +- case TARGET_F_OFD_GETLK: +- ret = copy_from_user_flock64(&fl64, arg); +- if (ret) { +- return ret; +- } +- ret = get_errno(safe_fcntl(fd, host_cmd, &fl64)); +- if (ret == 0) { +- ret = copy_to_user_flock64(arg, &fl64); +- } +- break; +- case TARGET_F_SETLK64: +- case TARGET_F_SETLKW64: + case TARGET_F_OFD_SETLK: + case TARGET_F_OFD_SETLKW: +- ret = copy_from_user_flock64(&fl64, arg); ++ ret = copy_from_user_flock(&fl64, arg); + if (ret) { + return ret; + } +@@ -7332,7 +7257,7 @@ static inline abi_long target_truncate64(CPUArchState *cpu_env, const char *arg1 + arg2 = arg3; + arg3 = arg4; + } +- return get_errno(truncate64(arg1, target_offset64(arg2, arg3))); ++ return get_errno(truncate(arg1, target_offset64(arg2, arg3))); + } + #endif + +@@ -7346,7 +7271,7 @@ static inline abi_long target_ftruncate64(CPUArchState *cpu_env, abi_long arg1, + arg2 = arg3; + arg3 = arg4; + } +- return get_errno(ftruncate64(arg1, target_offset64(arg2, arg3))); ++ return get_errno(ftruncate(arg1, target_offset64(arg2, arg3))); + } + #endif + +@@ -8452,7 +8377,7 @@ static int do_getdents(abi_long dirfd, abi_long arg2, abi_long count) + void *tdirp; + int hlen, hoff, toff; + int hreclen, treclen; +- off64_t prev_diroff = 0; ++ off_t prev_diroff = 0; + + hdirp = g_try_malloc(count); + if (!hdirp) { +@@ -8505,7 +8430,7 @@ static int do_getdents(abi_long dirfd, abi_long arg2, abi_long count) + * Return what we have, resetting the file pointer to the + * location of the first record not returned. + */ +- lseek64(dirfd, prev_diroff, SEEK_SET); ++ lseek(dirfd, prev_diroff, SEEK_SET); + break; + } + +@@ -8539,7 +8464,7 @@ static int do_getdents64(abi_long dirfd, abi_long arg2, abi_long count) + void *tdirp; + int hlen, hoff, toff; + int hreclen, treclen; +- off64_t prev_diroff = 0; ++ off_t prev_diroff = 0; + + hdirp = g_try_malloc(count); + if (!hdirp) { +@@ -8581,7 +8506,7 @@ static int do_getdents64(abi_long dirfd, abi_long arg2, abi_long count) + * Return what we have, resetting the file pointer to the + * location of the first record not returned. + */ +- lseek64(dirfd, prev_diroff, SEEK_SET); ++ lseek(dirfd, prev_diroff, SEEK_SET); + break; + } + +@@ -11114,7 +11039,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, + return -TARGET_EFAULT; + } + } +- ret = get_errno(pread64(arg1, p, arg3, target_offset64(arg4, arg5))); ++ ret = get_errno(pread(arg1, p, arg3, target_offset64(arg4, arg5))); + unlock_user(p, arg2, ret); + return ret; + case TARGET_NR_pwrite64: +@@ -11131,7 +11056,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, + return -TARGET_EFAULT; + } + } +- ret = get_errno(pwrite64(arg1, p, arg3, target_offset64(arg4, arg5))); ++ ret = get_errno(pwrite(arg1, p, arg3, target_offset64(arg4, arg5))); + unlock_user(p, arg2, 0); + return ret; + #endif +@@ -11954,14 +11879,14 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, + case TARGET_NR_fcntl64: + { + int cmd; +- struct flock64 fl; +- from_flock64_fn *copyfrom = copy_from_user_flock64; +- to_flock64_fn *copyto = copy_to_user_flock64; ++ struct flock fl; ++ from_flock_fn *copyfrom = copy_from_user_flock; ++ to_flock_fn *copyto = copy_to_user_flock; + + #ifdef TARGET_ARM + if (!cpu_env->eabi) { +- copyfrom = copy_from_user_oabi_flock64; +- copyto = copy_to_user_oabi_flock64; ++ copyfrom = copy_from_user_oabi_flock; ++ copyto = copy_to_user_oabi_flock; + } + #endif + +@@ -11971,7 +11896,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, + } + + switch(arg2) { +- case TARGET_F_GETLK64: ++ case TARGET_F_GETLK: + ret = copyfrom(&fl, arg3); + if (ret) { + break; +@@ -11982,8 +11907,8 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, + } + break; + +- case TARGET_F_SETLK64: +- case TARGET_F_SETLKW64: ++ case TARGET_F_SETLK: ++ case TARGET_F_SETLKW: + ret = copyfrom(&fl, arg3); + if (ret) { + break; +-- +2.39.0 +