All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/ibrcommon: fix static build with openssl
@ 2019-02-16 11:23 Fabrice Fontaine
  2019-02-23 16:24 ` Thomas Petazzoni
  2019-02-24 22:15 ` Peter Korsgaard
  0 siblings, 2 replies; 5+ messages in thread
From: Fabrice Fontaine @ 2019-02-16 11:23 UTC (permalink / raw)
  To: 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 <fontaine.fabrice@gmail.com>
---
 ...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 <fontaine.fabrice@gmail.com>
+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 <fontaine.fabrice@gmail.com>
+[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
+
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/1] package/ibrcommon: fix static build with openssl
  2019-02-16 11:23 [Buildroot] [PATCH 1/1] package/ibrcommon: fix static build with openssl Fabrice Fontaine
@ 2019-02-23 16:24 ` Thomas Petazzoni
  2019-02-24 22:15 ` Peter Korsgaard
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2019-02-23 16:24 UTC (permalink / raw)
  To: buildroot

On Sat, 16 Feb 2019 12:23:19 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> 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 <fontaine.fabrice@gmail.com>
> ---
>  ...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

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/1] package/ibrcommon: fix static build with openssl
  2019-02-16 11:23 [Buildroot] [PATCH 1/1] package/ibrcommon: fix static build with openssl Fabrice Fontaine
  2019-02-23 16:24 ` Thomas Petazzoni
@ 2019-02-24 22:15 ` Peter Korsgaard
  2019-02-26 12:32   ` Fabrice Fontaine
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Korsgaard @ 2019-02-24 22:15 UTC (permalink / raw)
  To: buildroot

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > 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 <fontaine.fabrice@gmail.com>

The DOS newlines unfortunately got stripped by the mailing list, so the
patch no longer applies. I have manually fixed that up now.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/1] package/ibrcommon: fix static build with openssl
  2019-02-24 22:15 ` Peter Korsgaard
@ 2019-02-26 12:32   ` Fabrice Fontaine
  2019-02-26 13:52     ` Peter Korsgaard
  0 siblings, 1 reply; 5+ messages in thread
From: Fabrice Fontaine @ 2019-02-26 12:32 UTC (permalink / raw)
  To: buildroot

Dear Peter,
Le dim. 24 f?vr. 2019 ? 23:15, Peter Korsgaard <peter@korsgaard.com> a ?crit :
>
> >>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:
>
>  > 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 <fontaine.fabrice@gmail.com>
>
> The DOS newlines unfortunately got stripped by the mailing list, so the
> patch no longer applies. I have manually fixed that up now.
Thanks for fixing the issue, there is also the same problem with
host-cryptopp's patch:
http://autobuild.buildroot.net/results/e8f/e8fad6fe97391276df0bbb3deb9d4ab90ce043d1/build-end.log.
Could you also fix the issue?
Next time, I'll try to add a warning in the commit message.
>
> --
> Bye, Peter Korsgaard
Best Regards,

Fabrice

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/1] package/ibrcommon: fix static build with openssl
  2019-02-26 12:32   ` Fabrice Fontaine
@ 2019-02-26 13:52     ` Peter Korsgaard
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2019-02-26 13:52 UTC (permalink / raw)
  To: buildroot

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

Hi,
 >> The DOS newlines unfortunately got stripped by the mailing list, so the
 >> patch no longer applies. I have manually fixed that up now.

 > Thanks for fixing the issue, there is also the same problem with
 > host-cryptopp's patch:
 > http://autobuild.buildroot.net/results/e8f/e8fad6fe97391276df0bbb3deb9d4ab90ce043d1/build-end.log.
 > Could you also fix the issue?
 > Next time, I'll try to add a warning in the commit message.

Sure, fixed. It would indeed be good if you could give a small heads up
in case we have such issue again in the future.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-02-26 13:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-16 11:23 [Buildroot] [PATCH 1/1] package/ibrcommon: fix static build with openssl Fabrice Fontaine
2019-02-23 16:24 ` Thomas Petazzoni
2019-02-24 22:15 ` Peter Korsgaard
2019-02-26 12:32   ` Fabrice Fontaine
2019-02-26 13:52     ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.