From patchwork Sat Feb 16 11:23:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 1043416 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.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.b="fVQ2xoMt"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 441nnS30sMz9s7T for ; Sat, 16 Feb 2019 22:23:39 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B1E5622D44; Sat, 16 Feb 2019 11:23:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RAk3URjEf3wC; Sat, 16 Feb 2019 11:23:35 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 1E188230E6; Sat, 16 Feb 2019 11:23:35 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 8763C1BF395 for ; Sat, 16 Feb 2019 11:23:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 82E33230E6 for ; Sat, 16 Feb 2019 11:23:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rxfVERQig+QT for ; Sat, 16 Feb 2019 11:23:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by silver.osuosl.org (Postfix) with ESMTPS id 7EB9122D44 for ; Sat, 16 Feb 2019 11:23:31 +0000 (UTC) Received: by mail-wr1-f43.google.com with SMTP id q18so12938418wrx.9 for ; Sat, 16 Feb 2019 03:23:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=K2zcDRlTzDIizMJd7erijbsxlAoKeHlXHomqw3f6z/4=; b=fVQ2xoMtDuqOHcNfOmA0B7msaevC/lNGu1H1SbxGpeKl9CoO3Pbi1gX4N8lIX/Du0v gS6vNIVuLj621PDjOvMvtLYjXwCQVwrOyp+43IhD62Ut6MKPKAyabi+UsAOQ6bCUVqFR 8K4Ei996Lea7se8+MNLAzzQnTCAQoU7PeizT9AO/qIY8Rk1Vuf2MkxOCRsEYO8l5vtSH hNL5Zqq2mINZnLDp1gV/fFXWMaL3Oco5d6Z3+R5ErYvUaWKDDjlrXxnDMosws1LqmGcP P9WsCeI5V+0/tIUWBW2D1OgSouRmr0ynAmDpHTzZ3OrgpovnQCi9ZILXD2DZSJ8TdJ+n LeeQ== 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; bh=K2zcDRlTzDIizMJd7erijbsxlAoKeHlXHomqw3f6z/4=; b=BJFABaexm5YJNhItU4HKY+/KZb+NKE8de2J+pRftOrnbh7NWQqW534UTJAzLcXYq1V cMWKH/7RcDluvvIXLVtsyHFz1cFQPV1spJV6XBO2WBiehw2Rp/6P3pU5jgwyHdGQ/uiL IsXwXHMWQy8oYgTMICvq4laFVnJgxmTNw4lMK9WB0GT0KzRAEmNrukeZnJ0imAsn3xZ/ 5H41kk3QoJ/euWX2HQ2eCiTbpMwmOwyfgCH4WNW5OrtOtuh/DUDMZnkad2rVUJTmAg4s /+moquBgXc220XJ9kngutv/4nYb8Jg5YMVA5J+lRcbL3/LA7+Fwo1GlDGaOKNnJMoVH1 fCrQ== X-Gm-Message-State: AHQUAubRt17sTbDR60h2mD9J73nSbOMinCWxDQSRzkgBEOoN5ONjJ25m y6o01S8xM+BhDuJ1XuELnzZ+cu65 X-Google-Smtp-Source: AHgI3IZB93f2UhXiPuXJQ9CT7vApX0aEf/aLCFsFScad81XqV5DK0n+gEtojp2n+xcTFhJ1j33+uvw== X-Received: by 2002:adf:c5d3:: with SMTP id v19mr10026870wrg.30.1550316209441; Sat, 16 Feb 2019 03:23:29 -0800 (PST) Received: from fabrice-VirtualBox.home (lfbn-ren-1-128-3.w83-205.abo.wanadoo.fr. [83.205.212.3]) by smtp.gmail.com with ESMTPSA id f196sm17916001wme.36.2019.02.16.03.23.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Feb 2019 03:23:28 -0800 (PST) From: Fabrice Fontaine To: buildroot@buildroot.org Date: Sat, 16 Feb 2019 12:23:19 +0100 Message-Id: <20190216112319.4769-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.14.1 Subject: [Buildroot] [PATCH 1/1] package/ibrcommon: fix static build with openssl 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: Fabrice Fontaine MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" gf_mul is already defined in libcrypto (openssl) so rename it into ibrdtn_gf_mul to fix the following build failure in ibrdtnd package: /home/buildroot/autobuild/instance-3/output/host/bin/../arm-buildroot-uclinux-uclibcgnueabi/sysroot/usr/lib/libcrypto.a(f_impl.o): In function `gf_mul': f_impl.c:(.text+0x0): multiple definition of `gf_mul' /home/buildroot/autobuild/instance-3/output/host/arm-buildroot-uclinux-uclibcgnueabi/sysroot/usr/lib/libibrcommon.a(gf128mul.o):gf128mul.cpp:(.text+0x30): first defined here collect2: error: ld returned 1 exit status Makefile:560: recipe for target 'dtnd' failed Fixes: - http://autobuild.buildroot.org/results/1d3b4b6cf043a3e185ce758b617a0a18c3d36cdb Signed-off-by: Fabrice Fontaine --- ...mon-ssl-gcm-fix-static-build-with-openssl.patch | 94 ++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 package/ibrcommon/0003-ibrcommon-ssl-gcm-fix-static-build-with-openssl.patch diff --git a/package/ibrcommon/0003-ibrcommon-ssl-gcm-fix-static-build-with-openssl.patch b/package/ibrcommon/0003-ibrcommon-ssl-gcm-fix-static-build-with-openssl.patch new file mode 100644 index 0000000000..c55b227c0c --- /dev/null +++ b/package/ibrcommon/0003-ibrcommon-ssl-gcm-fix-static-build-with-openssl.patch @@ -0,0 +1,94 @@ +From 8118c43a53271ba2dd31ce3913a3cd21bc7dcca7 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sat, 16 Feb 2019 11:58:34 +0100 +Subject: [PATCH] ibrcommon/ssl/gcm: fix static build with openssl + +gf_mul is already defined in libcrypto (openssl) so rename it into +ibrdtn_gf_mul to fix following build failure: + +/home/buildroot/autobuild/instance-3/output/host/bin/../arm-buildroot-uclinux-uclibcgnueabi/sysroot/usr/lib/libcrypto.a(f_impl.o): In function `gf_mul': +f_impl.c:(.text+0x0): multiple definition of `gf_mul' +/home/buildroot/autobuild/instance-3/output/host/arm-buildroot-uclinux-uclibcgnueabi/sysroot/usr/lib/libibrcommon.a(gf128mul.o):gf128mul.cpp:(.text+0x30): first defined here +collect2: error: ld returned 1 exit status +Makefile:560: recipe for target 'dtnd' failed + +Fixes: + - http://autobuild.buildroot.org/results/1d3b4b6cf043a3e185ce758b617a0a18c3d36cdb + +Signed-off-by: Fabrice Fontaine +[Upstream status: https://github.com/ibrdtn/ibrdtn/pull/269] +--- + ibrcommon/ibrcommon/ssl/gcm/gcm.cpp | 10 +++++----- + ibrcommon/ibrcommon/ssl/gcm/gf128mul.cpp | 2 +- + ibrcommon/ibrcommon/ssl/gcm/gf128mul.h | 2 +- + 3 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/ibrcommon/ssl/gcm/gcm.cpp b/ibrcommon/ssl/gcm/gcm.cpp +index 8a5745b4..6097b43e 100644 +--- a/ibrcommon/ssl/gcm/gcm.cpp ++++ b/ibrcommon/ssl/gcm/gcm.cpp +@@ -89,7 +89,7 @@ ret_type gcm_init_and_key( /* initialise mode and set key + #elif defined( TABLES_256 ) + #define gf_mul_hh(a, ctx, scr) gf_mul_256(a, ctx->gf_t256, scr) + #else +-#define gf_mul_hh(a, ctx, scr) gf_mul(a, ui8_ptr(ctx->ghash_h)) ++#define gf_mul_hh(a, ctx, scr) ibrdtn_gf_mul(a, ui8_ptr(ctx->ghash_h)) + #endif + + ret_type gcm_init_message( /* initialise a new message */ +@@ -334,9 +334,9 @@ ret_type gcm_compute_tag( /* compute authentication tag + memcpy(tbuf, ctx->ghash_h, BLOCK_SIZE); + for( ; ; ) + { +- if(ln & 1) gf_mul(ui8_ptr(ctx->hdr_ghv), tbuf); ++ if(ln & 1) ibrdtn_gf_mul(ui8_ptr(ctx->hdr_ghv), tbuf); + if(!(ln >>= 1)) break; +- gf_mul(tbuf, tbuf); ++ ibrdtn_gf_mul(tbuf, tbuf); + } + } + #else /* this one seems slower on x86 and x86_64 :-( */ +@@ -348,12 +348,12 @@ ret_type gcm_compute_tag( /* compute authentication tag + tbuf[0] = 0x80; + while(i) + { +- gf_mul(tbuf, tbuf); ++ ibrdtn_gf_mul(tbuf, tbuf); + if(i & ln) + gf_mul_hh(tbuf, ctx, scratch); + i >>= 1; + } +- gf_mul(ui8_ptr(ctx->hdr_ghv), tbuf); ++ ibrdtn_gf_mul(ui8_ptr(ctx->hdr_ghv), tbuf); + } + #endif + i = BLOCK_SIZE; ln = (uint_32t)(ctx->txt_acnt << 3); +diff --git a/ibrcommon/ssl/gcm/gf128mul.cpp b/ibrcommon/ssl/gcm/gf128mul.cpp +index a553a044..d0c460c3 100644 +--- a/ibrcommon/ssl/gcm/gf128mul.cpp ++++ b/ibrcommon/ssl/gcm/gf128mul.cpp +@@ -103,7 +103,7 @@ + + const unsigned short gf_tab[256] = gf_dat(xda); + +-void gf_mul(void *a, const void* b) ++void ibrdtn_gf_mul(void *a, const void* b) + { uint_32t r[GF_BYTE_LEN >> 2], p[8][GF_BYTE_LEN >> 2]; + int i; + +diff --git a/ibrcommon/ssl/gcm/gf128mul.h b/ibrcommon/ssl/gcm/gf128mul.h +index 4645c7fe..65fba54b 100644 +--- a/ibrcommon/ssl/gcm/gf128mul.h ++++ b/ibrcommon/ssl/gcm/gf128mul.h +@@ -619,7 +619,7 @@ gf_inline void mul_x(void *r, const void *x) + + /* A slow generic version of gf_mul (a = a * b) */ + +-void gf_mul(void *a, const void* b); ++void ibrdtn_gf_mul(void *a, const void* b); + + /* This version uses 64k bytes of table space on the stack. + A 16 byte buffer has to be multiplied by a 16 byte key +-- +2.14.1 +