You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title: Allow Envoy builds using newer toolchain versions
Description:
Currently Envoy CI image uses clang-14, I also observed that Envoy builds with clang-15 (though might need to disable some compiler warnings here and there). It would be good to be able to build using newer toolchain versions as well.
Specifically, in Microsoft, we've been a bit limited in the versions of clang available in our internal release pipeline and had to use clang-18/llvm-18. We were able to patch Envoy to build using clang-18 successfully and would like to contribute those changes to the upstream.
I'm filing this bug to track upstreaming of the changes. Most of the changes are to the Envoy dependencies, so it would be good to contribute them to the upstream repositories and just bump versions of the dependencies. Some of the changes are in Envoy build configs and may need a bit more digging to come up with a better fix than the one we have.
Here is the summary of the changes I made:
In V8 disable a couple of compiler warnings: -Wno-deprecated-this-capture and -Wno-deprecated-declarations
In protobuf disable a compiler warning: -Wno-deprecated-declarations
In ippcp/crypto_mb fix/replace the usage of __INLINE macro, basically in C and C++ (I think) all identifiers starting with two underscores (like __INLINE) are reserved for the compiler and standard library implementations; ippcp/crypto_mb library defines and uses __INLINE macro, but, unfortunately, newer versions of libc++ also have __INLINE macro for internal use and the __INLINE macro defined by the toolchain breaks ippcp/crypto_mb builds. I worked around that using this change krinkinmu@673c43d, but a proper fix, I think, is to stop using a reserved identifiers in ippcp code.
colm and ragel dependencies use -lstdc++ flag for builds, for not very clear reasons, in my case it resulted in an attempt to statically link with libstdc++.so - I need to dig a bit more into this. I worked around that using krinkinmu@c8dc3ed, but maybe the problem is that I didn't have static libstdc++ installed on my system. Regardless, it's a bit confusing to have libstdc++ as a flag unconditionally, even for libc++ builds.
Disable a new(?) compiler warning --cxxopt=-Wno-thread-safety-reference-return (I need to double check where this warning causes an issue exactly and maybe we can fix it without disabling the warning)
Make sure that dwp tool from LLVM toolchain is actually used to aggregate debugging information - this might be specific to our setup, but for some reason in my tests the GNU version of dwp tool was used and that version couldn't handle debugging information produced by clang (I suspect that it's because GNU tools don't support fission that well). I worked around the issue by just redirecting dwp symlink to the llvm-dwp, but maybe in Bazel we should just have a CC toolchain configuration that picks the right dwp. This seem to be the most confusing issue from all the problems I had with clang-18 builds - more work is needed to verify if this issue was specific to Microsoft build setup or not and, if it's not specific to Microsoft build pipelines, what the proper fix should look like.
With those changes I was able to build Envoy + Envoy contrib (everything that ci/do_ci.sh release.server_only builds) with clang-18 and libc++.
Title: Allow Envoy builds using newer toolchain versions
Description:
Currently Envoy CI image uses clang-14, I also observed that Envoy builds with clang-15 (though might need to disable some compiler warnings here and there). It would be good to be able to build using newer toolchain versions as well.
Specifically, in Microsoft, we've been a bit limited in the versions of clang available in our internal release pipeline and had to use clang-18/llvm-18. We were able to patch Envoy to build using clang-18 successfully and would like to contribute those changes to the upstream.
I'm filing this bug to track upstreaming of the changes. Most of the changes are to the Envoy dependencies, so it would be good to contribute them to the upstream repositories and just bump versions of the dependencies. Some of the changes are in Envoy build configs and may need a bit more digging to come up with a better fix than the one we have.
Here is the summary of the changes I made:
-Wno-deprecated-this-capture
and-Wno-deprecated-declarations
-Wno-deprecated-declarations
Fix cel-cpp builds due to incomplete types: bump cel-cpp version to include- addressed by c7d0d5a56d2baec1be480a5186bed5f094526e64025a144
and18cf5685e93fb8c07c807d913fabe9d1b54db87f
ippcp/crypto_mb
fix/replace the usage of__INLINE
macro, basically in C and C++ (I think) all identifiers starting with two underscores (like__INLINE
) are reserved for the compiler and standard library implementations;ippcp/crypto_mb
library defines and uses__INLINE
macro, but, unfortunately, newer versions of libc++ also have__INLINE
macro for internal use and the__INLINE
macro defined by the toolchain breaksippcp/crypto_mb
builds. I worked around that using this change krinkinmu@673c43d, but a proper fix, I think, is to stop using a reserved identifiers in ippcp code.librdkafka
there is a known issue with newer versions of LLVM tools (see librdkafka cannot be built with LLD linker confluentinc/librdkafka#4593), it's possible to work around it locally (see krinkinmu@9376599), but probably we should wait for the upstream fix and update the version we usecolm
andragel
dependencies use-lstdc++
flag for builds, for not very clear reasons, in my case it resulted in an attempt to statically link with libstdc++.so - I need to dig a bit more into this. I worked around that using krinkinmu@c8dc3ed, but maybe the problem is that I didn't have static libstdc++ installed on my system. Regardless, it's a bit confusing to have libstdc++ as a flag unconditionally, even for libc++ builds.--cxxopt=-Wno-thread-safety-reference-return
(I need to double check where this warning causes an issue exactly and maybe we can fix it without disabling the warning)dwp
tool from LLVM toolchain is actually used to aggregate debugging information - this might be specific to our setup, but for some reason in my tests the GNU version ofdwp
tool was used and that version couldn't handle debugging information produced by clang (I suspect that it's because GNU tools don't support fission that well). I worked around the issue by just redirectingdwp
symlink to thellvm-dwp
, but maybe in Bazel we should just have a CC toolchain configuration that picks the rightdwp
. This seem to be the most confusing issue from all the problems I had with clang-18 builds - more work is needed to verify if this issue was specific to Microsoft build setup or not and, if it's not specific to Microsoft build pipelines, what the proper fix should look like.With those changes I was able to build Envoy + Envoy contrib (everything that
ci/do_ci.sh release.server_only
builds) with clang-18 and libc++.+cc @phlax and @mathetake
The text was updated successfully, but these errors were encountered: