diff mbox series

[1/1] package/freeipmi: fix static build with libgcrypt

Message ID 20220115153319.2227752-1-fontaine.fabrice@gmail.com
State Not Applicable
Headers show
Series [1/1] package/freeipmi: fix static build with libgcrypt | expand

Commit Message

Fabrice Fontaine Jan. 15, 2022, 3:33 p.m. UTC
Fix the following static build failure with libgcrypt raised since the
addition of the package in commit
663f39c88c01593855c18355a4decdceeffd884b:

configure:13665: /home/buildroot/autobuild/instance-1/output-1/host/bin/x86_64-linux-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os -g0  -static -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -static conftest.c -lgcrypt   >&5
/home/buildroot/autobuild/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-musl/10.3.0/../../../../x86_64-buildroot-linux-musl/bin/ld: /home/buildroot/autobuild/instance-1/output-1/host/x86_64-buildroot-linux-musl/sysroot/usr/lib/../lib64/libgcrypt.a(libgcrypt_la-visibility.o): in function `gcry_err_make_from_errno':
visibility.c:(.text+0x29): undefined reference to `gpg_err_code_from_errno'

Fixes:
 - http://autobuild.buildroot.org/results/5354f7231cf08bf762e7d86fca874ce63d9a116b

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...ure.ac-use-pkg-config-to-find-gcrypt.patch | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 package/freeipmi/0003-configure.ac-use-pkg-config-to-find-gcrypt.patch

Comments

Thomas Petazzoni Jan. 26, 2022, 10:09 p.m. UTC | #1
On Sat, 15 Jan 2022 16:33:19 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Fix the following static build failure with libgcrypt raised since the
> addition of the package in commit
> 663f39c88c01593855c18355a4decdceeffd884b:
> 
> configure:13665: /home/buildroot/autobuild/instance-1/output-1/host/bin/x86_64-linux-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os -g0  -static -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -static conftest.c -lgcrypt   >&5
> /home/buildroot/autobuild/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-musl/10.3.0/../../../../x86_64-buildroot-linux-musl/bin/ld: /home/buildroot/autobuild/instance-1/output-1/host/x86_64-buildroot-linux-musl/sysroot/usr/lib/../lib64/libgcrypt.a(libgcrypt_la-visibility.o): in function `gcry_err_make_from_errno':
> visibility.c:(.text+0x29): undefined reference to `gpg_err_code_from_errno'
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/5354f7231cf08bf762e7d86fca874ce63d9a116b
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  ...ure.ac-use-pkg-config-to-find-gcrypt.patch | 50 +++++++++++++++++++
>  1 file changed, 50 insertions(+)
>  create mode 100644 package/freeipmi/0003-configure.ac-use-pkg-config-to-find-gcrypt.patch

I've marked this one as Not Applicable.

Thomas
diff mbox series

Patch

diff --git a/package/freeipmi/0003-configure.ac-use-pkg-config-to-find-gcrypt.patch b/package/freeipmi/0003-configure.ac-use-pkg-config-to-find-gcrypt.patch
new file mode 100644
index 0000000000..6db6c2ae3b
--- /dev/null
+++ b/package/freeipmi/0003-configure.ac-use-pkg-config-to-find-gcrypt.patch
@@ -0,0 +1,50 @@ 
+From 727291789fa1930a3e5aa04a25e954cfa6e615d6 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sat, 15 Jan 2022 16:27:44 +0100
+Subject: [PATCH] configure.ac: use pkg-config to find gcrypt
+
+Use pkg-config to find gcrypt and avoid the following static build
+failure:
+
+configure:13642: checking for gcry_md_open in -lgcrypt
+configure:13665: /home/buildroot/autobuild/instance-1/output-1/host/bin/x86_64-linux-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os -g0  -static -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -static conftest.c -lgcrypt   >&5
+/home/buildroot/autobuild/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-musl/10.3.0/../../../../x86_64-buildroot-linux-musl/bin/ld: /home/buildroot/autobuild/instance-1/output-1/host/x86_64-buildroot-linux-musl/sysroot/usr/lib/../lib64/libgcrypt.a(libgcrypt_la-visibility.o): in function `gcry_err_make_from_errno':
+visibility.c:(.text+0x29): undefined reference to `gpg_err_code_from_errno'
+
+Fixes:
+ - http://autobuild.buildroot.org/results/5354f7231cf08bf762e7d86fca874ce63d9a116b
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/chu11/freeipmi-mirror/pull/52]
+---
+ configure.ac | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index bcc4156ff..531e10b8d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -405,7 +405,11 @@ fi
+ dnl Checks for libraries.
+ dnl don\'t include lib if LAN not desired
+ if test x"${ac_with_encryption}" = xyes; then
+-  AC_CHECK_LIB([gcrypt], [gcry_md_open], [have_gcrypt=yes], [have_gcrypt=no])
++  PKG_CHECK_MODULES([GCRYPT], [libgcrypt], [have_gcrypt=yes], [
++     AC_CHECK_LIB([gcrypt], [gcry_md_open],
++        [have_gcrypt=yes GCRYPT_LIBS=-lgcrypt],
++        [have_gcrypt=no])
++  ])
+   if test "x${have_gcrypt}" = "xno"; then
+      AC_MSG_ERROR([libgcrypt required to build libfreeipmi])
+      AC_MSG_NOTICE([Note: libgpg-error required for libgcrypt])
+@@ -421,7 +425,6 @@ if test x"${ac_with_encryption}" = xyes; then
+   if test "x${have_gcrypt_threads}" = "xno"; then
+      AC_MSG_ERROR([libgcrypt with threads support required for libfreeipmi])
+   fi
+-  GCRYPT_LIBS=-lgcrypt
+ fi
+ AC_SUBST(GCRYPT_LIBS)
+ 
+-- 
+2.34.1
+