From patchwork Tue Sep 15 16:11:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Nosthoff X-Patchwork-Id: 1364488 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=busybox.net Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=heine.tech header.i=@heine.tech header.a=rsa-sha256 header.s=dkim header.b=n4RpzUd6; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BrSsv1Hr3z9sTt for ; Wed, 16 Sep 2020 02:12:03 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 598098726D; Tue, 15 Sep 2020 16:12:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rOrJsFhVVrws; Tue, 15 Sep 2020 16:12:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id B35C787264; Tue, 15 Sep 2020 16:12:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 285851BF350 for ; Tue, 15 Sep 2020 16:11:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 24D0886915 for ; Tue, 15 Sep 2020 16:11:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uv7eu3ejg8Rx for ; Tue, 15 Sep 2020 16:11:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.heine.tech (mail.heine.tech [195.201.24.99]) by whitealder.osuosl.org (Postfix) with ESMTPS id 708E88359A for ; Tue, 15 Sep 2020 16:11:57 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id CD1E41814B9; Tue, 15 Sep 2020 18:11:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heine.tech; s=dkim; t=1600186315; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding; bh=ji6viE2bFEMZr0FOpnb5eNyoNe181FGJJ5ArfYy9V5k=; b=n4RpzUd6ZY65BeSAbmMqeuuMnBa2DTGFfqlsI00FdMQrpcYEU7ZWwj+LLUbRXxvwUMCUha HnOq/pMpfJlYgJu2RdJtDiI7efkoElRtgvOaIOnrg7Fgvss91UXBxDE84gKC9+kJak0gcp YpUlAkX5z9k4EzpgMjzfX7cEyR1OJSw= To: buildroot@buildroot.org Date: Tue, 15 Sep 2020 18:11:07 +0200 Message-Id: <20200915161107.1826-1-buildroot@heine.tech> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 Subject: [Buildroot] [PATCH] package/grpc: fix build on ubuntu gcc 4.8 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Michael Nosthoff via buildroot Reply-To: Michael Nosthoff Cc: Michael Nosthoff , "Yann E . MORIN" , Robert Rose Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" gcc 4.8 on ubuntu 14.04 does some broken optimization at link-time which causes grpc to create a grpc_cpp_plugin which quits because of a failing assertion. The created plugin is itself used during compilation which lets the build fail. With the added -Wl,--no-as-needed flag the LTO is disabled and grpc compiles successfully. fixes: - http://autobuild.buildroot.net/results/b554f6f2fb66892273f7520ad6e36923557b229e - http://autobuild.buildroot.net/results/3ebb2880b9b3fd5154979016391dde897e2c039c - http://autobuild.buildroot.net/results/c2078e821e0728fe980be2c849c25d82e791a4c2 Signed-off-by: Michael Nosthoff --- package/grpc/grpc.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package/grpc/grpc.mk b/package/grpc/grpc.mk index 2114f98e40..4db309d4e9 100644 --- a/package/grpc/grpc.mk +++ b/package/grpc/grpc.mk @@ -72,5 +72,12 @@ HOST_GRPC_CONF_OPTS = \ -DgRPC_ZLIB_PROVIDER=package \ -DgRPC_ABSL_PROVIDER=package +#With gcc 4.8 (at least on ubuntu) there is a bug in LTO which breaks the linkage of +#the grpc_cpp_plugin with libprotobuf and pthread. This additional flag fixes this. +ifeq ($(BR2_HOST_GCC_AT_LEAST_4_9),) +HOST_GRPC_CONF_OPTS += \ + -DCMAKE_EXE_LINKER_FLAGS="$(HOST_LDFLAGS) -Wl,--no-as-needed" +endif + $(eval $(cmake-package)) $(eval $(host-cmake-package))