abseil-cpp: Set CMAKE_CXX_STANDARD to 17
PATCH 1/1 abseil-cpp: Set CMAKE_CXX_STANDARD to 17
The compiler defaults to C++ < 17 which causes build failures. Abseil requires C++17 or higher, so explicitly set CMAKE_CXX_STANDARD=17 to ensure the build uses the correct C++ standard.
Error:
CMake Error at CMake/AbseilDll.cmake:745 (message):
The compiler defaults to or is configured for C++ < 17. C++ >= 17 is required and Abseil and all libraries that use Abseil must use the same C++ language standard
--- meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_20260107.0.bb | 1 + 1 file changed, 1 insertion(+)
meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_20260107.0.bb +1 -0
@@ -21,6 +21,7 @@ inherit cmake EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \ -DBUILD_TESTING=OFF \ -DABSL_ENABLE_INSTALL=ON \ + -DCMAKE_CXX_STANDARD=17 \ " # riscv32-yoe-linux-ld.lld: error: undefined reference: __atomic_store_8 # >>> referenced by <recipe-sysroot>/usr/lib/libabsl_flags_internal.so.2505.0.0 (disallowed by --no-allow-shlib-undefined)
Signature · 1 line
2.34.1
Quoted 35 lines
-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Yogesh Tyagi via lists.openembedded.org
Sent: den 2 februari 2026 20:17
To: [email protected]
Cc: [email protected]
Subject: [oe] [meta-oe][PATCH] abseil-cpp: SetCMAKE_CXX_STANDARDto 17The compiler defaults to C++ < 17 which causes build failures. Abseil requires C++17 or higher, so explicitly set CMAKE_CXX_STANDARD=17 to ensure the build uses the correct C++ standard.
Error:
CMake Error at CMake/AbseilDll.cmake:745 (message):
The compiler defaults to or is configured for C++ < 17. C++ >= 17 is required and Abseil and all libraries that use Abseil must use the same C++ language standardSigned-off-by Yogesh Tyagi <[email protected]>--- meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_20260107.0.bb | 1 + 1 file changed, 1 insertion(+)meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_20260107.0.bb +1
-1@@ -21,6 +21,7 @@ inherit cmake EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \ -DBUILD_TESTING=OFF \ -DABSL_ENABLE_INSTALL=ON \ + -DCMAKE_CXX_STANDARD=17 \ " # riscv32-yoe-linux-ld.lld: error: undefined reference: __atomic_store_8 # >>> referenced by <recipe-sysroot>/usr/lib/libabsl_flags_internal.so.2505.0.0 (disallowed by --no-allow-shlib-undefined) --
Quoted 1 line
2.34.1
I am not sure this is the correct thing to do. This means that for target, you will now downgrade the C++ standard when building abseil. However, as it says, all libraries that use abseil must use the same C++ standard. This will thus no longer be the case, unless all users of abseil are also modified to use C++17.
I believe the error you are seeing comes from building abseil-native, i.e., the native compiler you use uses an older C++ standard by default. But also in this case, just changing it for abseil is probably not the right thing to do.
The correct solution, I believe, is to use a newer native compiler. This may mean that you will have to use a buildtools tarball unless you can upgrade your host system.
//Peter
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 54 lines
-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Peter Kjellerstedt via lists.openembedded.org
Sent: den 3 februari 2026 11:05
To: [email protected]; [email protected]
Subject: Re: [oe] [meta-oe][PATCH] abseil-cpp: SetCMAKE_CXX_STANDARDto 17Quoted 35 lines
-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Yogesh Tyagi via lists.openembedded.org
Sent: den 2 februari 2026 20:17
To: [email protected]
Cc: [email protected]
Subject: [oe] [meta-oe][PATCH] abseil-cpp: SetCMAKE_CXX_STANDARDto 17The compiler defaults to C++ < 17 which causes build failures. Abseil requires C++17 or higher, so explicitly set CMAKE_CXX_STANDARD=17 to ensure the build uses the correct C++ standard.
Error:
CMake Error at CMake/AbseilDll.cmake:745 (message):
The compiler defaults to or is configured for C++ < 17. C++ >= 17 is required and Abseil and all libraries that use Abseil must use the same C++ language standardSigned-off-by Yogesh Tyagi <[email protected]>--- meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_20260107.0.bb | 1 + 1 file changed, 1 insertion(+)meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_20260107.0.bb +1
-1@@ -21,6 +21,7 @@ inherit cmake EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \ -DBUILD_TESTING=OFF \ -DABSL_ENABLE_INSTALL=ON \ + -DCMAKE_CXX_STANDARD=17 \ " # riscv32-yoe-linux-ld.lld: error: undefined reference: __atomic_store_8 # >>> referenced by <recipe-sysroot>/usr/lib/libabsl_flags_internal.so.2505.0.0 (disallowed by --no-allow-shlib-undefined) --Quoted 1 line
2.34.1
I am not sure this is the correct thing to do. This means that for target, you will now downgrade the C++ standard when building abseil. However, as it says, all libraries that use abseil must use the same C++ standard. This will thus no longer be the case, unless all users of abseil are also modified to use C++17.
I believe the error you are seeing comes from building abseil-native, i.e., the native compiler you use uses an older C++ standard by default. But also in this case, just changing it for abseil is probably not the right thing to do.
Quoted 5 lines
The correct solution, I believe, is to use a newer native compiler. This may mean that you will have to use a buildtools tarball unless you can upgrade your host system.
//Peter
I note that this was integrated without any response to my concerns.
//Peter