Skip to contentSkip to conversation

package/grpc: needs host gcc >= 4.9

PATCH New Yann E. MORIN 3 participants 5 messages Jul 26, 2020 – Jul 27, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/grpc: needs host gcc >= 4.9

On some versions of gcc 4.8, like the one packaged in Ubuntu 14.04 (in extended support until 2022-04). Researching the cause for the bug was non-conclusive, except for:

     https://github.com/grpc/grpc/issues/19265

which ends with the less than informative "I've settled it."

The trails leads to https://github.com/oudalab/co-incidents/issues/29,
which leads to https://github.com/protocolbuffers/protobuf/issues/5353.

Although the reporter provided a very good initial investigation, with bisection of grpc *and* protobuf, the report has just lingered untouched for almost two years now. One of the remaining commits in the protobuf bisect is this giant hairball:

    https://github.com/protocolbuffers/protobuf/commit/0400cca3236de1ca
    Integrated internal changes from Google
    282 changed files with 15,223 additions and 14,041 deletions.

No surprise the reporter of protobuf!5353 got very frustrated to find such a monster commit to investigate... :-(

Another lead brings us similar reports, too:

     https://github.com/grpc/grpc/issues/22781

which concludes that "I've already fixed this issue. Can you try it on 1.29.1?"

But we're already usign 1.30.2, and we still have the issue (so maybe it's a different one...)

So, because the issue manifests itself only on an ancient system, Ubuntu 14.04, with a now ancient gcc 4.8, we just make grpc depend on a host gcc >= 4.9.

---
 package/collectd/Config.in | 1 +
 package/grpc/Config.in     | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)
package/collectd/Config.in +1 -0
index 188be3c0fb..77f088e76d 100644
@@ -565,6 +565,7 @@ config BR2_PACKAGE_COLLECTD_GRAPHITE
 
 config BR2_PACKAGE_COLLECTD_GRPC
 	bool "grpc"
+	depends on BR2_HOST_GCC_AT_LEAST_4_9 # grpc
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4 || BR2_TOOLCHAIN_HAS_ATOMIC # grpc
 	depends on BR2_INSTALL_LIBSTDCPP # grpc -> protobuf
 	depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS # grpc -> protobuf
package/grpc/Config.in +4 -2
index 45299888ea..8257f7c8a5 100644
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_GRPC
 	bool "grpc"
+	depends on BR2_HOST_GCC_AT_LEAST_4_9 # host-grpc fails to build on some gcc-4.8 versions
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_TOOLCHAIN_HAS_THREADS # protobuf
 	depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS # protobuf
@@ -17,8 +18,9 @@ config BR2_PACKAGE_GRPC
 
 	  http://github.com/grpc/grpc
 
-comment "grpc needs a toolchain w/ C++, threads, dynamic library, gcc >= 4.8"
+comment "grpc needs a toolchain w/ C++, threads, dynamic library, gcc >= 4.8, host gcc >= 4.9"
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4 || BR2_TOOLCHAIN_HAS_ATOMIC
 	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS \
-		|| BR2_STATIC_LIBS || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
+		|| BR2_STATIC_LIBS || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 \
+		|| !BR2_HOST_GCC_AT_LEAST_4_9
 	depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 package/grpc: needs host gcc >= 4.9

Hey Yann;

________________________________
From: Yann E. MORIN <[email protected]> on behalf of Yann E. MORIN <[email protected]>
Sent: Sunday, July 26, 2020 14:08
To: buildroot at buildroot.org
Cc: Yann E. MORIN; Adam Duskett
Subject: [PATCH] package/grpc: needs host gcc >= 4.9

On some versions of gcc 4.8, like the one packaged in Ubuntu 14.04 (in extended support until 2022-04). Researching the cause for the bug was non-conclusive, except for:

     https://github.com/grpc/grpc/issues/19265

which ends with the less than informative "I've settled it."

The trails leads to https://github.com/oudalab/co-incidents/issues/29,
which leads to https://github.com/protocolbuffers/protobuf/issues/5353.

Although the reporter provided a very good initial investigation, with bisection of grpc *and* protobuf, the report has just lingered untouched for almost two years now. One of the remaining commits in the protobuf bisect is this giant hairball:

    https://github.com/protocolbuffers/protobuf/commit/0400cca3236de1ca
    Integrated internal changes from Google
    282 changed files with 15,223 additions and 14,041 deletions.

No surprise the reporter of protobuf!5353 got very frustrated to find such a monster commit to investigate... :-(

Another lead brings us similar reports, too:

     https://github.com/grpc/grpc/issues/22781

which concludes that "I've already fixed this issue. Can you try it on 1.29.1?"

But we're already usign 1.30.2, and we still have the issue (so maybe it's a different one...)

So, because the issue manifests itself only on an ancient system, Ubuntu 14.04, with a now ancient gcc 4.8, we just make grpc depend on a host gcc >= 4.9.

The problem here is two fold:
1) CentOS7 also comes with gcc4.8 and compiles fine.

