summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/mesa/files/0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch
blob: e87d7d73114df17ac7d4ff2cc320081d3eb90d3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From e2e2fe86dd61b6fae682a1fec31bd0755ced5cd5 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
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: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14118]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 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