Skip to content

Commit 9bb8cc0

Browse files
committed
aws-iot-device-sdk-cpp-v2: change to build aws-crt-cpp and aws-c-iot static
This disable the shared libs build for aws-crt-cpp and aws-c-iot, cause they will conflict with already exising versions on a system. Therefor they are static linked into the cpp libs to not conflict.
1 parent 98d07cb commit 9bb8cc0

File tree

4 files changed

+34
-42
lines changed

4 files changed

+34
-42
lines changed

.github/workflows/build-test-recipe.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
export RECIPES=$( echo "${{ needs.changed.outputs.diff }}" | tr ' ' '\n' | grep '\.bb.*$' | sed 's!.*/!!' | sed 's!.bb!!' | sed 's!_.*!!' | sort | uniq | sed -z $'s/\\\n/ /g')
9090
if [ "" == "$RECIPES" ]; then
9191
echo "No changed recipes, adding everything with a ptest to test, build"
92-
THINGS_TO_EXCLUDE="! -name aws-lc* ! -name neo-ai-tv* ! -name corretto-17-bin* ! -name corretto-21-bin* ! -name corretto-8-bin* ! -name firecracker-bin* ! -name jailer-bin* ! -name amazon-kvs-producer-sdk-c* ! -name aws-cli-v2* ! -name aws-iot-device-sdk-cpp-v2-samples-fleet-provisoning* ! -name aws-c-iot* "
92+
THINGS_TO_EXCLUDE="! -name aws-lc* ! -name neo-ai-tv* ! -name corretto-17-bin* ! -name corretto-21-bin* ! -name corretto-8-bin* ! -name firecracker-bin* ! -name jailer-bin* ! -name amazon-kvs-producer-sdk-c* ! -name aws-cli-v2* "
9393
if [ ${{ matrix.machine }} == "qemuarm" ]; then
9494
THINGS_TO_EXCLUDE+="! -name amazon-kvs-webrtc-sdk* ! -name amazon-kvs-producer-pic* ! -name amazon-cloudwatch-agent*"
9595
fi

recipes-sdk/aws-iot-device-sdk-cpp-v2/aws-iot-device-sdk-cpp-v2-samples.inc

-7
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,3 @@ SOLIBS = "*.so"
3434
FILES_SOLIBSDEV = ""
3535

3636
BBCLASSEXTEND = "native nativesdk"
37-
38-
# -fsanitize=address does cause this
39-
# nooelint: oelint.vars.insaneskip:INSANE_SKIP
40-
INSANE_SKIP += "${@bb.utils.contains('PACKAGECONFIG', 'sanitize', 'buildpaths', '', d)}"
41-
42-
PACKAGECONFIG[sanitize] = ",, gcc-sanitizers"
43-
OECMAKE_CXX_FLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'sanitize', '-fsanitize=address,undefined -fno-omit-frame-pointer', '', d)}"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
This disable the shared libs build for aws-crt-cpp and aws-c-iot,
2+
cause they will conflict with already exising versions on a system.
3+
Therefor they are static linked into the cpp libs to not conflict.
4+
5+
Upstream-Status: Inappropriate [oe specific]
6+
7+
8+
Index: git/crt/aws-crt-cpp/CMakeLists.txt
9+
===================================================================
10+
--- git.orig/crt/aws-crt-cpp/CMakeLists.txt
11+
+++ git/crt/aws-crt-cpp/CMakeLists.txt
12+
@@ -1,5 +1,7 @@
13+
cmake_minimum_required(VERSION 3.9...3.31)
14+
15+
+set(BUILD_SHARED_LIBS OFF)
16+
+
17+
option(BUILD_DEPS "Builds aws common runtime dependencies as part of build. Turn off if you want to control your dependency chain." ON)
18+
option(BYO_CRYPTO "Don't build a tls implementation or link against a crypto interface. This feature is only for unix builds currently" OFF)
19+
option(USE_OPENSSL "Set this if you want to use your system's OpenSSL 1.0.2/1.1.1 compatible libcrypto" OFF)
20+
Index: git/crt/aws-c-iot/CMakeLists.txt
21+
===================================================================
22+
--- git.orig/crt/aws-c-iot/CMakeLists.txt
23+
+++ git/crt/aws-c-iot/CMakeLists.txt
24+
@@ -1,6 +1,8 @@
25+
cmake_minimum_required(VERSION 3.9...3.31)
26+
project(aws-c-iot C)
27+
28+
+set(BUILD_SHARED_LIBS OFF)
29+
+
30+
option(USE_EXTERNAL_DEPS_SOURCES "Use dependencies provided by add_subdirectory command" OFF)
31+
32+
if (USE_EXTERNAL_DEPS_SOURCES)

