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
What version of gRPC and what language are you using?
1.51.0 via the python bindings.
What operating system (Linux, Windows,...) and version?
Gentoo Linux (rolling release)
What runtime / compiler are you using (e.g. python version or version of gcc)
gcc (Gentoo 13.2.1_p20240210 p14) 13.2.1 20240210
What did you do?
I tried to build the python grpcio module with LTO.
Add the following to *FLAGS: -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing
Note the -Werror=* flags are used to help detect cases where the compiler tries to optimize by assuming UB cannot exist in the source code -- if it does exist, ordinarily the code would be miscompiled, and this says to make the miscompilation a fatal error.
Run: emerge -1 dev-python/grpcio
What did you expect to see?
A successful compilation.
What did you see instead?
2024-03-20 23:23:18,978 root INFO x86_64-pc-linux-gnu-g++ -shared -Wl,-O1 -Wl,--as-needed -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0 -march=native -fstack-protector-all -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-clash-protection -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types -DNDEBUG /var/tmp/portage/dev-python/grpcio-1.51.0-r1/work/grpcio-1.51.0-python3_11/build/temp.linux-x86_64-cpython-311/src/core/ext/filters/census/grpc_context.o [...] /var/tmp/portage/dev-python/grpcio-1.51.0-r1/work/grpcio-1.51.0-python3_11/build/temp.linux-x86_64-cpython-311/third_party/upb/upb/upb.o -L/usr/lib64 -lrt -lm -lssl -lcrypto -lz -lcares -o /var/tmp/portage/dev-python/grpcio-1.51.0-r1/work/grpcio-1.51.0-python3_11/build/lib.linux-x86_64-cpython-311/grpc/_cython/cygrpc.cpython-311-x86_64-linux-gnu.so -lpthread -static-libgcc
src/core/lib/iomgr/ev_epoll1_linux.cc:146:8: error: type ‘struct grpc_fd’ violates the C++ One Definition Rule [-Werror=odr]
146 | struct grpc_fd {
| ^
src/core/lib/iomgr/ev_poll_posix.cc:77:8: note: a different type is defined in another translation unit
77 | struct grpc_fd {
| ^
src/core/lib/iomgr/ev_epoll1_linux.cc:149:58: note: the first difference of corresponding definitions is field ‘read_closure’
149 | grpc_core::ManualConstructor<grpc_core::LockfreeEvent> read_closure;
| ^
src/core/lib/iomgr/ev_poll_posix.cc:84:11: note: a field with different name is defined in another translation unit
84 | gpr_atm refst;
| ^
src/core/lib/iomgr/ev_epoll1_linux.cc:140:8: error: type ‘struct grpc_fork_fd_list’ violates the C++ One Definition Rule [-Werror=odr]
140 | struct grpc_fork_fd_list {
| ^
src/core/lib/iomgr/ev_poll_posix.cc:67:8: note: a different type is defined in another translation unit
67 | struct grpc_fork_fd_list {
| ^
src/core/lib/iomgr/ev_epoll1_linux.cc:142:12: note: the first difference of corresponding definitions is field ‘next’
142 | grpc_fd* next;
| ^
src/core/lib/iomgr/ev_poll_posix.cc:71:26: note: a field with different name is defined in another translation unit
71 | grpc_cached_wakeup_fd* cached_wakeup_fd;
| ^
src/core/lib/iomgr/ev_epoll1_linux.cc:235:8: error: type ‘struct grpc_pollset_set’ violates the C++ One Definition Rule [-Werror=odr]
235 | struct grpc_pollset_set {
| ^
src/core/lib/iomgr/ev_poll_posix.cc:244:8: note: a different type is defined in another translation unit
244 | struct grpc_pollset_set {
| ^
src/core/lib/iomgr/ev_epoll1_linux.cc:236:8: note: the first difference of corresponding definitions is field ‘unused’
236 | char unused;
| ^
src/core/lib/iomgr/ev_poll_posix.cc:245:10: note: a field with different name is defined in another translation unit
245 | gpr_mu mu;
| ^
src/core/lib/iomgr/ev_epoll1_linux.cc:182:8: error: type ‘struct grpc_pollset_worker’ violates the C++ One Definition Rule [-Werror=odr]
182 | struct grpc_pollset_worker {
| ^
src/core/lib/iomgr/ev_poll_posix.cc:188:8: note: a different type is defined in another translation unit
188 | struct grpc_pollset_worker {
| ^
src/core/lib/iomgr/ev_epoll1_linux.cc:183:14: note: the first difference of corresponding definitions is field ‘state’
183 | kick_state state;
| ^
src/core/lib/iomgr/ev_poll_posix.cc:189:26: note: a field with different name is defined in another translation unit
189 | grpc_cached_wakeup_fd* wakeup_fd;
| ^
src/core/lib/iomgr/ev_epoll1_linux.cc:210:8: error: type ‘struct grpc_pollset’ violates the C++ One Definition Rule [-Werror=odr]
210 | struct grpc_pollset {
| ^
src/core/lib/iomgr/ev_poll_posix.cc:196:8: note: a different type is defined in another translation unit
196 | struct grpc_pollset {
| ^
src/core/lib/iomgr/ev_epoll1_linux.cc:212:25: note: the first difference of corresponding definitions is field ‘neighborhood’
212 | pollset_neighborhood* neighborhood;
| ^
src/core/lib/iomgr/ev_poll_posix.cc:198:23: note: a field with different name is defined in another translation unit
198 | grpc_pollset_worker root_worker;
| ^
./src/core/tsi/ssl/session_cache/ssl_session_cache.h:49: error: type ‘struct SslSessionLRUCache’ violates the C++ One Definition Rule [-Werror=odr]
49 | class SslSessionLRUCache
|
./src/core/tsi/ssl/session_cache/ssl_session_cache.h:49: note: a type with the same name but different base type is defined in another translation unit
49 | class SslSessionLRUCache
|
./src/core/lib/gprpp/cpp_impl_of.h:27: note: type name ‘grpc_core::CppImplOf<tsi::SslSessionLRUCache, tsi::tsi_ssl_session_cache>’ should match type name ‘grpc_core::CppImplOf<tsi::SslSessionLRUCache, tsi_ssl_session_cache>’
27 | class CppImplOf {
|
src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h:25:28: error: type of ‘xds_type_v3_TypedStruct_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
25 | extern const upb_MiniTable xds_type_v3_TypedStruct_msginit;
| ^
src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c:26:21: note: ‘xds_type_v3_TypedStruct_msginit’ was previously declared here
26 | const upb_MiniTable xds_type_v3_TypedStruct_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h:49:28: error: type of ‘grpc_lookup_v1_RouteLookupClusterSpecifier_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
49 | extern const upb_MiniTable grpc_lookup_v1_RouteLookupClusterSpecifier_msginit;
| ^
src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c:147:21: note: ‘grpc_lookup_v1_RouteLookupClusterSpecifier_msginit’ was previously declared here
147 | const upb_MiniTable grpc_lookup_v1_RouteLookupClusterSpecifier_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h:28: error: type of ‘grpc_gcp_RpcProtocolVersions_Version_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
28 | extern const upb_MiniTable grpc_gcp_RpcProtocolVersions_Version_msginit;
|
src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c:36:21: note: ‘grpc_gcp_RpcProtocolVersions_Version_msginit’ was previously declared here
36 | const upb_MiniTable grpc_gcp_RpcProtocolVersions_Version_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h:58: error: type of ‘grpc_gcp_HandshakerResp_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
58 | extern const upb_MiniTable grpc_gcp_HandshakerResp_msginit;
|
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c:209:21: note: ‘grpc_gcp_HandshakerResp_msginit’ was previously declared here
209 | const upb_MiniTable grpc_gcp_HandshakerResp_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h:55: error: type of ‘grpc_gcp_HandshakerReq_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
55 | extern const upb_MiniTable grpc_gcp_HandshakerReq_msginit;
|
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c:157:21: note: ‘grpc_gcp_HandshakerReq_msginit’ was previously declared here
157 | const upb_MiniTable grpc_gcp_HandshakerReq_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h:54: error: type of ‘grpc_gcp_NextHandshakeMessageReq_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
54 | extern const upb_MiniTable grpc_gcp_NextHandshakeMessageReq_msginit;
|
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c:139:21: note: ‘grpc_gcp_NextHandshakeMessageReq_msginit’ was previously declared here
139 | const upb_MiniTable grpc_gcp_NextHandshakeMessageReq_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h:52: error: type of ‘grpc_gcp_StartServerHandshakeReq_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
52 | extern const upb_MiniTable grpc_gcp_StartServerHandshakeReq_msginit;
|
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c:114:21: note: ‘grpc_gcp_StartServerHandshakeReq_msginit’ was previously declared here
114 | const upb_MiniTable grpc_gcp_StartServerHandshakeReq_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h:51: error: type of ‘grpc_gcp_ServerHandshakeParameters_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
51 | extern const upb_MiniTable grpc_gcp_ServerHandshakeParameters_msginit;
|
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c:91:21: note: ‘grpc_gcp_ServerHandshakeParameters_msginit’ was previously declared here
91 | const upb_MiniTable grpc_gcp_ServerHandshakeParameters_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h:50: error: type of ‘grpc_gcp_StartClientHandshakeReq_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
50 | extern const upb_MiniTable grpc_gcp_StartClientHandshakeReq_msginit;
|
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c:76:21: note: ‘grpc_gcp_StartClientHandshakeReq_msginit’ was previously declared here
76 | const upb_MiniTable grpc_gcp_StartClientHandshakeReq_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h:48: error: type of ‘grpc_gcp_Identity_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
48 | extern const upb_MiniTable grpc_gcp_Identity_msginit;
|
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c:38:21: note: ‘grpc_gcp_Identity_msginit’ was previously declared here
38 | const upb_MiniTable grpc_gcp_Identity_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h:60: error: type of ‘grpc_gcp_RpcProtocolVersions_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
60 | extern const upb_MiniTable grpc_gcp_RpcProtocolVersions_msginit;
|
src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c:25:21: note: ‘grpc_gcp_RpcProtocolVersions_msginit’ was previously declared here
25 | const upb_MiniTable grpc_gcp_RpcProtocolVersions_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h:27: error: type of ‘grpc_gcp_AltsContext_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
27 | extern const upb_MiniTable grpc_gcp_AltsContext_msginit;
|
src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c:31:21: note: ‘grpc_gcp_AltsContext_msginit’ was previously declared here
31 | const upb_MiniTable grpc_gcp_AltsContext_msginit = {
| ^
src/core/ext/upb-generated/google/protobuf/struct.upb.h:34:28: error: type of ‘google_protobuf_ListValue_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
34 | extern const upb_MiniTable google_protobuf_ListValue_msginit;
| ^
src/core/ext/upb-generated/google/protobuf/struct.upb.c:72:21: note: ‘google_protobuf_ListValue_msginit’ was previously declared here
72 | const upb_MiniTable google_protobuf_ListValue_msginit = {
| ^
src/core/ext/upb-generated/google/protobuf/struct.upb.h:33:28: error: type of ‘google_protobuf_Value_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
33 | extern const upb_MiniTable google_protobuf_Value_msginit;
| ^
src/core/ext/upb-generated/google/protobuf/struct.upb.c:58:21: note: ‘google_protobuf_Value_msginit’ was previously declared here
58 | const upb_MiniTable google_protobuf_Value_msginit = {
| ^
src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h:36:28: error: type of ‘envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
36 | extern const upb_MiniTable envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit;
| ^
src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c:100:21: note: ‘envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit’ was previously declared here
100 | const upb_MiniTable envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit = {
| ^
src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h:35:28: error: type of ‘envoy_service_status_v3_ClientConfig_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
35 | extern const upb_MiniTable envoy_service_status_v3_ClientConfig_msginit;
| ^
src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c:76:21: note: ‘envoy_service_status_v3_ClientConfig_msginit’ was previously declared here
76 | const upb_MiniTable envoy_service_status_v3_ClientConfig_msginit = {
| ^
src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h:28:28: error: type of ‘envoy_service_load_stats_v3_LoadStatsResponse_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
28 | extern const upb_MiniTable envoy_service_load_stats_v3_LoadStatsResponse_msginit;
| ^
src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c:47:21: note: ‘envoy_service_load_stats_v3_LoadStatsResponse_msginit’ was previously declared here
47 | const upb_MiniTable envoy_service_load_stats_v3_LoadStatsResponse_msginit = {
| ^
src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h:27:28: error: type of ‘envoy_service_load_stats_v3_LoadStatsRequest_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
27 | extern const upb_MiniTable envoy_service_load_stats_v3_LoadStatsRequest_msginit;
| ^
src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c:30:21: note: ‘envoy_service_load_stats_v3_LoadStatsRequest_msginit’ was previously declared here
30 | const upb_MiniTable envoy_service_load_stats_v3_LoadStatsRequest_msginit = {
| ^
src/core/ext/upb-generated/google/rpc/status.upb.h:25:28: error: type of ‘google_rpc_Status_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
25 | extern const upb_MiniTable google_rpc_Status_msginit;
| ^
src/core/ext/upb-generated/google/rpc/status.upb.c:26:21: note: ‘google_rpc_Status_msginit’ was previously declared here
26 | const upb_MiniTable google_rpc_Status_msginit = {
| ^
src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h:63:28: error: type of ‘envoy_service_discovery_v3_Resource_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
63 | extern const upb_MiniTable envoy_service_discovery_v3_Resource_msginit;
| ^
src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c:237:21: note: ‘envoy_service_discovery_v3_Resource_msginit’ was previously declared here
237 | const upb_MiniTable envoy_service_discovery_v3_Resource_msginit = {
| ^
src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h:55:28: error: type of ‘envoy_service_discovery_v3_DiscoveryResponse_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
55 | extern const upb_MiniTable envoy_service_discovery_v3_DiscoveryResponse_msginit;
| ^
src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c:99:21: note: ‘envoy_service_discovery_v3_DiscoveryResponse_msginit’ was previously declared here
99 | const upb_MiniTable envoy_service_discovery_v3_DiscoveryResponse_msginit = {
| ^
src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h:54:28: error: type of ‘envoy_service_discovery_v3_DiscoveryRequest_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
54 | extern const upb_MiniTable envoy_service_discovery_v3_DiscoveryRequest_msginit;
| ^
src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c:79:21: note: ‘envoy_service_discovery_v3_DiscoveryRequest_msginit’ was previously declared here
79 | const upb_MiniTable envoy_service_discovery_v3_DiscoveryRequest_msginit = {
| ^
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h:38:28: error: type of ‘envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
38 | extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit;
| ^
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c:63:21: note: ‘envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit’ was previously declared here
63 | const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit = {
| ^
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h:37:28: error: type of ‘envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
37 | extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit;
| ^
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c:37:21: note: ‘envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit’ was previously declared here
37 | const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit = {
| ^
src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h:25:28: error: type of ‘envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
25 | extern const upb_MiniTable envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msginit;
| ^
src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.c:26:21: note: ‘envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msginit’ was previously declared here
26 | const upb_MiniTable envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msginit = {
| ^
src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h:25:28: error: type of ‘envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
25 | extern const upb_MiniTable envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msginit;
| ^
src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c:32:21: note: ‘envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msginit’ was previously declared here
32 | const upb_MiniTable envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msginit = {
| ^
src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h:63:28: error: type of ‘envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
63 | extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit;
| ^
src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c:121:21: note: ‘envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit’ was previously declared here
121 | const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit = {
| ^
src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h:25:28: error: type of ‘envoy_extensions_filters_http_router_v3_Router_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
25 | extern const upb_MiniTable envoy_extensions_filters_http_router_v3_Router_msginit;
| ^
src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c:35:21: note: ‘envoy_extensions_filters_http_router_v3_Router_msginit’ was previously declared here
35 | const upb_MiniTable envoy_extensions_filters_http_router_v3_Router_msginit = {
| ^
src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h:28:28: error: type of ‘envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
28 | extern const upb_MiniTable envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit;
| ^
src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c:50:21: note: ‘envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit’ was previously declared here
50 | const upb_MiniTable envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit = {
| ^
src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h:27:28: error: type of ‘envoy_extensions_filters_http_rbac_v3_RBAC_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
27 | extern const upb_MiniTable envoy_extensions_filters_http_rbac_v3_RBAC_msginit;
| ^
src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c:36:21: note: ‘envoy_extensions_filters_http_rbac_v3_RBAC_msginit’ was previously declared here
36 | const upb_MiniTable envoy_extensions_filters_http_rbac_v3_RBAC_msginit = {
| ^
src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h:31:28: error: type of ‘envoy_extensions_filters_http_fault_v3_HTTPFault_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
31 | extern const upb_MiniTable envoy_extensions_filters_http_fault_v3_HTTPFault_msginit;
| ^
src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c:72:21: note: ‘envoy_extensions_filters_http_fault_v3_HTTPFault_msginit’ was previously declared here
72 | const upb_MiniTable envoy_extensions_filters_http_fault_v3_HTTPFault_msginit = {
| ^
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h:25:28: error: type of ‘envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
25 | extern const upb_MiniTable envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit;
| ^
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c:22:21: note: ‘envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit’ was previously declared here
22 | const upb_MiniTable envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit = {
| ^
src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h:187:28: error: type of ‘envoy_config_route_v3_FilterConfig_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
187 | extern const upb_MiniTable envoy_config_route_v3_FilterConfig_msginit;
| ^
src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c:1022:21: note: ‘envoy_config_route_v3_FilterConfig_msginit’ was previously declared here
1022 | const upb_MiniTable envoy_config_route_v3_FilterConfig_msginit = {
| ^
src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h:27:28: error: type of ‘envoy_config_route_v3_RouteConfiguration_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
27 | extern const upb_MiniTable envoy_config_route_v3_RouteConfiguration_msginit;
| ^
src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c:51:21: note: ‘envoy_config_route_v3_RouteConfiguration_msginit’ was previously declared here
51 | const upb_MiniTable envoy_config_route_v3_RouteConfiguration_msginit = {
| ^
src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h:37:28: error: type of ‘envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
37 | extern const upb_MiniTable envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit;
| ^
src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c:105:21: note: ‘envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit’ was previously declared here
105 | const upb_MiniTable envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit = {
| ^
src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h:33:28: error: type of ‘envoy_config_endpoint_v3_ClusterStats_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
33 | extern const upb_MiniTable envoy_config_endpoint_v3_ClusterStats_msginit;
| ^
src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c:94:21: note: ‘envoy_config_endpoint_v3_ClusterStats_msginit’ was previously declared here
94 | const upb_MiniTable envoy_config_endpoint_v3_ClusterStats_msginit = {
| ^
src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h:35:28: error: type of ‘envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
35 | extern const upb_MiniTable envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit;
| ^
src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c:73:21: note: ‘envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit’ was previously declared here
73 | const upb_MiniTable envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit = {
| ^
src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h:33:28: error: type of ‘envoy_config_endpoint_v3_UpstreamLocalityStats_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
33 | extern const upb_MiniTable envoy_config_endpoint_v3_UpstreamLocalityStats_msginit;
| ^
src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c:39:21: note: ‘envoy_config_endpoint_v3_UpstreamLocalityStats_msginit’ was previously declared here
39 | const upb_MiniTable envoy_config_endpoint_v3_UpstreamLocalityStats_msginit = {
| ^
src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h:31:28: error: type of ‘envoy_config_endpoint_v3_ClusterLoadAssignment_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
31 | extern const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_msginit;
| ^
src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c:35:21: note: ‘envoy_config_endpoint_v3_ClusterLoadAssignment_msginit’ was previously declared here
35 | const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_msginit = {
| ^
src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h:74:28: error: type of ‘envoy_config_cluster_v3_Cluster_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
74 | extern const upb_MiniTable envoy_config_cluster_v3_Cluster_msginit;
| ^
src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c:148:21: note: ‘envoy_config_cluster_v3_Cluster_msginit’ was previously declared here
148 | const upb_MiniTable envoy_config_cluster_v3_Cluster_msginit = {
| ^
src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h:39:28: error: type of ‘envoy_config_listener_v3_Listener_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
39 | extern const upb_MiniTable envoy_config_listener_v3_Listener_msginit;
| ^
src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c:121:21: note: ‘envoy_config_listener_v3_Listener_msginit’ was previously declared here
121 | const upb_MiniTable envoy_config_listener_v3_Listener_msginit = {
| ^
src/core/ext/upb-generated/google/protobuf/struct.upb.h:31:28: error: type of ‘google_protobuf_Struct_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
31 | extern const upb_MiniTable google_protobuf_Struct_msginit;
| ^
src/core/ext/upb-generated/google/protobuf/struct.upb.c:23:21: note: ‘google_protobuf_Struct_msginit’ was previously declared here
23 | const upb_MiniTable google_protobuf_Struct_msginit = {
| ^
src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h:54:28: error: type of ‘envoy_config_core_v3_Node_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
54 | extern const upb_MiniTable envoy_config_core_v3_Node_msginit;
| ^
src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c:99:21: note: ‘envoy_config_core_v3_Node_msginit’ was previously declared here
99 | const upb_MiniTable envoy_config_core_v3_Node_msginit = {
| ^
src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h:53:28: error: type of ‘envoy_admin_v3_UpdateFailureState_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
53 | extern const upb_MiniTable envoy_admin_v3_UpdateFailureState_msginit;
| ^
src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.c:31:21: note: ‘envoy_admin_v3_UpdateFailureState_msginit’ was previously declared here
31 | const upb_MiniTable envoy_admin_v3_UpdateFailureState_msginit = {
| ^
src/core/ext/upb-generated/google/rpc/status.upb.h:27:28: error: type of ‘google_protobuf_Any_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
27 | extern const upb_MiniTable google_protobuf_Any_msginit;
| ^
src/core/ext/upb-generated/google/protobuf/any.upb.c:20:21: note: ‘google_protobuf_Any_msginit’ was previously declared here
20 | const upb_MiniTable google_protobuf_Any_msginit = {
| ^
src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h:43:28: error: type of ‘envoy_config_core_v3_Locality_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
43 | extern const upb_MiniTable envoy_config_core_v3_Locality_msginit;
| ^
src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c:35:21: note: ‘envoy_config_core_v3_Locality_msginit’ was previously declared here
35 | const upb_MiniTable envoy_config_core_v3_Locality_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h:31:28: error: type of ‘grpc_lookup_v1_RouteLookupResponse_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
31 | extern const upb_MiniTable grpc_lookup_v1_RouteLookupResponse_msginit;
| ^
src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c:48:21: note: ‘grpc_lookup_v1_RouteLookupResponse_msginit’ was previously declared here
48 | const upb_MiniTable grpc_lookup_v1_RouteLookupResponse_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h:29:28: error: type of ‘grpc_lookup_v1_RouteLookupRequest_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
29 | extern const upb_MiniTable grpc_lookup_v1_RouteLookupRequest_msginit;
| ^
src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c:26:21: note: ‘grpc_lookup_v1_RouteLookupRequest_msginit’ was previously declared here
26 | const upb_MiniTable grpc_lookup_v1_RouteLookupRequest_msginit = {
| ^
src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h:25:28: error: type of ‘xds_service_orca_v3_OrcaLoadReportRequest_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
25 | extern const upb_MiniTable xds_service_orca_v3_OrcaLoadReportRequest_msginit;
| ^
src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c:27:21: note: ‘xds_service_orca_v3_OrcaLoadReportRequest_msginit’ was previously declared here
27 | const upb_MiniTable xds_service_orca_v3_OrcaLoadReportRequest_msginit = {
| ^
src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h:27:28: error: type of ‘google_protobuf_Duration_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
27 | extern const upb_MiniTable google_protobuf_Duration_msginit;
| ^
src/core/ext/upb-generated/google/protobuf/duration.upb.c:20:21: note: ‘google_protobuf_Duration_msginit’ was previously declared here
20 | const upb_MiniTable google_protobuf_Duration_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h:45:28: error: type of ‘grpc_lb_v1_LoadBalanceResponse_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
45 | extern const upb_MiniTable grpc_lb_v1_LoadBalanceResponse_msginit;
| ^
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c:86:21: note: ‘grpc_lb_v1_LoadBalanceResponse_msginit’ was previously declared here
86 | const upb_MiniTable grpc_lb_v1_LoadBalanceResponse_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h:43:28: error: type of ‘grpc_lb_v1_ClientStatsPerToken_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
43 | extern const upb_MiniTable grpc_lb_v1_ClientStatsPerToken_msginit;
| ^
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c:48:21: note: ‘grpc_lb_v1_ClientStatsPerToken_msginit’ was previously declared here
48 | const upb_MiniTable grpc_lb_v1_ClientStatsPerToken_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h:53:28: error: type of ‘google_protobuf_Timestamp_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
53 | extern const upb_MiniTable google_protobuf_Timestamp_msginit;
| ^
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c:20:21: note: ‘google_protobuf_Timestamp_msginit’ was previously declared here
20 | const upb_MiniTable google_protobuf_Timestamp_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h:44:28: error: type of ‘grpc_lb_v1_ClientStats_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
44 | extern const upb_MiniTable grpc_lb_v1_ClientStats_msginit;
| ^
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c:68:21: note: ‘grpc_lb_v1_ClientStats_msginit’ was previously declared here
68 | const upb_MiniTable grpc_lb_v1_ClientStats_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h:42:28: error: type of ‘grpc_lb_v1_InitialLoadBalanceRequest_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
42 | extern const upb_MiniTable grpc_lb_v1_InitialLoadBalanceRequest_msginit;
| ^
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c:37:21: note: ‘grpc_lb_v1_InitialLoadBalanceRequest_msginit’ was previously declared here
37 | const upb_MiniTable grpc_lb_v1_InitialLoadBalanceRequest_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h:41:28: error: type of ‘grpc_lb_v1_LoadBalanceRequest_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
41 | extern const upb_MiniTable grpc_lb_v1_LoadBalanceRequest_msginit;
| ^
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c:27:21: note: ‘grpc_lb_v1_LoadBalanceRequest_msginit’ was previously declared here
27 | const upb_MiniTable grpc_lb_v1_LoadBalanceRequest_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h:28:28: error: type of ‘grpc_health_v1_HealthCheckResponse_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
28 | extern const upb_MiniTable grpc_health_v1_HealthCheckResponse_msginit;
| ^
src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c:29:21: note: ‘grpc_health_v1_HealthCheckResponse_msginit’ was previously declared here
29 | const upb_MiniTable grpc_health_v1_HealthCheckResponse_msginit = {
| ^
src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h:27:28: error: type of ‘grpc_health_v1_HealthCheckRequest_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
27 | extern const upb_MiniTable grpc_health_v1_HealthCheckRequest_msginit;
| ^
src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c:19:21: note: ‘grpc_health_v1_HealthCheckRequest_msginit’ was previously declared here
19 | const upb_MiniTable grpc_health_v1_HealthCheckRequest_msginit = {
| ^
src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h:29:28: error: type of ‘xds_data_orca_v3_OrcaLoadReport_msginit’ does not match original declaration [-Werror=lto-type-mismatch]
29 | extern const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_msginit;
| ^
src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c:29:21: note: ‘xds_data_orca_v3_OrcaLoadReport_msginit’ was previously declared here
29 | const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_msginit = {
| ^
lto1: some warnings being treated as errors
lto-wrapper: fatal error: /usr/bin/x86_64-pc-linux-gnu-g++ returned 1 exit status
compilation terminated.
Anything else we should know about your project / environment?
Gentoo is working to make all packages LTO-clean, since users may want to add -flto to their system *FLAGS. We want to make sure that all packages either support it correctly or don't use LTO since it may produce unpredictable bad behavior.
Hence we are testing by ensuring warnings that indicate issues are promoted to errors.
Note: I double checked the latest version of ev_poll_posix.cc / ev_epoll1_linux.cc from git master and verified it seems to still have the mismatched struct grpc_fd ODR issue.
The text was updated successfully, but these errors were encountered:
(That's why I originally filed it against core. Core is being linked by the python bindings, and was discovered while building the python bindings, but is otherwise unrelated to python.)
What version of gRPC and what language are you using?
1.51.0 via the python bindings.
What operating system (Linux, Windows,...) and version?
Gentoo Linux (rolling release)
What runtime / compiler are you using (e.g. python version or version of gcc)
gcc (Gentoo 13.2.1_p20240210 p14) 13.2.1 20240210
What did you do?
I tried to build the python grpcio module with LTO.
Add the following to
*FLAGS
:-flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing
Note the -Werror=* flags are used to help detect cases where the compiler tries to optimize by assuming UB cannot exist in the source code -- if it does exist, ordinarily the code would be miscompiled, and this says to make the miscompilation a fatal error.
Run:
emerge -1 dev-python/grpcio
What did you expect to see?
A successful compilation.
What did you see instead?
Full build log: build.log
Anything else we should know about your project / environment?
Gentoo is working to make all packages LTO-clean, since users may want to add
-flto
to their system *FLAGS. We want to make sure that all packages either support it correctly or don't use LTO since it may produce unpredictable bad behavior.Hence we are testing by ensuring warnings that indicate issues are promoted to errors.
There is a tracking bug for grpcio: https://bugs.gentoo.org/856775
Note: I double checked the latest version of ev_poll_posix.cc / ev_epoll1_linux.cc from git master and verified it seems to still have the mismatched
struct grpc_fd
ODR issue.The text was updated successfully, but these errors were encountered: