summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/libcereal/files
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-01-21 01:48:44 -0800
committerKhem Raj <raj.khem@gmail.com>2023-01-21 10:02:02 -0800
commit611f2921dcbe6efebe09e3072bfe2d04d5db3513 (patch)
tree68da9365b603339fa17a8ea37ce1425cb65ea508 /meta-oe/recipes-support/libcereal/files
parent02fa3ea1af394fdc87711e008d8fa1322203da39 (diff)
downloadmeta-openembedded-611f2921dcbe6efebe09e3072bfe2d04d5db3513.tar.gz
libcereal: Use -idirafter instead of -isystem
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/libcereal/files')
-rw-r--r--meta-oe/recipes-support/libcereal/files/0001-cmake-Use-idirafter-instead-of-isystem.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/libcereal/files/0001-cmake-Use-idirafter-instead-of-isystem.patch b/meta-oe/recipes-support/libcereal/files/0001-cmake-Use-idirafter-instead-of-isystem.patch
new file mode 100644
index 000000000..fc30f0ad7
--- /dev/null
+++ b/meta-oe/recipes-support/libcereal/files/0001-cmake-Use-idirafter-instead-of-isystem.patch
@@ -0,0 +1,52 @@
1From ac70933783a70d5387a2bb2849c568e33ba52558 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 21 Jan 2023 01:41:32 -0800
4Subject: [PATCH] cmake: Use -idirafter instead of -isystem
5
6isystem dirs are searched before the regular system dirs
7this exposes an interesting include ordering problem when using
8clang + libc++, when including C++ headers like <cstdlib>
9
10cstdlib includes stdlib.h and in case of libc++, this should be coming
11from libc++ as well, which is then eventually including system stdlib.h
12
13libc++ has added a check for checking this order recently, which means
14if cstlib ends up including system stdlib.h before libc++ provided
15stdlib.h it errors out
16
17| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/libcereal/1.3.2+gitAUTOINC+ebef1e9298-r0/recipe-sysroot/usr/include/c++/v1/cwchar:113:5: error: <cwchar> tried including <wchar.h> but didn't find libc++'s <wcha
18r.h> header. This usually means that your header search paths are not configured properly. The header search paths should contain the C++ Standard Library headers before any C Standard
19 Library, and you are probably using compiler flags that make that not be the case. | # error <cwchar> tried including <wchar.h> but didn't find libc++'s <wchar.h> header. \
20| ^
21
22The reason is that include_directories with SYSTEM property adds the
23directory via -system and some of these directories point to sysroot
24e.g. OPENSSL_INCLUDE_DIR which ends up adding -isystem
25<sysroot>/usr/include and causes the system stdlib.h to included before
26libc++ stdlib.h
27
28A fix is to use -idirafter which preserved the effects of system headers
29but instead of prepending, it will append to system headers and the
30issue is addressed
31
32Upstream-Status: Submitted [https://github.com/USCiLab/cereal/pull/777]
33Signed-off-by: Khem Raj <raj.khem@gmail.com>
34---
35 unittests/boost/CMakeLists.txt | 2 +-
36 1 file changed, 1 insertion(+), 1 deletion(-)
37
38diff --git a/unittests/boost/CMakeLists.txt b/unittests/boost/CMakeLists.txt
39index 1d733bc7..08e6a169 100644
40--- a/unittests/boost/CMakeLists.txt
41+++ b/unittests/boost/CMakeLists.txt
42@@ -1,6 +1,6 @@
43 file(GLOB TESTS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
44
45-include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
46+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${Boost_INCLUDE_DIRS}")
47
48 # Build all of the non-special tests
49 foreach(TEST_SOURCE ${TESTS})
50--
512.39.1
52