Skip to contentSkip to conversation

mesa: Fix broadcom vulkan driver build on 32bit arches with 64bit time_t

PATCH Superseded Khem Raj 2 participants 5 messages Dec 7, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/3 mesa: Fix broadcom vulkan driver build on 32bit arches with 64bit time_t

---
 ...unt-for-64bit-time_t-on-32bit-arches.patch | 41 +++++++++++++++++++
 meta/recipes-graphics/mesa/mesa.inc           |  1 +
 2 files changed, 42 insertions(+)
 create mode 100644 meta/recipes-graphics/mesa/files/0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch
meta/recipes-graphics/mesa/files/0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch new file +41 -0
new file mode 100644
index 00000000000..9032eaba0f1
@@ -0,0 +1,41 @@
+From e2e2fe86dd61b6fae682a1fec31bd0755ced5cd5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 7 Dec 2021 11:13:27 -0800
+Subject: [PATCH] v3dv: account for 64bit time_t on 32bit arches
+
+This makes is a bit more portable, especially on 32bit architectures
+with 64bit time_t defaults. Especially on musl its a must.
+
+Fixes
+../mesa-21.3.0/src/broadcom/vulkan/v3dv_bo.c:71:15: error: format specifies type 'long' but the argument has type 'time_t' (aka 'long long') [-Werror,-Wformat]
+              time.tv_sec);
+              ^~~~~~~~~~~
+
+Also reported here [1]
+
+[1] https://github.com/agherzan/meta-raspberrypi/issues/969
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/broadcom/vulkan/v3dv_bo.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/broadcom/vulkan/v3dv_bo.c b/src/broadcom/vulkan/v3dv_bo.c
+index 71679ce..dc5e7f5 100644
+--- a/src/broadcom/vulkan/v3dv_bo.c
++++ b/src/broadcom/vulkan/v3dv_bo.c
+@@ -67,8 +67,8 @@ bo_dump_stats(struct v3dv_device *device)
+ 
+       struct timespec time;
+       clock_gettime(CLOCK_MONOTONIC, &time);
+-      fprintf(stderr, "  now:               %ld\n",
+-              time.tv_sec);
++      fprintf(stderr, "  now:               %lld\n",
++              (long long)time.tv_sec);
+    }
+ 
+    if (cache->size_list_size) {
+-- 
+2.34.1
+
meta/recipes-graphics/mesa/mesa.inc +1 -0
index 30b9e93f630..31ff38dfdca 100644
@@ -20,6 +20,7 @@ SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
            file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
            file://0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch \
            file://0001-util-format-Check-for-NEON-before-using-it.patch \
+           file://0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch \
            "
 
 SRC_URI[sha256sum] = "a2753c09deef0ba14d35ae8a2ceff3fe5cd13698928c7bb62c2ec8736eb09ce1"
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 2/3 gdb: Drop sh4 support patch

This patch needs to be upstreamed, its not clear if it still works.

---
 meta/recipes-devtools/gdb/gdb-11.1.inc        |   1 -
 ...port-for-Renesas-SH-sh4-architecture.patch | 914 ------------------
 2 files changed, 915 deletions(-)
 delete mode 100644 meta/recipes-devtools/gdb/gdb/0004-Add-support-for-Renesas-SH-sh4-architecture.patch
meta/recipes-devtools/gdb/gdb-11.1.inc +0 -1
index a4809972204..5364a880e3c 100644
@@ -8,7 +8,6 @@ SRC_URI = "${GNU_MIRROR}/gdb/gdb-${PV}.tar.xz \
            file://0001-make-man-install-relative-to-DESTDIR.patch \
            file://0002-mips-linux-nat-Define-_ABIO32-if-not-defined.patch \
            file://0003-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch \
-           file://0004-Add-support-for-Renesas-SH-sh4-architecture.patch \
            file://0005-Dont-disable-libreadline.a-when-using-disable-static.patch \
            file://0006-use-asm-sgidefs.h.patch \
            file://0007-Change-order-of-CFLAGS.patch \
meta/recipes-devtools/gdb/gdb/0004-Add-support-for-Renesas-SH-sh4-architecture.patch deleted +0 -914

914 lines not on this page · raw message

Signature · 1 line
2.34.1
author
#2 lore raw

PATCH 3/3 binutils: Drop patch to wider sh regexp

In reply to Khem Raj

This was needed during uclibc days and remnants have lingered on. Remove this patch

---
 .../binutils/binutils-2.37.inc                |  1 -
 ...iden-the-regexp-for-SH-architectures.patch | 41 -------------------
 2 files changed, 42 deletions(-)
 delete mode 100644 meta/recipes-devtools/binutils/binutils/0004-configure-widen-the-regexp-for-SH-architectures.patch
meta/recipes-devtools/binutils/binutils-2.37.inc +0 -1
index 6093558e4b1..8f91c6460d7 100644
@@ -22,7 +22,6 @@ SRCREV ?= "87d4632d36323091e731eb07b8aa65f90293da66"
 BINUTILS_GIT_URI ?= "git://sourceware.org/git/binutils-gdb.git;branch=${SRCBRANCH};protocol=git"
 SRC_URI = "\
      ${BINUTILS_GIT_URI} \
-     file://0004-configure-widen-the-regexp-for-SH-architectures.patch \
      file://0005-Point-scripts-location-to-libdir.patch \
      file://0006-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \
      file://0007-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch \
meta/recipes-devtools/binutils/binutils/0004-configure-widen-the-regexp-for-SH-architectures.patch deleted +0 -41

41 lines not on this page · raw message

Signature · 1 line
2.34.1
#3 lore raw
In reply to Khem Raj

No more 'Pending' please :) mesa has a gitlab, so it's trivial to submit the patch.