recipes-sdk/aws-iot-device-sdk-cpp-v2/aws-iot-device-sdk-cpp-v2_1.35.1.bb

+1-34
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ require aws-iot-device-sdk-cpp-v2-version.inc
1414
SRC_URI:append = " \
1515
file://run-ptest \
1616
file://openssl_suppressions.txt \
17+
${@bb.utils.contains('PACKAGECONFIG', 'static', '', 'file://001-shared-static-crt-libs.patch', d)} \
1718
"
1819

1920
S = "${WORKDIR}/git"
@@ -46,28 +47,7 @@ PACKAGECONFIG ??= "\
4647
build-deps \
4748
"
4849

49-
PACKAGECONFIG:append:x86-64 = " ${@bb.utils.contains('PTEST_ENABLED', '1', 'sanitize', '', d)}"
50-
5150
FILES:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'build-deps', '/usr/lib/*', '', d)}"
52-
FILES:${PN}-dev += "\
53-
${libdir}/*/cmake \
54-
${libdir}/pkgconfig/*.pc \
55-
${libdir}/libaws-c-common.so \
56-
${libdir}/libs2n.so \
57-
${libdir}/libaws-c-sdkutils.so \
58-
${libdir}/libaws-c-io.so \
59-
${libdir}/libaws-c-cal.so \
60-
${libdir}/libaws-c-compression.so \
61-
${libdir}/libaws-c-http.so \
62-
${libdir}/libaws-c-auth.so \
63-
${libdir}/libaws-c-mqtt.so \
64-
${libdir}/libaws-checksums.so \
65-
${libdir}/libaws-c-event-stream.so \
66-
${libdir}/libaws-c-s3.so \
67-
${libdir}/libaws-c-iot.so \
68-
"
69-
70-
RCONFLICTS:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'build-deps', 'aws-c-iot', '', d)}"
7151

7252
# nooelint: oelint.vars.insaneskip:INSANE_SKIP
7353
INSANE_SKIP += "${@bb.utils.contains('PACKAGECONFIG', 'build-deps', 'ldflags', '', d)}"
@@ -79,16 +59,3 @@ RDEPENDS:${PN}-ptest:prepend = "\
7959
BBCLASSEXTEND = "native nativesdk"
8060

8161
EXTRA_OECMAKE:append = " -DCMAKE_BUILD_TYPE=RelWithDebInfo"
82-
83-
# -fsanitize=address does cause this
84-
# nooelint: oelint.vars.insaneskip:INSANE_SKIP
85-
INSANE_SKIP += "${@bb.utils.contains('PACKAGECONFIG', 'sanitize', 'buildpaths', '', d)}"
86-
87-
PACKAGECONFIG[sanitize] = ",, gcc-sanitizers"
88-
OECMAKE_CXX_FLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'sanitize', '-fsanitize=address,undefined -fno-omit-frame-pointer', '', d)}"
89-
90-
do_install_ptest:append() {
91-
install -d ${D}${PTEST_PATH}/tests
92-
93-
install ${UNPACKDIR}/openssl_suppressions.txt ${D}${PTEST_PATH}/
94-
}

0 commit comments

Comments
 (0)