diff mbox series

[meta-oe] rocksdb: fix build error for DEBUG_BUILD

Message ID 20240404125118.3067969-1-yi.zhao@windriver.com
State Accepted
Headers show
Series [meta-oe] rocksdb: fix build error for DEBUG_BUILD | expand

Commit Message

Yi Zhao April 4, 2024, 12:51 p.m. UTC
It fails to build rocksdb when '-Og' is set in CXXFLAGS (e.g.
DEBUG_BUILD = '1' in local.conf):

rocksdb/9.0.0/git/util/xxhash.h:4491:1: error: inlining failed in call
to 'always_inline' 'void XXH3_scrambleAcc_sse2(void*, const void*)':
function not considered for inlining
 4491 | XXH3_scrambleAcc_sse2(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret)
      | ^~~~~~~~~~~~~~~~~~~~~
rocksdb/9.0.0/git/util/xxhash.h:5139:19: note: called from here
 5139 |         f_scramble(acc, secret + secretSize - XXH_STRIPE_LEN);
      |         ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rocksdb/9.0.0/git/util/xxhash.h:4177:1: error: inlining failed in call
to 'always_inline' 'void XXH3_accumulate_sse2(xxh_u64*, const xxh_u8*, const xxh_u8*, size_t)':
function not considered for inlining
 4177 | XXH3_accumulate_##name(xxh_u64* XXH_RESTRICT acc,           \
      | ^~~~~~~~~~~~~~~~

Check and disable inlining when "-Og" is present.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
 meta-oe/recipes-dbs/rocksdb/rocksdb_9.0.0.bb | 2 ++
 1 file changed, 2 insertions(+)

Comments

Khem Raj April 7, 2024, 3:43 p.m. UTC | #1
On Thu, 04 Apr 2024 20:51:18 +0800, Yi Zhao wrote:
> It fails to build rocksdb when '-Og' is set in CXXFLAGS (e.g.
> DEBUG_BUILD = '1' in local.conf):
> 
> rocksdb/9.0.0/git/util/xxhash.h:4491:1: error: inlining failed in call
> to 'always_inline' 'void XXH3_scrambleAcc_sse2(void*, const void*)':
> function not considered for inlining
>  4491 | XXH3_scrambleAcc_sse2(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret)
>       | ^~~~~~~~~~~~~~~~~~~~~
> rocksdb/9.0.0/git/util/xxhash.h:5139:19: note: called from here
>  5139 |         f_scramble(acc, secret + secretSize - XXH_STRIPE_LEN);
>       |         ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> rocksdb/9.0.0/git/util/xxhash.h:4177:1: error: inlining failed in call
> to 'always_inline' 'void XXH3_accumulate_sse2(xxh_u64*, const xxh_u8*, const xxh_u8*, size_t)':
> function not considered for inlining
>  4177 | XXH3_accumulate_##name(xxh_u64* XXH_RESTRICT acc,           \
>       | ^~~~~~~~~~~~~~~~
> 
> [...]

Applied, thanks!

[1/1] rocksdb: fix build error for DEBUG_BUILD
      commit: 11c7659ecc5f8992740119bba6f20642d07cd03a

Best regards,
diff mbox series

Patch

diff --git a/meta-oe/recipes-dbs/rocksdb/rocksdb_9.0.0.bb b/meta-oe/recipes-dbs/rocksdb/rocksdb_9.0.0.bb
index 76d75f2b5..ee007acfa 100644
--- a/meta-oe/recipes-dbs/rocksdb/rocksdb_9.0.0.bb
+++ b/meta-oe/recipes-dbs/rocksdb/rocksdb_9.0.0.bb
@@ -44,6 +44,8 @@  EXTRA_OECMAKE = "\
     -DFAIL_ON_WARNINGS=OFF \
 "
 
+CXXFLAGS += "${@bb.utils.contains('SELECTED_OPTIMIZATION', '-Og', '-DXXH_NO_INLINE_HINTS', '', d)}"
+
 do_install:append() {
     # Fix for qa check buildpaths
     sed -i "s#${RECIPE_SYSROOT}##g" ${D}${libdir}/cmake/rocksdb/RocksDBTargets.cmake