We are in the process of integrating YouTube using the following tag: 25.lts.20. Our environment includes the following details:
During the integration, we encountered the following compilation error:
"*****************************
../../base/cxx20_is_constant_evaluated.h: In function 'constexpr bool base::is_constant_evaluated()':
../../base/cxx20_is_constant_evaluated.h:16:10: error: '__builtin_is_constant_evaluated' was not declared in this scope
return __builtin_is_constant_evaluated();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../base/cxx20_is_constant_evaluated.h:16:10: note: suggested alternative: 'is_constant_evaluated'
return __builtin_is_constant_evaluated();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
is_constant_evaluated
****************************"
It should be noted that the function __builtin_is_constant_evaluated() is supported starting from GCC9.
Is there a way to successfully compile without upgrading the GCC version?
Thanks,
Ines,
You received this message because you are subscribed to the Google Groups "cobalt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cobalt-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cobalt-dev/7d92a284-e6ab-488e-8b27-9bd6efdbd74dn%40googlegroups.com.
We attempted to activate the flag build_with_separate_cobalt_toolchain
to build Cobalt using the Clang toolchain (based on the provided link) and subsequently build our Starboard implementation using the GCC (8.3.0) toolchain. However, we are still encountering compilation issues.
Did we use the correct flag? Is there any documentation available that explains how to build Cobalt and a custom Starboard implementation using different toolchains?
Ines,
Thank you for your prompt response and the provided documentation.
I should have mentioned that our Starboard implementation does not support Evergreen features.
In this case, is it still necessary to have two separate out/
directories for the build artifacts (Cobalt and our Starboard)?
Additionally, can the build_with_separate_cobalt_toolchain
flag be used in our case?
Hi Kaido,
Following your latest recommendation, I have modified the toolchain file BUILD.gn as shown below.
#here we set the host toolchain witch is clang 17
cobalt_clang_toolchain("native_target") {
cc = "$CC_HOST"
cxx = "$CXX_HOST"
ld = cxx
ar = "$AR_HOST"
toolchain_args = {
current_os = "linux"
current_cpu = "x86"
is_clang = true
is_starboard = false
is_native_target_build = true
}
}
#here we set our toolchain witch is gcc 8
gcc_toolchain("target") {
cc = "$CC"
cxx = "$CXX"
readelf = "$READELF"
nm = "$NM"
ld = cxx
ar = "$AR"
toolchain_args = {
is_clang = false
}
}
cobalt_clang_toolchain("cobalt") {
native_linker_path = gcc_toolchain_cxx
}
Additionally, I have enabled the relevant flags in the BUILDCONFIG.gn file and made the following adjustments:
is_native_target_build = false
sb_is_modular = true
build_with_separate_cobalt_toolchain = true
host_toolchain = "//$starboard_path/toolchain:native_target"
if (build_with_separate_cobalt_toolchain) {
cobalt_toolchain = "//$starboard_path/toolchain:cobalt"
starboard_toolchain = "//$starboard_path/toolchain:target"
} else {
starboard_toolchain = ""//$starboard_path/toolchain:target"
cobalt_toolchain = starboard_toolchain
}
In your opinion, can I, with these modifications, successfully compile the Cobalt core using the Clang toolchain while building our Starboard with GCC?
If you have any suggestions or insights that could assist me, I would greatly appreciate your guidance to help resolve the issue.
Thank you very much for your support,
Ines