aboutsummaryrefslogtreecommitdiffstats
path: root/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
blob: 3c500d7aac1eed747f383527bad661cd53bfcb31 (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
From fc95b3ccbbfd336797ae2cfd6dd4dc58644e146f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 30 May 2020 17:52:18 -0700
Subject: [PATCH] host/xtest: Adjust order of including compiler.h

compiler.h defines some defines which violate libc namespace e.g.
__unused, this works ok with glibc but fails in awkward ways with musl
the reason is musl uses __unused in its internal structures and this
define in compiler.h conflicts with system headers causing errors like

recipe-sysroot/usr/include/bits/stat.h:17:19: error: expected identifier or '(' before '[' token unsigned __unused[2];
                   ^
including compiler.h afer sys/stat.h fixes the problem.

Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/453]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 host/xtest/install_ta.c | 2 +-
 host/xtest/stats.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/host/xtest/install_ta.c b/host/xtest/install_ta.c
index 09a4c6d..6f7bb5c 100644
--- a/host/xtest/install_ta.c
+++ b/host/xtest/install_ta.c
@@ -4,7 +4,6 @@
  * SPDX-License-Identifier: BSD-2-Clause
  */
 
-#include <compiler.h>
 #include <dirent.h>
 #include <err.h>
 #include <errno.h>
@@ -20,6 +19,7 @@
 #include <sys/types.h>
 #include <tee_client_api.h>
 #include <unistd.h>
+#include <compiler.h>
 
 #include "install_ta.h"
 #include "xtest_helpers.h"
diff --git a/host/xtest/stats.c b/host/xtest/stats.c
index 96b0b5f..db9bf25 100644
--- a/host/xtest/stats.c
+++ b/host/xtest/stats.c
@@ -3,7 +3,6 @@
  * Copyright (c) 2019, Linaro Limited
  */
 
-#include <compiler.h>
 #include <dirent.h>
 #include <err.h>
 #include <errno.h>
@@ -18,6 +17,7 @@
 #include <sys/types.h>
 #include <tee_client_api.h>
 #include <unistd.h>
+#include <compiler.h>
 #include "xtest_test.h"
 #include "stats.h"
 
-- 
2.26.2