2) Ubuntu 14.04 still fails even when using newer GCC versions from a PPA (I tried with gcc 6 and the same error occurred)

So a user could in theory decide to try and install a newer GCC on Ubuntu 14.04 like I did in testing and will still get a bad experience. :(

I?m not sure what the correct answer to this issue is, but I have a hard time accepting this patch is the proper fix due to the above.

Adam

---
 package/collectd/Config.in | 1 +
 package/grpc/Config.in     | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)
package/collectd/Config.in +1 -0
index 188be3c0fb..77f088e76d 100644
@@ -565,6 +565,7 @@ config BR2_PACKAGE_COLLECTD_GRAPHITE
 
 config BR2_PACKAGE_COLLECTD_GRPC
         bool "grpc"
+       depends on BR2_HOST_GCC_AT_LEAST_4_9 # grpc
         depends on BR2_TOOLCHAIN_HAS_SYNC_4 || BR2_TOOLCHAIN_HAS_ATOMIC # grpc
         depends on BR2_INSTALL_LIBSTDCPP # grpc -> protobuf
         depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS # grpc -> protobuf
package/grpc/Config.in +4 -2
index 45299888ea..8257f7c8a5 100644
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_GRPC
         bool "grpc"
+       depends on BR2_HOST_GCC_AT_LEAST_4_9 # host-grpc fails to build on some gcc-4.8 versions
         depends on BR2_INSTALL_LIBSTDCPP
         depends on BR2_TOOLCHAIN_HAS_THREADS # protobuf
         depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS # protobuf
@@ -17,8 +18,9 @@ config BR2_PACKAGE_GRPC
 
           http://github.com/grpc/grpc
 
-comment "grpc needs a toolchain w/ C++, threads, dynamic library, gcc >= 4.8"
+comment "grpc needs a toolchain w/ C++, threads, dynamic library, gcc >= 4.8, host gcc >= 4.9"
         depends on BR2_TOOLCHAIN_HAS_SYNC_4 || BR2_TOOLCHAIN_HAS_ATOMIC
         depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS \
-               || BR2_STATIC_LIBS || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
+               || BR2_STATIC_LIBS || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 \
+               || !BR2_HOST_GCC_AT_LEAST_4_9
         depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS

--
2.20.1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20200726/c7f4d03b/attachment.html>

#2 lore raw

PATCH 1/1 package/grpc: needs host gcc >= 4.9

Quoted 4 lines · On Sun, 26 Jul 2020 22:11:00 +0000 ratbert90 <[email protected]> wrote:

The problem here is two fold:
1) CentOS7 also comes with gcc4.8 and compiles fine.

2) Ubuntu 14.04 still fails even when using newer GCC versions from a PPA (I tried with gcc 6 and the same error occurred)

Dammit, I've just seeing this comment now. This e-mail was weirdly formatted and not recorded on patchwork:

https://patchwork.ozlabs.org/project/buildroot/patch/20200726210823.20922-1-yann.morin.1998 at free.fr/

In the light of this, I've gone ahead and reverted the patch, as obviously the problem is not related to the gcc version.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH 1/1 package/grpc: needs host gcc >= 4.9

Quoted 8 lines · On Mon, 27 Jul 2020 17:42:21 +0200 Thomas Petazzoni…
Quoted 4 lines · On Sun, 26 Jul 2020 22:11:00 +0000 ratbert90 <[email protected]> wrote:

The problem here is two fold:
1) CentOS7 also comes with gcc4.8 and compiles fine.

2) Ubuntu 14.04 still fails even when using newer GCC versions from a PPA (I tried with gcc 6 and the same error occurred)

Quoted 7 lines

Dammit, I've just seeing this comment now. This e-mail was weirdly formatted and not recorded on patchwork:

https://patchwork.ozlabs.org/project/buildroot/patch/20200726210823.20922-1-yann.morin.1998 at free.fr/

In the light of this, I've gone ahead and reverted the patch, as obviously the problem is not related to the gcc version.

Lucky me, someone had pushed to the repo in between, so my "git push" was rejected, and I was able to discard the patch before it was pushed the official repo \o/

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

PATCH 1/1 package/grpc: needs host gcc >= 4.9

In reply to Yann E. MORIN
Quoted 3 lines · On Sun, 26 Jul 2020 23:08:23 +0200 "Yann E. MORIN" <[email protected]>…

So, because the issue manifests itself only on an ancient system, Ubuntu 14.04, with a now ancient gcc 4.8, we just make grpc depend on a host gcc >= 4.9.

According to Adam's comment, depending host gcc >= 4.9 is not the right thing, unfortunately :-/

package/collectd/Config.in config BR2_PACKAGE_COLLECTD_GRAPHITE · line 568

Quoted 3 lines

config BR2_PACKAGE_COLLECTD_GRPC

package/collectd/Config.in +1 -0
 	bool "grpc"
+	depends on BR2_HOST_GCC_AT_LEAST_4_9 # grpc

You had forgotten to update the Config.in comment with this new dependency.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com