Skip to contentSkip to conversation

package/cryptsetup: fix build failure with Microblaze

PATCH Applied Giulio Benetti 2 participants 2 messages Feb 2, 2022 – Feb 13, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/cryptsetup: fix build failure with Microblaze

Add local patch pending upstream[1] to fix the build failure after my suggestion[2] to imitate what I've done with libfuse[3].

[1]: https://gitlab.com/cryptsetup/cryptsetup/-/merge_requests/275?commit_id=5f71b3d63181aa88a68f7f71eab8801f2d8d2cde
[2]: https://gitlab.com/cryptsetup/cryptsetup/-/issues/709
[3]: https://github.com/libfuse/libfuse/pull/620/commits/3aba09a5c56e017746c5c1652dbc845f4db7374a

Fixes:
http://autobuild.buildroot.net/results/bad/bad4d01fde3191e4d481a8e9dae18df3b1a94537/

---
 ...d-check-program-for-symver-attribute.patch | 56 +++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 package/cryptsetup/0001-Add-check-program-for-symver-attribute.patch
package/cryptsetup/0001-Add-check-program-for-symver-attribute.patch new file +56 -0
new file mode 100644
index 0000000000..04f59a2050
@@ -0,0 +1,56 @@
+From 7c6ec620de3f99d4212f4a54aa576df1b97020ab Mon Sep 17 00:00:00 2001
+From: Ondrej Kozina <[email protected]>
+Date: Wed, 2 Feb 2022 11:34:57 +0100
+Subject: [PATCH] Add check program for symver attribute.
+
+Fixes: #709.
+Signed-off-by: Giulio Benetti <[email protected]>
+---
+ configure.ac               | 11 +++++++++++
+ lib/libcryptsetup_symver.h |  8 +++-----
+ 2 files changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index a0e5990d..b052f8cf 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -554,6 +554,17 @@ if test "x$enable_static_cryptsetup" = "xyes"; then
+ 	PKG_CONFIG=$saved_PKG_CONFIG
+ fi
+ 
++dnl Check compiler support for symver function attribute
++saved_CFLAGS=$CFLAGS
++CFLAGS="-O0 -Werror"
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
++	void _test_sym(void);
++	__attribute__((__symver__("sym@VERSION_4.2"))) void _test_sym(void) {}
++]],
++[[ _test_sym() ]]
++)],[ AC_DEFINE([HAVE_ATTRIBUTE_SYMVER], 1, [Define to 1 to use __attribute__((symver))])])
++CFLAGS=$saved_CFLAGS
++
+ AC_MSG_CHECKING([for systemd tmpfiles config directory])
+ PKG_CHECK_VAR([systemd_tmpfilesdir], [systemd], [tmpfilesdir], [], [systemd_tmpfilesdir=no])
+ AC_MSG_RESULT([$systemd_tmpfilesdir])
+diff --git a/lib/libcryptsetup_symver.h b/lib/libcryptsetup_symver.h
+index 2a804b6a..3558310d 100644
+--- a/lib/libcryptsetup_symver.h
++++ b/lib/libcryptsetup_symver.h
+@@ -67,11 +67,9 @@
+  *   under CRYPT_SYMBOL_EXPORT_OLD(int, crypt_func_X, ...) macro
+  */
+ 
+-#ifdef __has_attribute
+-#  if __has_attribute(symver)
+-#    define _CRYPT_SYMVER(_local_sym, _public_sym, _ver_str, _maj, _min)     \
+-       __attribute__((__symver__(#_public_sym _ver_str #_maj "." #_min)))
+-#  endif
++#if HAVE_ATTRIBUTE_SYMVER
++#  define _CRYPT_SYMVER(_local_sym, _public_sym, _ver_str, _maj, _min)     \
++     __attribute__((__symver__(#_public_sym _ver_str #_maj "." #_min)))
+ #endif
+ 
+ #if !defined(_CRYPT_SYMVER) && defined(__GNUC__)
+-- 
+2.25.1
+
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 11 lines · Giulio Benetti

Add local patch pending upstream[1] to fix the build failure after my suggestion[2] to imitate what I've done with libfuse[3].

[1]: https://gitlab.com/cryptsetup/cryptsetup/-/merge_requests/275?commit_id=5f71b3d63181aa88a68f7f71eab8801f2d8d2cde
[2]: https://gitlab.com/cryptsetup/cryptsetup/-/issues/709
[3]: https://github.com/libfuse/libfuse/pull/620/commits/3aba09a5c56e017746c5c1652dbc845f4db7374a

Fixes:
http://autobuild.buildroot.net/results/bad/bad4d01fde3191e4d481a8e9dae18df3b1a94537/

Applied to master, thanks.

Regards,
Arnout

Quoted 57 lines
---
  ...d-check-program-for-symver-attribute.patch | 56 +++++++++++++++++++
  1 file changed, 56 insertions(+)

create mode 100644 package/cryptsetup/0001-Add-check-program-for-symver-attribute.patch

package/cryptsetup/0001-Add-check-program-for-symver-attribute.patch new file +46 -0
new file mode 100644
index 0000000000..04f59a2050
@@ -0,0 +1,56 @@
+From 7c6ec620de3f99d4212f4a54aa576df1b97020ab Mon Sep 17 00:00:00 2001
+From: Ondrej Kozina <[email protected]>
+Date: Wed, 2 Feb 2022 11:34:57 +0100
+Subject: [PATCH] Add check program for symver attribute.
+
+Fixes: #709.
+Signed-off-by: Giulio Benetti <[email protected]>
+---
+ configure.ac               | 11 +++++++++++
+ lib/libcryptsetup_symver.h |  8 +++-----
+ 2 files changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index a0e5990d..b052f8cf 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -554,6 +554,17 @@ if test "x$enable_static_cryptsetup" = "xyes"; then
+ 	PKG_CONFIG=$saved_PKG_CONFIG
+ fi
+
++dnl Check compiler support for symver function attribute
++saved_CFLAGS=$CFLAGS
++CFLAGS="-O0 -Werror"
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
++	void _test_sym(void);
++	__attribute__((__symver__("sym@VERSION_4.2"))) void _test_sym(void) {}
++]],
++[[ _test_sym() ]]
++)],[ AC_DEFINE([HAVE_ATTRIBUTE_SYMVER], 1, [Define to 1 to use __attribute__((symver))])])
++CFLAGS=$saved_CFLAGS
++
+ AC_MSG_CHECKING([for systemd tmpfiles config directory])
+ PKG_CHECK_VAR([systemd_tmpfilesdir], [systemd], [tmpfilesdir], [], [systemd_tmpfilesdir=no])
+ AC_MSG_RESULT([$systemd_tmpfilesdir])
+diff --git a/lib/libcryptsetup_symver.h b/lib/libcryptsetup_symver.h
+index 2a804b6a..3558310d 100644
+--- a/lib/libcryptsetup_symver.h
++++ b/lib/libcryptsetup_symver.h
+@@ -67,11 +67,9 @@
+  *   under CRYPT_SYMBOL_EXPORT_OLD(int, crypt_func_X, ...) macro
+  */
+
+-#ifdef __has_attribute
+-#  if __has_attribute(symver)
+-#    define _CRYPT_SYMVER(_local_sym, _public_sym, _ver_str, _maj, _min)     \
+-       __attribute__((__symver__(#_public_sym _ver_str #_maj "." #_min)))

package/cryptsetup/0001-Add-check-program-for-symver-attribute.patch line 56

Quoted 10 lines
package/cryptsetup/0001-Add-check-program-for-symver-attribute.patch new file +10 -0
+-#  endif
++#if HAVE_ATTRIBUTE_SYMVER
++#  define _CRYPT_SYMVER(_local_sym, _public_sym, _ver_str, _maj, _min)     \
++     __attribute__((__symver__(#_public_sym _ver_str #_maj "." #_min)))
+ #endif
+
+ #if !defined(_CRYPT_SYMVER) && defined(__GNUC__)
+--
+2.25.1
+

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot