added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,52 @@
From ac70933783a70d5387a2bb2849c568e33ba52558 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 21 Jan 2023 01:41:32 -0800
Subject: [PATCH] cmake: Use -idirafter instead of -isystem
isystem dirs are searched before the regular system dirs
this exposes an interesting include ordering problem when using
clang + libc++, when including C++ headers like <cstdlib>
cstdlib includes stdlib.h and in case of libc++, this should be coming
from libc++ as well, which is then eventually including system stdlib.h
libc++ has added a check for checking this order recently, which means
if cstlib ends up including system stdlib.h before libc++ provided
stdlib.h it errors out
| /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
r.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
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. \
| ^
The reason is that include_directories with SYSTEM property adds the
directory via -system and some of these directories point to sysroot
e.g. OPENSSL_INCLUDE_DIR which ends up adding -isystem
<sysroot>/usr/include and causes the system stdlib.h to included before
libc++ stdlib.h
A fix is to use -idirafter which preserved the effects of system headers
but instead of prepending, it will append to system headers and the
issue is addressed
Upstream-Status: Submitted [https://github.com/USCiLab/cereal/pull/777]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
unittests/boost/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/unittests/boost/CMakeLists.txt b/unittests/boost/CMakeLists.txt
index 1d733bc7..08e6a169 100644
--- a/unittests/boost/CMakeLists.txt
+++ b/unittests/boost/CMakeLists.txt
@@ -1,6 +1,6 @@
file(GLOB TESTS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
-include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${Boost_INCLUDE_DIRS}")
# Build all of the non-special tests
foreach(TEST_SOURCE ${TESTS})
--
2.39.1

View File

@@ -0,0 +1,38 @@
From 03bbb1b055c41ec652470f775b55a7cf80d664ef Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 17 Apr 2023 16:46:12 -0700
Subject: [PATCH] doctest: Do not use unnamed class
When compiling with clang this results in emitting absolute path into
debug info, especially .debug_str section has
~(unnamed class at /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/libcereal/1.3.2+gitAUTOINC+ebef1e9298-r0/git/unittests/doctest.h:6428:5)
(unnamed class at /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/libcereal/1.3.2+gitAUTOINC+ebef1e9298-r0/git/unittests/doctest.h:6428:5)
Therefore use a name for the class instead and help get rid of this
absolute path in debug info. This fixes
File /usr/lib/libcereal/ptest/tests/.debug/test_unordered_map in package libcereal-dbg contains reference to TMPDIR
Upstream-Status: Submitted [https://github.com/USCiLab/cereal/pull/788]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
unittests/doctest.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/unittests/doctest.h b/unittests/doctest.h
index cd5b44d6..e6d8f7f9 100644
--- a/unittests/doctest.h
+++ b/unittests/doctest.h
@@ -6424,7 +6424,7 @@ void Context::setCout(std::ostream* out) { p->cout = out; }
static class DiscardOStream : public std::ostream
{
private:
- class : public std::streambuf
+ class discardBufStream: public std::streambuf
{
private:
// allowing some buffering decreases the amount of calls to overflow
--
2.40.0

View File

@@ -0,0 +1,54 @@
From 36054278304945c6aef7d44e58788ca882c67d05 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 1 Sep 2022 15:54:13 -0700
Subject: [PATCH] sandbox: Do not use int8_t in std::uniform_int_distribution
Newer versions of libc++ has dropped supporting this usecase since its
an UB see.
https://reviews.llvm.org/D114920?id=400571
Fixes
uniform_int_distribution.h:162:5: error: static assertion failed due to requirement '__libcpp_random_is_valid_inttype<char>::value': IntType must be a supported integer type
static_assert(__libcpp_random_is_valid_inttype<_IntType>::value, "IntType must be a supported integer type");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/libcereal/1.3.2+gitAUTOINC+ebef1e9298-r0/git/sandbox/performance.cpp:261:9: note: in instantiation of template class 'std::uniform_int_distribution<char>' requested here
c = std::uniform_int_distribution<char>(' ', '~')(gen);
^
/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/libcereal/1.3.2+gitAUTOINC+ebef1e9298-r0/git/sandbox/performance.cpp:261:9: error: type 'std::uniform_int_distribution<char>' does not provide a call operator
c = std::uniform_int_distribution<char>(' ', '~')(gen);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
Upstream-Status: Submitted [https://github.com/USCiLab/cereal/pull/764]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
sandbox/performance.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sandbox/performance.cpp b/sandbox/performance.cpp
index f9307870..aca8c78c 100644
--- a/sandbox/performance.cpp
+++ b/sandbox/performance.cpp
@@ -258,7 +258,7 @@ random_value(std::mt19937 & gen)
{
std::string s(std::uniform_int_distribution<int>(3, 30)(gen), ' ');
for(char & c : s)
- c = std::uniform_int_distribution<char>(' ', '~')(gen);
+ c = static_cast<char>( std::uniform_int_distribution<int>(' ', '~')(gen) );
return s;
}
@@ -277,7 +277,7 @@ std::string random_binary_string(std::mt19937 & gen)
{
std::string s(N, ' ');
for(auto & c : s )
- c = std::uniform_int_distribution<char>('0', '1')(gen);
+ c = static_cast<char>( std::uniform_int_distribution<int>( '0', '1' )(gen) );
return s;
}
--
2.37.3

View File

@@ -0,0 +1,12 @@
#!/bin/sh
cd tests
for atest in test_* ; do
rm -rf tests.log
./${atest} > tests.log 2>&1
if [ $? = 0 ] ; then
echo "PASS: ${atest}"
else
echo "FAIL: ${atest}"
fi
done

View File

@@ -0,0 +1,54 @@
SUMMARY = "A C++11 library for serialization"
HOMEPAGE = "https://uscilab.github.io/cereal/"
SECTION = "libs"
LICENSE = "BSD-3-Clause & MIT & BSL-1.0"
LIC_FILES_CHKSUM = "\
file://LICENSE;md5=4921372a1fb38469e667c38b17a1c4b3 \
file://include/cereal/external/rapidxml/license.txt;md5=d63ab70ba21ca0544b03284958324301 \
file://include/cereal/external/LICENSE;md5=b07578c9df99c0b8b45eb041efd4a645 \
file://include/cereal/external/rapidjson/LICENSE;md5=e7abb663111d4ac17cf00323698aff08 \
file://include/cereal/external/rapidjson/msinttypes/LICENSE;md5=dffce65b98c773976de2e338bd130f46 \
"
DEPENDS = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'boost', '', d)} "
PROVIDES += "${PN}-dev"
PV .= "+git${SRCPV}"
SRCREV = "ebef1e929807629befafbb2918ea1a08c7194554"
SRC_URI = "git://github.com/USCiLab/cereal.git;branch=master;protocol=https \
file://0001-sandbox-Do-not-use-int8_t-in-std-uniform_int_distrib.patch \
file://0001-cmake-Use-idirafter-instead-of-isystem.patch \
file://0001-doctest-Do-not-use-unnamed-class.patch \
file://run-ptest \
"
S = "${WORKDIR}/git"
inherit cmake pkgconfig ptest
LIBATOMIC:mips = "${@bb.utils.contains('PTEST_ENABLED', '1', '-DCEREAL_THREAD_LIBS="-latomic"', '', d)}"
LIBATOMIC:riscv32 = "${@bb.utils.contains('PTEST_ENABLED', '1', '-DCEREAL_THREAD_LIBS="-latomic"', '', d)}"
LIBATOMIC:powerpc = "${@bb.utils.contains('PTEST_ENABLED', '1', '-DCEREAL_THREAD_LIBS="-latomic"', '', d)}"
PACKAGECONFIG ??= "${@bb.utils.contains('PTEST_ENABLED', '1', 'with-tests', '', d)}"
PACKAGECONFIG[with-tests] = "-DWITH_WERROR=OFF -DBUILD_TESTS=ON ${LIBATOMIC},,"
EXTRA_OECMAKE = "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '', '-DJUST_INSTALL_CEREAL=ON', d)} \
${@['','-DSKIP_PORTABILITY_TEST=ON'][d.getVar('SITEINFO_BITS') != '32']}"
do_install_ptest() {
install -d ${D}${PTEST_PATH}/tests
cp ${B}/unittests/test_* ${D}${PTEST_PATH}/tests
}
ALLOW_EMPTY:${PN} = "1"
RDEPENDS:${PN}-dev = ""
BBCLASSEXTEND = "native nativesdk"
#it needs to work with CXXFLAGS += " -mlong-double-64" but ppc only supports 128bit long double
COMPATIBLE_HOST:powerpc:libc-musl = "null"
COMPATIBLE_HOST:powerpc64le:libc-musl = "null"