Alex

Quoted 93 lines · Khem Raj
---
 ...unt-for-64bit-time_t-on-32bit-arches.patch | 41 +++++++++++++++++++
 meta/recipes-graphics/mesa/mesa.inc           |  1 +
 2 files changed, 42 insertions(+)
 create mode 100644

meta/recipes-graphics/mesa/files/0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch

diff --git a/meta/recipes-graphics/mesa/files/0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch b/meta/recipes-graphics/mesa/files/0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch new file mode 100644
index 00000000000..9032eaba0f1
--- /dev/null
+++
b/meta/recipes-graphics/mesa/files/0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch

meta/recipes-graphics/mesa/files/0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch new file +10 -0
@@ -0,0 +1,41 @@
+From e2e2fe86dd61b6fae682a1fec31bd0755ced5cd5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 7 Dec 2021 11:13:27 -0800
+Subject: [PATCH] v3dv: account for 64bit time_t on 32bit arches
+
+This makes is a bit more portable, especially on 32bit architectures
+with 64bit time_t defaults. Especially on musl its a must.
+
+Fixes
+../mesa-21.3.0/src/broadcom/vulkan/v3dv_bo.c:71:15: error: format

specifies type 'long' but the argument has type 'time_t' (aka 'long long') [-Werror,-Wformat]

