From patchwork Tue Nov 8 00:08:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niko Mauno X-Patchwork-Id: 15166 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 1DCE4C433FE for ; Tue, 8 Nov 2022 00:09:06 +0000 (UTC) Received: from sypressi2.dnainternet.net (sypressi2.dnainternet.net [83.102.40.154]) by mx.groups.io with SMTP id smtpd.web09.2313.1667866138585853107 for ; Mon, 07 Nov 2022 16:09:00 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=permerror, err=parse error for token &{10 18 spf.protection.outlook.com}: parse error for token &{10 18 spfd.protection.outlook.com}: limit exceeded (domain: vaisala.com, ip: 83.102.40.154, mailfrom: niko.mauno@vaisala.com) Received: from localhost (localhost [127.0.0.1]) by sypressi2.dnainternet.net (Postfix) with ESMTP id 489A71684E; Tue, 8 Nov 2022 02:08:56 +0200 (EET) X-Virus-Scanned: DNA Internet at dnainternet.net Received: from sypressi2.dnainternet.net ([83.102.40.154]) by localhost (sypressi2.dnainternet.net [127.0.0.1]) (DNA Internet, port 10041) with ESMTP id ffAQu6-It5tn; Tue, 8 Nov 2022 02:08:56 +0200 (EET) Received: from kirsikkapuu2.dnainternet.net (kirsikkapuu2.dnainternet.net [83.102.40.52]) by sypressi2.dnainternet.net (Postfix) with ESMTP id 060851684B; Tue, 8 Nov 2022 02:08:56 +0200 (EET) Received: from localhost.localdomain (82-181-238-66.bb.dnainternet.fi [82.181.238.66]) by kirsikkapuu2.dnainternet.net (Postfix) with ESMTP id DAA5E3FE0; Tue, 8 Nov 2022 02:08:53 +0200 (EET) From: Niko Mauno To: openembedded-core@lists.openembedded.org Cc: Niko Mauno Subject: [RFC PATCH 1/3] Try to ensure 64 bit time on 32 bit glibcful hosts Date: Tue, 8 Nov 2022 02:08:26 +0200 Message-Id: <20221108000828.42824-1-niko.mauno@vaisala.com> X-Mailer: git-send-email 2.36.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, 08 Nov 2022 00:09:06 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/172939 Add default C Preprocessor flags that ensure Y2038 compatible 64 bit time on 32 bit host applications when glibc is used. Prerequisites are glibc version 2.34 or newer and Linux kernel version 5.1 or newer. Example of impact on 32 bit 'qemuarm' machine running core-image-minimal. Before this change: root@qemuarm:~# /bin/busybox date Sun Nov 6 06:09:39 UTC 2022 root@qemuarm:~# /sbin/hwclock.util-linux -w root@qemuarm:~# /sbin/hwclock.util-linux 2022-11-06 06:09:49.994249+00:00 root@qemuarm:~# /bin/busybox date -s 2040-01-01 date: invalid date '2040-01-01' root@qemuarm:~# /bin/date.coreutils -s 2040-01-01 Sun Jan 1 00:00:00 UTC 2040 root@qemuarm:~# /sbin/hwclock.util-linux -w root@qemuarm:~# /sbin/hwclock.util-linux 1931-03-04 06:26:23.000000+00:00 root@qemuarm:~# After this change: root@qemuarm:~# /bin/busybox date Sun Nov 6 06:02:20 UTC 2022 root@qemuarm:~# /sbin/hwclock.util-linux -w root@qemuarm:~# /sbin/hwclock.util-linux 2022-11-06 06:02:27.989730+00:00 root@qemuarm:~# /bin/busybox date -s 2040-01-01 Sun Jan 1 00:00:00 UTC 2040 root@qemuarm:~# /sbin/hwclock.util-linux -w root@qemuarm:~# /sbin/hwclock.util-linux 2040-01-01 00:00:20.992954+00:00 root@qemuarm:~# From here on, the adding of new flags can be disabled on recipe or global level by resetting the value of associated variable containing the CPPFLAGS specific for 64 bit time GLIBC_64BIT_TIME_CPPFLAGS = "" which can be useful e.g. when working around failure to compile a component due to lack of 64 bit time support on 32 bit build in the component's source code. Signed-off-by: Niko Mauno --- meta/conf/distro/include/tclibc-glibc.inc | 3 +++ meta/recipes-devtools/gcc/gcc-sanitizers_12.2.bb | 2 ++ meta/recipes-devtools/pseudo/pseudo_git.bb | 2 ++ 3 files changed, 7 insertions(+) diff --git a/meta/conf/distro/include/tclibc-glibc.inc b/meta/conf/distro/include/tclibc-glibc.inc index f48d16939e..95770298e9 100644 --- a/meta/conf/distro/include/tclibc-glibc.inc +++ b/meta/conf/distro/include/tclibc-glibc.inc @@ -17,6 +17,9 @@ PREFERRED_PROVIDER_virtual/crypt ?= "libxcrypt" CXXFLAGS += "-fvisibility-inlines-hidden" +GLIBC_64BIT_TIME_CPPFLAGS = "-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64" +TARGET_CPPFLAGS += "${GLIBC_64BIT_TIME_CPPFLAGS}" + LIBC_DEPENDENCIES = "\ glibc \ glibc-dbg \ diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers_12.2.bb b/meta/recipes-devtools/gcc/gcc-sanitizers_12.2.bb index 8bda2ccad6..b3fafa0ea4 100644 --- a/meta/recipes-devtools/gcc/gcc-sanitizers_12.2.bb +++ b/meta/recipes-devtools/gcc/gcc-sanitizers_12.2.bb @@ -5,3 +5,5 @@ require gcc-sanitizers.inc # sanitizer_linux.s:5749: Error: lo register required -- `ldr ip,[sp],#8' ARM_INSTRUCTION_SET:armv4 = "arm" ARM_INSTRUCTION_SET:armv5 = "arm" + +GLIBC_64BIT_TIME_CPPFLAGS = "" diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb index c34580b4ff..7734d0fbb0 100644 --- a/meta/recipes-devtools/pseudo/pseudo_git.bb +++ b/meta/recipes-devtools/pseudo/pseudo_git.bb @@ -19,3 +19,5 @@ PV = "1.9.0+git${SRCPV}" # error: use of undeclared identifier '_STAT_VER' COMPATIBLE_HOST:libc-musl = 'null' + +GLIBC_64BIT_TIME_CPPFLAGS = "" From patchwork Tue Nov 8 00:08:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niko Mauno X-Patchwork-Id: 15167 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 0ECF2C4332F for ; Tue, 8 Nov 2022 00:09:26 +0000 (UTC) Received: from sirokuusama2.dnainternet.net (sirokuusama2.dnainternet.net [83.102.40.153]) by mx.groups.io with SMTP id smtpd.web08.2291.1667866164510688509 for ; Mon, 07 Nov 2022 16:09:25 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=permerror, err=parse error for token &{10 18 spf.protection.outlook.com}: parse error for token &{10 18 spfd.protection.outlook.com}: limit exceeded (domain: vaisala.com, ip: 83.102.40.153, mailfrom: niko.mauno@vaisala.com) Received: from localhost (localhost [127.0.0.1]) by sirokuusama2.dnainternet.net (Postfix) with ESMTP id 3B06C139B5; Tue, 8 Nov 2022 02:09:22 +0200 (EET) X-Virus-Scanned: DNA Internet at dnainternet.net Received: from sirokuusama2.dnainternet.net ([83.102.40.153]) by localhost (sirokuusama2.dnainternet.net [127.0.0.1]) (DNA Internet, port 10041) with ESMTP id 0zUuw3JugLe2; Tue, 8 Nov 2022 02:09:22 +0200 (EET) Received: from kirsikkapuu2.dnainternet.net (kirsikkapuu2.dnainternet.net [83.102.40.52]) by sirokuusama2.dnainternet.net (Postfix) with ESMTP id 10B62139B2; Tue, 8 Nov 2022 02:09:22 +0200 (EET) Received: from localhost.localdomain (82-181-238-66.bb.dnainternet.fi [82.181.238.66]) by kirsikkapuu2.dnainternet.net (Postfix) with ESMTP id DE0783FE0; Tue, 8 Nov 2022 02:09:18 +0200 (EET) From: Niko Mauno To: openembedded-core@lists.openembedded.org Cc: Niko Mauno Subject: [RFC PATCH 2/3] kbd: Disable 64 bit time with 32 bit glibc Date: Tue, 8 Nov 2022 02:08:27 +0200 Message-Id: <20221108000828.42824-2-niko.mauno@vaisala.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221108000828.42824-1-niko.mauno@vaisala.com> References: <20221108000828.42824-1-niko.mauno@vaisala.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, 08 Nov 2022 00:09:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/172940 For now add exemption in order to avoid following failure during do_compile() | .../build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/kbd/2.5.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/12.2.0/ld:.libs/libtswrap.ver:2: syntax error in VERSION script | collect2: error: ld returned 1 exit status Signed-off-by: Niko Mauno --- meta/recipes-core/kbd/kbd_2.5.1.bb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/recipes-core/kbd/kbd_2.5.1.bb b/meta/recipes-core/kbd/kbd_2.5.1.bb index aa3ab6e121..b623aecd36 100644 --- a/meta/recipes-core/kbd/kbd_2.5.1.bb +++ b/meta/recipes-core/kbd/kbd_2.5.1.bb @@ -18,6 +18,9 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \ SRC_URI[sha256sum] = "ccdf452387a6380973d2927363e9cbb939fa2068915a6f937ff9d24522024683" +# Compiling 64 bit time for 32 bit host is broken +GLIBC_64BIT_TIME_CPPFLAGS = "" + PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \ " From patchwork Tue Nov 8 00:08:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niko Mauno X-Patchwork-Id: 15168 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 068F3C4332F for ; Tue, 8 Nov 2022 00:09:56 +0000 (UTC) Received: from tulikuusama2.dnainternet.net (tulikuusama2.dnainternet.net [83.102.40.151]) by mx.groups.io with SMTP id smtpd.web09.2317.1667866185474115197 for ; Mon, 07 Nov 2022 16:09:46 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=permerror, err=parse error for token &{10 18 spf.protection.outlook.com}: parse error for token &{10 18 spfd.protection.outlook.com}: limit exceeded (domain: vaisala.com, ip: 83.102.40.151, mailfrom: niko.mauno@vaisala.com) Received: from localhost (localhost [127.0.0.1]) by tulikuusama2.dnainternet.net (Postfix) with ESMTP id 34E0B2B01D; Tue, 8 Nov 2022 02:09:43 +0200 (EET) X-Virus-Scanned: DNA Internet at dnainternet.net Received: from tulikuusama2.dnainternet.net ([83.102.40.151]) by localhost (tulikuusama2.dnainternet.net [127.0.0.1]) (DNA Internet, port 10041) with ESMTP id tgTgh5FmDZmZ; Tue, 8 Nov 2022 02:09:43 +0200 (EET) Received: from kirsikkapuu2.dnainternet.net (kirsikkapuu2.dnainternet.net [83.102.40.52]) by tulikuusama2.dnainternet.net (Postfix) with ESMTP id F2A5B2B018; Tue, 8 Nov 2022 02:09:42 +0200 (EET) Received: from localhost.localdomain (82-181-238-66.bb.dnainternet.fi [82.181.238.66]) by kirsikkapuu2.dnainternet.net (Postfix) with ESMTP id D537F3BAF; Tue, 8 Nov 2022 02:09:39 +0200 (EET) From: Niko Mauno To: openembedded-core@lists.openembedded.org Cc: Niko Mauno Subject: [RFC PATCH 3/3] pulseaudio: Disable 64 bit time with 32 bit glibc Date: Tue, 8 Nov 2022 02:08:28 +0200 Message-Id: <20221108000828.42824-3-niko.mauno@vaisala.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221108000828.42824-1-niko.mauno@vaisala.com> References: <20221108000828.42824-1-niko.mauno@vaisala.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, 08 Nov 2022 00:09:56 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/172941 For now add exemption in order to avoid following kind of failures during do_compile() | ../pulseaudio-16.1/src/modules/bluetooth/bt-codec-cvsd.c:55:22: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'size_t' {aka 'unsigned int'} [-Wformat=] | 55 | pa_log_debug("Got invalid block size: %lu, rounding down", block_size); | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ | | | | | size_t {aka unsigned int} Signed-off-by: Niko Mauno --- meta/recipes-multimedia/pulseaudio/pulseaudio_16.1.bb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio_16.1.bb b/meta/recipes-multimedia/pulseaudio/pulseaudio_16.1.bb index 64002cd1cc..ee4f8c7ed3 100644 --- a/meta/recipes-multimedia/pulseaudio/pulseaudio_16.1.bb +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio_16.1.bb @@ -8,3 +8,6 @@ SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/${BP}.tar.xz \ " SRC_URI[sha256sum] = "8eef32ce91d47979f95fd9a935e738cd7eb7463430dabc72863251751e504ae4" UPSTREAM_CHECK_REGEX = "pulseaudio-(?P\d+(\.(?!99)\d+)+)\.tar" + +# Compiling 64 bit time for 32 bit host is broken +GLIBC_64BIT_TIME_CPPFLAGS = ""