From patchwork Sun May 17 21:34:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1292262 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.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Cnbba764; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49QFmY129Pz9sTC for ; Mon, 18 May 2020 07:35:09 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6548786933; Sun, 17 May 2020 21:35:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f6dHRfym2wAe; Sun, 17 May 2020 21:35:04 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id E1F5F86962; Sun, 17 May 2020 21:35:03 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 953B31BF2B7 for ; Sun, 17 May 2020 21:35:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8EAE38851B for ; Sun, 17 May 2020 21:35:02 +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 A+UrKZcD7-Rn for ; Sun, 17 May 2020 21:35:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by hemlock.osuosl.org (Postfix) with ESMTPS id AAE3B88512 for ; Sun, 17 May 2020 21:35:01 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id i15so9506946wrx.10 for ; Sun, 17 May 2020 14:35:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LjW5QjI008VW0XT5FizOO95eFy4iBZ0gRVM3TMeCmcU=; b=Cnbba764iwwLqw0KBfItqpCT/3bYpF3Xwh8QcmhNeD97wU1E+Xe6b9fgEkHobNQxMV R1QF85ztgeHzM7/uKZlygk8vfEsYXzPU3jJTbiekxr7mo5woM78TGyNMV///NxdW0K6c OlASnScDfeOyej0GFMJ8pcJrqZ1dVDciYOKxmE+V2Ctk2kQJJ7MuuwZZaCbarsArnF9J ClXtIOoX7tqTdqwaVgiU1aDN+nFCb7c5UsFWQKPo6Sj5tATlp8nNmLqo0GdgYEsZMlx5 pSgM/zUJXi1y4JWQvoayoazC5hYeSed+F89Re+SiGCwY1rKExsB/yqVA5XNdeH69HRYB 7a5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LjW5QjI008VW0XT5FizOO95eFy4iBZ0gRVM3TMeCmcU=; b=GXlhICcJee1CAFyI3kq8jHV6fBWAQBVSdSQb+GQXaTbZfu7h33mvJcLYgyMm4xDzkc aGsPWm+GeG9/COE+/N3LpL+oe51tbS4+y2BCUcthFguU9bGkaI1wAD1BNhADEPg1IVAS 3b21uyQlDFOK6KBCFY3ebfDh+TP8vMXNa7be9ryAFeXkSIg6Htzxo7luDVie+sY1e6QC h6yEJOE0J5s1Af2m133o8D5qWdXXb+cZPUOm1nlOGQpF2Q+ByUI+cQRKj/yrvuHoE+bw 4C4X4WIudqY1bpLC+LJcq0qESFqMtYBmty7s0kxhWWmIvk5/nKUhbDqWat1IVLs8pOoO 5C9A== X-Gm-Message-State: AOAM532HrLYzYUvM/0yz3PhVx5CMWY4QeRZTrA//lo1jTRabyWTQARgb v0xyE3tVxuzK2cNj8k//aNTxrIpz X-Google-Smtp-Source: ABdhPJxEMg8XDcncqddIKT1ySk4cMFxiIC3FG33LKoTdP3ionl4MUnU/dR55HSArzxcIAgNe4Ccrpg== X-Received: by 2002:a5d:4c4f:: with SMTP id n15mr9657329wrt.249.1589751299745; Sun, 17 May 2020 14:34:59 -0700 (PDT) Received: from t450s.fritz.box (ip5b426f84.dynamic.kabel-deutschland.de. [91.66.111.132]) by smtp.gmail.com with ESMTPSA id 10sm13670220wmw.26.2020.05.17.14.34.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 May 2020 14:34:58 -0700 (PDT) From: Heiko Thiery To: buildroot@buildroot.org Date: Sun, 17 May 2020 23:34:26 +0200 Message-Id: <20200517213426.12315-1-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/erlang: fix -fno-common build failure 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: , Cc: Heiko Thiery , Romain Naour , Will Newton Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Added upstream patch for fixing build failure when using GCC10 as a host compiler (-fno-common is now default). Cc: Romain Naour Signed-off-by: Heiko Thiery --- ...d-ODR-violation-of-ei_default_socket.patch | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 package/erlang/0003-ei_portio.h-avoid-ODR-violation-of-ei_default_socket.patch diff --git a/package/erlang/0003-ei_portio.h-avoid-ODR-violation-of-ei_default_socket.patch b/package/erlang/0003-ei_portio.h-avoid-ODR-violation-of-ei_default_socket.patch new file mode 100644 index 0000000000..69b6fae81f --- /dev/null +++ b/package/erlang/0003-ei_portio.h-avoid-ODR-violation-of-ei_default_socket.patch @@ -0,0 +1,54 @@ +From de870d7f9f36b3e68f280057851a4585a67ab219 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Tue, 14 Jan 2020 23:15:01 +0000 +Subject: [PATCH] ei_portio.h: avoid ODR violation of + 'ei_default_socket_callbacks' + +Noticed as a build failure against fresh gcc-master: + +``` +LD otp/lib/erl_interface/bin/x86_64-unknown-linux-gnu/erl_call +ld: otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(eirecv.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: multiple definition of `ei_default_socket_callbacks'; otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(ei_connect.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: first defined here +ld: otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(send.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: multiple definition of `ei_default_socket_callbacks'; otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(ei_connect.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: first defined here +ld: otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(send_reg.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: multiple definition of `ei_default_socket_callbacks'; otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(ei_connect.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: first defined here +ld: otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(epmd_port.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: multiple definition of `ei_default_socket_callbacks'; otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(ei_connect.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: first defined here +ld: otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(ei_portio.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: multiple definition of `ei_default_socket_callbacks'; otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(ei_connect.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: first defined here +collect2: error: ld returned 1 exit status +make[3]: *** [x86_64-unknown-linux-gnu/Makefile:669: otp/lib/erl_interface/bin/x86_64-unknown-linux-gnu/erl_call] Error 1 +``` + +The failure looks legitimate: `ei_default_socket_callbacks` is a +struct defined in 'ei_portio.h' and in 'ei_portio.c'. + +The change flips 'ei_portio.h' definition to declaration. + +gcc-10 will change the default from -fcommon to fno-common: +https://gcc.gnu.org/PR85678. + +The error also happens if CFLAGS=-fno-common passed explicitly. + +Signed-off-by: Sergei Trofimovich + +Patch taken from upstream: https://github.com/erlang/otp/commit/de870d7f9f36b3e68f280057851a4585a67ab219 +Signed-off-by: Heiko Thiery +--- + lib/erl_interface/src/misc/ei_portio.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/erl_interface/src/misc/ei_portio.h b/lib/erl_interface/src/misc/ei_portio.h +index 84ebc5039a..5172d085b4 100644 + +--- a/lib/erl_interface/src/misc/ei_portio.h ++++ b/lib/erl_interface/src/misc/ei_portio.h +@@ -47,7 +47,7 @@ int ei_writev_fill_ctx_t__(ei_socket_callbacks *cbs, void *ctx, const struct iov + int ei_socket_callbacks_have_writev__(ei_socket_callbacks *cbs); + #endif + +-ei_socket_callbacks ei_default_socket_callbacks; ++extern ei_socket_callbacks ei_default_socket_callbacks; + + #define EI_FD_AS_CTX__(FD) \ + ((void *) (long) (FD)) +-- +2.20.1 +