Skip to content

Commit

Permalink
aws-sdk-cpp: enable sanitizer if ptest is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-roos committed Jan 21, 2025
1 parent 7963107 commit b1e7b3a
Showing 1 changed file with 14 additions and 4 deletions.
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"

0 comments on commit b1e7b3a

Please sign in to comment.