aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-graphics/mesa/files/0001-src-util-disk_cache_os.c-Add-missing-headers-for-ope.patch
blob: 007ef46d005351364ebae1a7720186dde38740de (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
From 3609301ce9ada728259388cadd508b8e9f4473e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linaro.org>
Date: Wed, 14 Oct 2020 14:45:20 -0500
Subject: [PATCH] src/util/disk_cache_os.c: Add missing headers for open/fcntl
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes, strict musl build [1],

...
17:25:31 ../git/src/util/disk_cache_os.c: In function 'disk_cache_load_item':
17:25:31 ../git/src/util/disk_cache_os.c:526:9: error: implicit declaration of function 'open'; did you mean 'popen'? [-Werror=implicit-function-declaration]
17:25:31   526 |    fd = open(filename, O_RDONLY | O_CLOEXEC);
17:25:31       |         ^~~~
17:25:31       |         popen
17:25:31 ../git/src/util/disk_cache_os.c:526:24: error: 'O_RDONLY' undeclared (first use in this function)
17:25:31   526 |    fd = open(filename, O_RDONLY | O_CLOEXEC);
17:25:31       |                        ^~~~~~~~
17:25:31 ../git/src/util/disk_cache_os.c:526:24: note: each undeclared identifier is reported only once for each function it appears in
17:25:31 ../git/src/util/disk_cache_os.c:526:35: error: 'O_CLOEXEC' undeclared (first use in this function); did you mean 'MFD_CLOEXEC'?
17:25:31   526 |    fd = open(filename, O_RDONLY | O_CLOEXEC);
17:25:31       |                                   ^~~~~~~~~
17:25:31       |                                   MFD_CLOEXEC
17:25:31 ../git/src/util/disk_cache_os.c: In function 'disk_cache_write_item_to_disk':
17:25:31 ../git/src/util/disk_cache_os.c:666:28: error: 'O_WRONLY' undeclared (first use in this function)
17:25:31   666 |    fd = open(filename_tmp, O_WRONLY | O_CLOEXEC | O_CREAT, 0644);
17:25:31       |                            ^~~~~~~~
17:25:31 ../git/src/util/disk_cache_os.c:666:39: error: 'O_CLOEXEC' undeclared (first use in this function); did you mean 'MFD_CLOEXEC'?
17:25:31   666 |    fd = open(filename_tmp, O_WRONLY | O_CLOEXEC | O_CREAT, 0644);
17:25:31       |                                       ^~~~~~~~~
17:25:31       |                                       MFD_CLOEXEC
17:25:31 ../git/src/util/disk_cache_os.c:666:51: error: 'O_CREAT' undeclared (first use in this function)
17:25:31   666 |    fd = open(filename_tmp, O_WRONLY | O_CLOEXEC | O_CREAT, 0644);
17:25:31       |                                                   ^~~~~~~
17:25:31 ../git/src/util/disk_cache_os.c:705:30: error: 'O_RDONLY' undeclared (first use in this function)
17:25:31   705 |    fd_final = open(filename, O_RDONLY | O_CLOEXEC);
17:25:31       |                              ^~~~~~~~
17:25:31 ../git/src/util/disk_cache_os.c: In function 'disk_cache_mmap_cache_index':
17:25:31 ../git/src/util/disk_cache_os.c:902:20: error: 'O_RDWR' undeclared (first use in this function)
17:25:31   902 |    fd = open(path, O_RDWR | O_CREAT | O_CLOEXEC, 0644);
17:25:31       |                    ^~~~~~
17:25:31 ../git/src/util/disk_cache_os.c:902:29: error: 'O_CREAT' undeclared (first use in this function)
17:25:31   902 |    fd = open(path, O_RDWR | O_CREAT | O_CLOEXEC, 0644);
17:25:31       |                             ^~~~~~~
17:25:31 ../git/src/util/disk_cache_os.c:902:39: error: 'O_CLOEXEC' undeclared (first use in this function); did you mean 'MFD_CLOEXEC'?
17:25:31   902 |    fd = open(path, O_RDWR | O_CREAT | O_CLOEXEC, 0644);
17:25:31       |                                       ^~~~~~~~~
17:25:31       |                                       MFD_CLOEXEC
17:25:31 cc1: some warnings being treated as errors
...

[1] https://ci.linaro.org/job/lt-qcom-openembedded-meta-qcom-master-premerge/MACHINE=qrb5165-rb5,TCLIBC=musl,label=docker-buster-amd64/87/console

Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>

Upstream-status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7146]
---
 src/util/disk_cache_os.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/util/disk_cache_os.c b/src/util/disk_cache_os.c
index d48fe877c56..c4ee186b519 100644
--- a/src/util/disk_cache_os.c
+++ b/src/util/disk_cache_os.c
@@ -28,6 +28,10 @@
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <dirent.h>
+#include <fcntl.h>
 
 #include "zlib.h"
 
-- 
2.28.0