Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport styhead-next] 2025 01 20 master next sdk cpp sanitizer #11162

Merged
merged 4 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions recipes-sdk/aws-c-cal/aws-c-cal_0.8.1.bb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ PACKAGECONFIG[with-tests] = "-DBUILD_TESTING=ON -DCMAKE_CROSSCOMPILING=OFF,-DBUI
PACKAGECONFIG[static] = "-DBUILD_SHARED_LIBS=OFF,-DBUILD_SHARED_LIBS=ON"

FILES:${PN}-dev += "${libdir}/*/cmake"
FILES:${PN}-staticdev += "${libdir}/lib*.a"

RDEPENDS:${PN} = "\
aws-c-common \
Expand Down
9 changes: 8 additions & 1 deletion recipes-sdk/aws-crt-cpp/aws-crt-cpp_0.29.9.bb
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ EXTRA_OECMAKE += "\
# for generating Makefiles to run tests
OECMAKE_GENERATOR = "Unix Makefiles"

PACKAGECONFIG ??= "\
PACKAGECONFIG ?= "\
${@bb.utils.contains('PTEST_ENABLED', '1', 'with-tests', '', d)} \
"

PACKAGECONFIG:append:x86-64 = " ${@bb.utils.contains('PTEST_ENABLED', '1', 'sanitize', '', d)}"

# enable PACKAGECONFIG = "static" to build static instead of shared libs
PACKAGECONFIG[static] = "-DBUILD_SHARED_LIBS=OFF,-DBUILD_SHARED_LIBS=ON"

Expand All @@ -69,3 +71,8 @@ do_install_ptest () {
install -d ${D}${PTEST_PATH}/tests
install -m 0755 ${B}/tests/aws-crt-cpp-tests ${D}${PTEST_PATH}/tests/
}

# -fsanitize=address does cause this
# nooelint: oelint.vars.insaneskip:INSANE_SKIP
INSANE_SKIP:x86-64 += "${@bb.utils.contains('PACKAGECONFIG', 'sanitize', 'buildpaths', '', d)}"
PACKAGECONFIG[sanitize] = "-DENABLE_SANITIZERS=ON -DSANITIZERS=address, -DENABLE_SANITIZERS=OFF,gcc-sanitizers"
18 changes: 14 additions & 4 deletions recipes-sdk/aws-sdk-cpp/aws-sdk-cpp_1.11.488.bb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ S = "${WORKDIR}/git"

inherit cmake ptest pkgconfig

PACKAGECONFIG ??= "\
PACKAGECONFIG ?= "\
${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \
${@bb.utils.contains('PTEST_ENABLED', '1', 'with-tests', '', d)}"
${@bb.utils.contains('PTEST_ENABLED', '1', 'with-tests', '', d)} \
"

PACKAGECONFIG:append:x86-64 = " ${@bb.utils.contains('PTEST_ENABLED', '1', 'sanitize', '', d)}"

PACKAGECONFIG[pulseaudio] = "-DPULSEAUDIO=TRUE, -DPULSEAUDIO=FALSE, pulseaudio"

Expand All @@ -43,6 +46,7 @@ python populate_packages:prepend () {
do_split_packages(d, d.expand('${libdir}'), r'^lib(.*)\.so$', '%s', 'library for %s', extra_depends='', prepend=True, hook=hook)

d.setVar("AWS_SDK_PACKAGES", " ".join(packages))

}

# enable PACKAGECONFIG = "static" to build static instead of shared libs
Expand All @@ -63,8 +67,8 @@ OECMAKE_CXX_FLAGS += "${@bb.utils.contains('PTEST_ENABLED', '1', '-Wno-maybe-uni
OECMAKE_CXX_FLAGS += "-Wno-psabi"

EXTRA_OECMAKE += "\
-DBUILD_DEPS=OFF \
-DCMAKE_MODULE_PATH=${STAGING_LIBDIR}/cmake \
-DBUILD_DEPS=OFF \
-DCMAKE_MODULE_PATH=${STAGING_LIBDIR}/cmake \
"

RDEPENDS:${PN}-ptest += "\
Expand All @@ -86,3 +90,9 @@ do_install_ptest () {
# https://github.com/aws/aws-sdk-cpp/issues/2242
# nooelint: oelint.vars.insaneskip:INSANE_SKIP
INSANE_SKIP:${PN}-src:append:class-target:arm = " buildpaths"

# -fsanitize=address does cause this
# nooelint: oelint.vars.insaneskip:INSANE_SKIP
INSANE_SKIP:x86-64 += "${@bb.utils.contains('PACKAGECONFIG', 'sanitize', 'buildpaths', '', d)}"

PACKAGECONFIG[sanitize] = "'-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -g -fsanitize=address -fno-omit-frame-pointer',,gcc-sanitizers"
12 changes: 10 additions & 2 deletions recipes-sdk/s2n/s2n_1.5.11.bb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ LICENSE = "Apache-2.0"

LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"

DEPENDS = "${@bb.utils.contains('PACKAGECONFIG', 'static', 'aws-lc', 'openssl', d)}"
DEPENDS = "\
${@bb.utils.contains('PACKAGECONFIG', 'static', 'aws-lc', 'openssl', d)} \
"

PROVIDES += "aws/s2n"

Expand All @@ -24,10 +26,14 @@ inherit cmake ptest pkgconfig

CFLAGS:append = " -Wl,-Bsymbolic"

PACKAGECONFIG ??= "\
PACKAGECONFIG ?= "\
${@bb.utils.contains('PTEST_ENABLED', '1', 'with-tests', '', d)} \
"

PACKAGECONFIG:append:x86-64 = "\
${@bb.utils.contains('PTEST_ENABLED', '1', 'sanitize', '', d)} \
"

# enable PACKAGECONFIG = "static" to build static instead of shared libs
PACKAGECONFIG[static] = "-DBUILD_SHARED_LIBS=OFF,-DBUILD_SHARED_LIBS=ON"

Expand Down Expand Up @@ -56,3 +62,5 @@ do_install_ptest () {
}

BBCLASSEXTEND = "native nativesdk"

PACKAGECONFIG[sanitize] = "-DS2N_ADDRESS_SANITIZER=ON, -DS2N_ADDRESS_SANITIZER=OFF, gcc-sanitizers"
Loading