meta/recipes-graphics/mesa/files/0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch new file +31 -0
+              time.tv_sec);
+              ^~~~~~~~~~~
+
+Also reported here [1]
+
+[1] https://github.com/agherzan/meta-raspberrypi/issues/969
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/broadcom/vulkan/v3dv_bo.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/broadcom/vulkan/v3dv_bo.c b/src/broadcom/vulkan/v3dv_bo.c
+index 71679ce..dc5e7f5 100644
+--- a/src/broadcom/vulkan/v3dv_bo.c
++++ b/src/broadcom/vulkan/v3dv_bo.c
+@@ -67,8 +67,8 @@ bo_dump_stats(struct v3dv_device *device)
+
+       struct timespec time;
+       clock_gettime(CLOCK_MONOTONIC, &time);
+-      fprintf(stderr, "  now:               %ld\n",
+-              time.tv_sec);
++      fprintf(stderr, "  now:               %lld\n",
++              (long long)time.tv_sec);
+    }
+
+    if (cache->size_list_size) {
+--
+2.34.1
+
meta/recipes-graphics/mesa/mesa.inc +1 -0
index 30b9e93f630..31ff38dfdca 100644
@@ -20,6 +20,7 @@ SRC_URI = "
 https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
            file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch
 \
 
 file://0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch \
            file://0001-util-format-Check-for-NEON-before-using-it.patch \
+
 file://0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch \
            "

SRC_URI[sha256sum] =
"a2753c09deef0ba14d35ae8a2ceff3fe5cd13698928c7bb62c2ec8736eb09ce1" --
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#159328):
https://lists.openembedded.org/g/openembedded-core/message/159328
Mute This Topic: https://lists.openembedded.org/mt/87572545/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

author
#4 lore raw
Quoted 2 lines · Alexander Kanavin

No more 'Pending' please :) mesa has a gitlab, so it's trivial to submit the patch.

Good point, I have it already under review, I should have updated the status here, v2 has it updated.

Quoted 83 lines

Alex

Quoted 79 lines · Khem Raj
---
 ...unt-for-64bit-time_t-on-32bit-arches.patch | 41 +++++++++++++++++++
 meta/recipes-graphics/mesa/mesa.inc           |  1 +
 2 files changed, 42 insertions(+)
 create mode 100644 meta/recipes-graphics/mesa/files/0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch
meta/recipes-graphics/mesa/files/0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch new file +41 -0
new file mode 100644
index 00000000000..9032eaba0f1
@@ -0,0 +1,41 @@
+From e2e2fe86dd61b6fae682a1fec31bd0755ced5cd5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 7 Dec 2021 11:13:27 -0800
+Subject: [PATCH] v3dv: account for 64bit time_t on 32bit arches
+
+This makes is a bit more portable, especially on 32bit architectures
+with 64bit time_t defaults. Especially on musl its a must.
+
+Fixes
+../mesa-21.3.0/src/broadcom/vulkan/v3dv_bo.c:71:15: error: format specifies type 'long' but the argument has type 'time_t' (aka 'long long') [-Werror,-Wformat]
+              time.tv_sec);
+              ^~~~~~~~~~~
+
+Also reported here [1]
+
+[1] https://github.com/agherzan/meta-raspberrypi/issues/969
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/broadcom/vulkan/v3dv_bo.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/broadcom/vulkan/v3dv_bo.c b/src/broadcom/vulkan/v3dv_bo.c
+index 71679ce..dc5e7f5 100644
+--- a/src/broadcom/vulkan/v3dv_bo.c
++++ b/src/broadcom/vulkan/v3dv_bo.c
+@@ -67,8 +67,8 @@ bo_dump_stats(struct v3dv_device *device)
+
+       struct timespec time;
+       clock_gettime(CLOCK_MONOTONIC, &time);
+-      fprintf(stderr, "  now:               %ld\n",
+-              time.tv_sec);
++      fprintf(stderr, "  now:               %lld\n",
++              (long long)time.tv_sec);
+    }
+
+    if (cache->size_list_size) {
+--
+2.34.1
+
meta/recipes-graphics/mesa/mesa.inc +1 -1
index 30b9e93f630..31ff38dfdca 100644
@@ -20,6 +20,7 @@ SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
            file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
            file://0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch \
            file://0001-util-format-Check-for-NEON-before-using-it.patch \
+           file://0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch \
            "
 
 SRC_URI[sha256sum] = "a2753c09deef0ba14d35ae8a2ceff3fe5cd13698928c7bb62c2ec8736eb09ce1"
--

2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159328): https://lists.openembedded.org/g/openembedded-core/message/159328
Mute This Topic: https://lists.openembedded.org/mt/87572545/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-