From patchwork Tue Apr 12 00:39:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 6560 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 DF381C4708A for ; Tue, 12 Apr 2022 16:46:39 +0000 (UTC) Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by mx.groups.io with SMTP id smtpd.web11.5232.1649723961733503418 for ; Mon, 11 Apr 2022 17:39:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jP6OMHLW; spf=pass (domain: gmail.com, ip: 209.85.216.43, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f43.google.com with SMTP id bg24so4370866pjb.1 for ; Mon, 11 Apr 2022 17:39:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hVUnVr4mUze6QXLyHzYwqg1CG8PtZIvTy+y7hYFtW4s=; b=jP6OMHLWhVzuwY5saJvPL3Wi7+s+ZCQQn8mF4FuzkSW1dSWqFIy0Q/mXqtDWZ7+hiM KwQN8q3nddnuRO3mqRJnnLAyVZEsXvRDfXlU+ZDWpAnVFnbl+/tPBjAr6JT+2wnIxPyu m8kidKJsyedX+XU/NherscAWYTJvMHhqYS+JnbJHHNoR0oWSsmiSyP0s+PfgJZK1XiaL OUtGEbWIcrxzhAp7K6JWgsYb2Znm5lyo/f9Qrc2FY9f/6lUq0WVujOWXGFh8TkUa6tdO foZ7jenYohLE8t6lAkRC+IhCjQzLiJymWoJmqZCHP/dEcUP4qpaiZmU4j64hehRMI/Ff y+Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hVUnVr4mUze6QXLyHzYwqg1CG8PtZIvTy+y7hYFtW4s=; b=Nl7xsTbUtMq/Oj7s8Hq3wS1syOSx81396nr0n2XVRKtErlKPbjmBqx2qTxye58mOcE oiIrYYE4B/66SAub0bmFKXAdJW3a0z/QiSIcTrYhJx/3qI2A9w25A9iYo2qO/bx4ugnw 90iD71JX6pw059kvFXCtWqJhzEBTHeqKCsAQ70hKk3gPCeM7IArZiAW/jjaCFkeQ1vyW EAQhl1GYTKjTi4sgNm5lSBrRyHLG0C6OxGNUdAYGcxDo8/S6vY4EtFkZ0sNt7zR0NAXh L1RB4LZmcqpcxUmU1dFmYhEUcNd3nnfLfNprcsxDCzlR7MCwfEBpPKJXZg5Odvd5n0Zj l4ww== X-Gm-Message-State: AOAM533H5wDLP5+BV/fItP3CzAkZ0AxZQq5bfaqCYvF7i1/+GxiZbT+Y u+1BkIENxJQuREN1LtIURCpQyC2Z3DqBNw== X-Google-Smtp-Source: ABdhPJxXV71TWczuuA9iQQzGJFMREHbDjEnJUpJ7lz/cEqFKvxR9XC/RmM2kTU3PmGW2MVtGMfG99Q== X-Received: by 2002:a17:902:f68e:b0:154:6518:69ba with SMTP id l14-20020a170902f68e00b00154651869bamr35313201plg.60.1649723961004; Mon, 11 Apr 2022 17:39:21 -0700 (PDT) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9200:a0f0::94ca]) by smtp.gmail.com with ESMTPSA id j14-20020aa783ce000000b00505b64b82bdsm6190154pfn.10.2022.04.11.17.39.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Apr 2022 17:39:20 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 1/3] babeltrace: Disable warnings as errors Date: Mon, 11 Apr 2022 17:39:15 -0700 Message-Id: <20220412003917.3593854-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.35.1 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 ; Tue, 12 Apr 2022 16:46:39 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/164245 These settings are good for developers/maintainers but for distributions generally disabling them turns out to be better especially when there is a knob to do so. This fixes build with gcc-12 which find additional warnings inlined from 'bt_ctf_object_set_parent' at ../../../git/src/ctf-writer/object.h:120:6, inlined from 'bt_ctf_trace_common_add_stream_class' at ../../../git/src/ctf-writer/trace.c:1243:3: ../../../git/src/ctf-writer/object.h:141:26: error: null pointer dereference [-Werror=null-dereference] 141 | if (child->parent) { | ~~~~~^~~~~~~~ ../../../git/src/ctf-writer/object.h:141:26: error: null pointer dereference [-Werror=null-dereference] cc1: all warnings being treated as errors Signed-off-by: Khem Raj --- meta/recipes-kernel/lttng/babeltrace2_2.0.4.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/recipes-kernel/lttng/babeltrace2_2.0.4.bb b/meta/recipes-kernel/lttng/babeltrace2_2.0.4.bb index 248b84e98d3..b48f07ea0df 100644 --- a/meta/recipes-kernel/lttng/babeltrace2_2.0.4.bb +++ b/meta/recipes-kernel/lttng/babeltrace2_2.0.4.bb @@ -19,7 +19,7 @@ S = "${WORKDIR}/git" inherit autotools pkgconfig ptest python3targetconfig -EXTRA_OECONF = "--disable-debug-info" +EXTRA_OECONF = "--disable-debug-info --disable-Werror" PACKAGECONFIG ??= "manpages" PACKAGECONFIG[manpages] = ", --disable-man-pages, asciidoc-native xmlto-native" From patchwork Tue Apr 12 00:39:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 14193 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org From: "Khem Raj" Subject: [PATCH 2/3] xserver-xorg: Fix build with gcc12 Date: Mon, 11 Apr 2022 17:39:16 -0700 Message-Id: <20220412003917.3593854-2-raj.khem@gmail.com> In-Reply-To: <20220412003917.3593854-1-raj.khem@gmail.com> References: <20220412003917.3593854-1-raj.khem@gmail.com> MIME-Version: 1.0 List-id: To: openembedded-core@lists.openembedded.org Cc: Khem Raj backport patch to silence new array-bounds warnings Signed-off-by: Khem Raj --- .../0001-render-Fix-build-with-gcc-12.patch | 90 +++++++++++++++++++ .../xorg-xserver/xserver-xorg_21.1.3.bb | 1 + 2 files changed, 91 insertions(+) create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-render-Fix-build-with-gcc-12.patch diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-render-Fix-build-with-gcc-12.patch b/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-render-Fix-build-with-gcc-12.patch new file mode 100644 index 00000000000..df9332fae7e --- /dev/null +++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-render-Fix-build-with-gcc-12.patch @@ -0,0 +1,90 @@ +From 12041ad0610f1345d6b9994c32943fd4dd01f65d Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Thu, 20 Jan 2022 10:20:38 +0100 +Subject: [PATCH] render: Fix build with gcc 12 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The xserver fails to compile with the latest gcc 12: + + render/picture.c: In function ‘CreateSolidPicture’: + render/picture.c:874:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[16]’ [-Werror=array-bounds] + 874 | pPicture->pSourcePict->type = SourcePictTypeSolidFill; + | ^~ + render/picture.c:868:45: note: object of size 16 allocated by ‘malloc’ + 868 | pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill)); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + render/picture.c: In function ‘CreateLinearGradientPicture’: + render/picture.c:906:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds] + 906 | pPicture->pSourcePict->linear.type = SourcePictTypeLinear; + | ^~ + render/picture.c:899:45: note: object of size 32 allocated by ‘malloc’ + 899 | pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictLinearGradient)); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + render/picture.c: In function ‘CreateConicalGradientPicture’: + render/picture.c:989:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds] + 989 | pPicture->pSourcePict->conical.type = SourcePictTypeConical; + | ^~ + render/picture.c:982:45: note: object of size 32 allocated by ‘malloc’ + 982 | pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictConicalGradient)); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + cc1: some warnings being treated as errors + ninja: build stopped: subcommand failed. + +This is because gcc 12 has become stricter and raises a warning now. + +Fix the warning/error by allocating enough memory to store the union +struct. + +Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/c6b0dcb82d4db07a2f32c09a8c09c85a5f57248e] +Signed-off-by: Olivier Fourdan +Acked-by: Michel Dänzer +Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1256 +--- + render/picture.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/render/picture.c b/render/picture.c +index afa0d25..2be4b19 100644 +--- a/render/picture.c ++++ b/render/picture.c +@@ -865,7 +865,7 @@ CreateSolidPicture(Picture pid, xRenderColor * color, int *error) + } + + pPicture->id = pid; +- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill)); ++ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); + if (!pPicture->pSourcePict) { + *error = BadAlloc; + free(pPicture); +@@ -896,7 +896,7 @@ CreateLinearGradientPicture(Picture pid, xPointFixed * p1, xPointFixed * p2, + } + + pPicture->id = pid; +- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictLinearGradient)); ++ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); + if (!pPicture->pSourcePict) { + *error = BadAlloc; + free(pPicture); +@@ -936,7 +936,7 @@ CreateRadialGradientPicture(Picture pid, xPointFixed * inner, + } + + pPicture->id = pid; +- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictRadialGradient)); ++ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); + if (!pPicture->pSourcePict) { + *error = BadAlloc; + free(pPicture); +@@ -979,7 +979,7 @@ CreateConicalGradientPicture(Picture pid, xPointFixed * center, xFixed angle, + } + + pPicture->id = pid; +- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictConicalGradient)); ++ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); + if (!pPicture->pSourcePict) { + *error = BadAlloc; + free(pPicture); +-- +2.35.1 + diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.3.bb b/meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.3.bb index 3e076ecca7d..1f53ab5177d 100644 --- a/meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.3.bb +++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.3.bb @@ -2,6 +2,7 @@ require xserver-xorg.inc SRC_URI += "file://0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch \ file://0001-Avoid-duplicate-definitions-of-IOPortBase.patch \ + file://0001-render-Fix-build-with-gcc-12.patch \ " SRC_URI[sha256sum] = "61d6aad5b6b47a116b960bd7f0cba4ee7e6da95d6bb0b127bde75d7d1acdebe5" From patchwork Tue Apr 12 00:39:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 6561 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 E8261C38A05 for ; Tue, 12 Apr 2022 16:46:39 +0000 (UTC) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mx.groups.io with SMTP id smtpd.web10.5174.1649723963945800862 for ; Mon, 11 Apr 2022 17:39:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gVpIX7CO; spf=pass (domain: gmail.com, ip: 209.85.214.182, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f182.google.com with SMTP id n18so15312348plg.5 for ; Mon, 11 Apr 2022 17:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QekvGpIW6MmJ7P+cmHxD+1zbpMraUrgYR0Raf9LdwgY=; b=gVpIX7COe1069seqD/VCX0e3BCx/oIRgmSmrTbDTIgW9UQkFZeR6GpVthPzLPrZCtC nYOsI1eUZ+cei9dFz1py1QqCY+JPRyVOt5JqUFMcaJi5/G+PosgARgPmX4ASSazcc0V5 qqj/Jw6ApH6hxpfgCcIbujCw4V3Cv7jsI0fgmpxcRxhYot5aLbpsBYG6bHrwaXthGCUd 2lFTCwvl2XRxVHomz/9uSd63zr4MW0cr/GYkVt4XR21vbEksEW6vuHFMywa/979cqmae GYrEV/OdeCNyilrelvOvBpdgG9b+PI7p9+MEE6TVkDHofc+0SsEbzFzoNuJnw8rYu2MM AE5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QekvGpIW6MmJ7P+cmHxD+1zbpMraUrgYR0Raf9LdwgY=; b=mNR4nHpnLy9AjWCfjcWDBtL0BxlKIUus+6sNGeoq/ZdM2KpW/bxmHdi64ukDTRT8rn 4DQ/TfqnlmfXAtQj1KcDTihDbZ0nWFFDMPDVU5TKu5McaNbVw+iK6eFyn3J3rCub4cHV xsteZQTiMVY8S88tVGkNR74upwlFG/6+s7En31AyTgTR7v5eVTAqGNh2qtnVhvYZzSix jnWMtbwpf7E9MBr9Sx8mvum7j4o+ElfYKcRDfQSP8cv+h3PqIbL1lOhh8Czs7vXa2kXf pamsD10JuX+qvESGeMFDNbM7j0dyZSpYfsAwLHVPoxeYQ+Fpb6aST4OfB8uK7wW5iEsu K33A== X-Gm-Message-State: AOAM530RTXEl6DRxjHB1FFOPJcxZSRVQBdgzvktCqtWPRUDyFWl8TFgP b3+BkDYVnPQbjRQWKlig6khzBfz5i5WHVg== X-Google-Smtp-Source: ABdhPJzx3pjgnERo6vnrFnWKxrmGCrVuOsHmvJTHq/Dtry8aKdbG8gvJm63xDkxmd6cRgzl7O39XKw== X-Received: by 2002:a17:90a:410a:b0:1cb:a279:6679 with SMTP id u10-20020a17090a410a00b001cba2796679mr1980020pjf.211.1649723963252; Mon, 11 Apr 2022 17:39:23 -0700 (PDT) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9200:a0f0::94ca]) by smtp.gmail.com with ESMTPSA id j14-20020aa783ce000000b00505b64b82bdsm6190154pfn.10.2022.04.11.17.39.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Apr 2022 17:39:22 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 3/3] systemtap: Fix build with gcc-12 Date: Mon, 11 Apr 2022 17:39:17 -0700 Message-Id: <20220412003917.3593854-3-raj.khem@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220412003917.3593854-1-raj.khem@gmail.com> References: <20220412003917.3593854-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 ; Tue, 12 Apr 2022 16:46:39 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/164247 Backport a patch to fix | ../git/util.cxx:1766:56: error: 'std::pointer_to_unary_function<_Arg, _Result> std::ptr_fun(_Result (*)(_Arg)) [with _Arg = int; _Result = int]' is deprecated: use 'std::function' instea d [-Werror=deprecated-declarations] | 1766 | std::not1(std::ptr_fun(std::isspace)))); | | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ Signed-off-by: Khem Raj --- ...ility-re-tweak-for-rhel6-use-functio.patch | 49 +++++++++++++++++++ .../recipes-kernel/systemtap/systemtap_git.bb | 3 +- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-kernel/systemtap/systemtap/0001-gcc12-c-compatibility-re-tweak-for-rhel6-use-functio.patch diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-gcc12-c-compatibility-re-tweak-for-rhel6-use-functio.patch b/meta/recipes-kernel/systemtap/systemtap/0001-gcc12-c-compatibility-re-tweak-for-rhel6-use-functio.patch new file mode 100644 index 00000000000..f885c444609 --- /dev/null +++ b/meta/recipes-kernel/systemtap/systemtap/0001-gcc12-c-compatibility-re-tweak-for-rhel6-use-functio.patch @@ -0,0 +1,49 @@ +From f199d1982ef8a6c6d5c06c082d057b8793bcc6aa Mon Sep 17 00:00:00 2001 +From: Serhei Makarov +Date: Fri, 21 Jan 2022 18:21:46 -0500 +Subject: [PATCH] gcc12 c++ compatibility re-tweak for rhel6: use function + pointer instead of lambdas instead of ptr_fun<> + +Saving 2 lines in ltrim/rtrim is probably not a good reason to drop +compatibility with the RHEL6 system compiler. Actually declaring a +named function and passing the function pointer is compatible with +everything. + +Upstream-Status: Backport [https://sourceware.org/git/?p=systemtap.git;a=commit;h=f199d1982ef8a6c6d5c06c082d057b8793bcc6aa] +Signed-off-by: Khem Raj +--- + util.cxx | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +--- a/util.cxx ++++ b/util.cxx +@@ -1757,21 +1757,24 @@ flush_to_stream (const string &fname, os + return 1; // Failure + } + ++int ++not_isspace(unsigned char c) ++{ ++ return !std::isspace(c); ++} ++ + // trim from start (in place) + void + ltrim(std::string &s) + { +- s.erase(s.begin(), +- std::find_if(s.begin(), s.end(), +- std::not1(std::ptr_fun(std::isspace)))); ++ s.erase(s.begin(), std::find_if(s.begin(), s.end(), not_isspace)); + } + + // trim from end (in place) + void + rtrim(std::string &s) + { +- s.erase(std::find_if(s.rbegin(), s.rend(), +- std::not1(std::ptr_fun(std::isspace))).base(), s.end()); ++ s.erase(std::find_if(s.rbegin(), s.rend(), not_isspace).base(), s.end()); + } + + // trim from both ends (in place) diff --git a/meta/recipes-kernel/systemtap/systemtap_git.bb b/meta/recipes-kernel/systemtap/systemtap_git.bb index 04f7e03ab50..ce86d5274dd 100644 --- a/meta/recipes-kernel/systemtap/systemtap_git.bb +++ b/meta/recipes-kernel/systemtap/systemtap_git.bb @@ -7,7 +7,8 @@ HOMEPAGE = "https://sourceware.org/systemtap/" require systemtap_git.inc SRC_URI += "file://0001-improve-reproducibility-for-c-compiling.patch \ - file://0001-staprun-address-ncurses-6.3-failures.patch \ + file://0001-staprun-address-ncurses-6.3-failures.patch \ + file://0001-gcc12-c-compatibility-re-tweak-for-rhel6-use-functio.patch \ " DEPENDS = "elfutils"