Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,146 @@
From bcfd89abdb5110b93314297120412d4c7f2da313 Mon Sep 17 00:00:00 2001
From: Trevor Gamblin <trevor.gamblin@windriver.com>
Date: Tue, 29 Oct 2019 14:08:32 -0400
Subject: [PATCH] libgcrypt: fix m4 file for oe-core
Modify libgcrypt pkgconfig specifically for oe-core. Changes
are based on a previous patch from RP, using wiggle to
incorporate the parts that aren't in the upstream pkgconfig
settings.
Upstream-Status: Inappropriate [oe-specific]
Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
---
src/libgcrypt.m4 | 90 +++---------------------------------------------
1 file changed, 4 insertions(+), 86 deletions(-)
diff --git a/src/libgcrypt.m4 b/src/libgcrypt.m4
index cd4249e..e53a36f 100644
--- a/src/libgcrypt.m4
+++ b/src/libgcrypt.m4
@@ -29,41 +29,6 @@ dnl is added to the gpg_config_script_warn variable.
dnl
AC_DEFUN([AM_PATH_LIBGCRYPT],
[ AC_REQUIRE([AC_CANONICAL_HOST])
- AC_ARG_WITH(libgcrypt-prefix,
- AS_HELP_STRING([--with-libgcrypt-prefix=PFX],
- [prefix where LIBGCRYPT is installed (optional)]),
- libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
- if test x"${LIBGCRYPT_CONFIG}" = x ; then
- if test x"${libgcrypt_config_prefix}" != x ; then
- LIBGCRYPT_CONFIG="${libgcrypt_config_prefix}/bin/libgcrypt-config"
- fi
- fi
-
- use_gpgrt_config=""
- if test x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then
- if $GPGRT_CONFIG libgcrypt --exists; then
- LIBGCRYPT_CONFIG="$GPGRT_CONFIG libgcrypt"
- AC_MSG_NOTICE([Use gpgrt-config as libgcrypt-config])
- use_gpgrt_config=yes
- fi
- fi
- if test -z "$use_gpgrt_config"; then
- if test x"${LIBGCRYPT_CONFIG}" = x ; then
- case "${SYSROOT}" in
- /*)
- if test -x "${SYSROOT}/bin/libgcrypt-config" ; then
- LIBGCRYPT_CONFIG="${SYSROOT}/bin/libgcrypt-config"
- fi
- ;;
- '')
- ;;
- *)
- AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.])
- ;;
- esac
- fi
- AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
- fi
tmp=ifelse([$1], ,1:1.2.0,$1)
if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
@@ -74,56 +39,13 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
min_libgcrypt_version="$tmp"
fi
- AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version)
- ok=no
- if test "$LIBGCRYPT_CONFIG" != "no" ; then
- req_major=`echo $min_libgcrypt_version | \
- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
- req_minor=`echo $min_libgcrypt_version | \
- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
- req_micro=`echo $min_libgcrypt_version | \
- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
- if test -z "$use_gpgrt_config"; then
- libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
- else
- libgcrypt_config_version=`$LIBGCRYPT_CONFIG --modversion`
- fi
- major=`echo $libgcrypt_config_version | \
- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
- minor=`echo $libgcrypt_config_version | \
- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
- micro=`echo $libgcrypt_config_version | \
- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
- if test "$major" -gt "$req_major"; then
- ok=yes
- else
- if test "$major" -eq "$req_major"; then
- if test "$minor" -gt "$req_minor"; then
- ok=yes
- else
- if test "$minor" -eq "$req_minor"; then
- if test "$micro" -ge "$req_micro"; then
- ok=yes
- fi
- fi
- fi
- fi
- fi
- fi
- if test $ok = yes; then
- AC_MSG_RESULT([yes ($libgcrypt_config_version)])
- else
- AC_MSG_RESULT(no)
- fi
+ PKG_CHECK_MODULES(LIBGCRYPT, [libgcrypt >= $min_libgcrypt_version], [ok=yes], [ok=no])
+
if test $ok = yes; then
# If we have a recent libgcrypt, we should also check that the
# API is compatible
if test "$req_libgcrypt_api" -gt 0 ; then
- if test -z "$use_gpgrt_config"; then
- tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
- else
- tmp=`$LIBGCRYPT_CONFIG --variable=api_version 2>/dev/null || echo 0`
- fi
+ tmp=`$PKG_CONFIG --variable=api_version libgcrypt`
if test "$tmp" -gt 0 ; then
AC_MSG_CHECKING([LIBGCRYPT API version])
if test "$req_libgcrypt_api" -eq "$tmp" ; then
@@ -136,11 +58,9 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
fi
fi
if test $ok = yes; then
- LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
- LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
ifelse([$2], , :, [$2])
if test -z "$use_gpgrt_config"; then
- libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
+ libgcrypt_config_host=`$PKG_CONFIG --variable=host libgcrypt`
else
libgcrypt_config_host=`$LIBGCRYPT_CONFIG --variable=host 2>/dev/null || echo none`
fi
@@ -158,8 +78,6 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
fi
fi
else
- LIBGCRYPT_CFLAGS=""
- LIBGCRYPT_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(LIBGCRYPT_CFLAGS)
@@ -0,0 +1,39 @@
From 0f66e796a8522e1043dda03b88d5f6feae839d16 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Wed, 16 Aug 2017 10:44:41 +0800
Subject: [PATCH] libgcrypt: fix building error with '-O2' in sysroot path
Upstream-Status: Pending
Characters like '-O2' or '-Ofast' will be replaced by '-O1' when
compiling cipher.
If we are cross compiling libgcrypt and sysroot contains such
characters, we would
get compile errors because the sysroot path has been modified.
Fix this by adding blank spaces before and after the original matching
pattern in the
sed command.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Rebase to 1.8.0
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
cipher/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cipher/Makefile.am b/cipher/Makefile.am
index c3d642b..88c883a 100644
--- a/cipher/Makefile.am
+++ b/cipher/Makefile.am
@@ -153,7 +153,7 @@ gost-s-box: gost-s-box.c
if ENABLE_O_FLAG_MUNGING
-o_flag_munging = sed -e 's/-O\([2-9sgz][2-9sgz]*\)/-O1/' -e 's/-Ofast/-O1/g'
+o_flag_munging = sed -e 's/ -O\([2-9sgz][2-9sgz]*\) / -O1 /' -e 's/ -Ofast / -O1 /g'
else
o_flag_munging = cat
endif
@@ -0,0 +1,38 @@
From 9182bc2dc676858a823c477d8f45a578b8c4f69f Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Sun, 12 Jun 2016 04:44:29 -0400
Subject: [PATCH] tests/Makefile.am: fix undefined reference to
`pthread_create'
Add missing '-lpthread' to CFLAGS
Upstream-Status: Pending
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
tests/Makefile.am | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e6953fd..f47e1d3 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -76,7 +76,7 @@ t_mpi_bit_LDADD = $(standard_ldadd) @LDADD_FOR_TESTS_KLUDGE@
t_secmem_LDADD = $(standard_ldadd) @LDADD_FOR_TESTS_KLUDGE@
testapi_LDADD = $(standard_ldadd) @LDADD_FOR_TESTS_KLUDGE@
t_lock_LDADD = $(standard_ldadd) $(GPG_ERROR_MT_LIBS) @LDADD_FOR_TESTS_KLUDGE@
-t_lock_CFLAGS = $(GPG_ERROR_MT_CFLAGS)
+t_lock_CFLAGS = $(GPG_ERROR_MT_CFLAGS) -lpthread
testdrv_LDADD = $(LDADD_FOR_TESTS_KLUDGE)
# Build a version of the test driver for the build platform.
@@ -95,7 +95,7 @@ else
xtestsuite_libs = ../src/.libs/libgcrypt.so*
xtestsuite_driver = testdrv
t_kdf_LDADD = $(standard_ldadd) $(GPG_ERROR_MT_LIBS) @LDADD_FOR_TESTS_KLUDGE@
-t_kdf_CFLAGS = $(GPG_ERROR_MT_CFLAGS)
+t_kdf_CFLAGS = $(GPG_ERROR_MT_CFLAGS) -lpthread
endif
# xcheck uses our new testdrv instead of the automake test runner.
@@ -0,0 +1,20 @@
The bench-slope test appears to be aborting fairly frequently, which causes
failures on the autobuilder.
Until this has been root-caused, disable the test.
Upstream-Status: Inappropriate
Signed-off-by: Ross Burton <ross.burton@arm.com>
diff --git a/tests/testdrv.c b/tests/testdrv.c
index 0ccde326..d3455186 100644
--- a/tests/testdrv.c
+++ b/tests/testdrv.c
@@ -77,7 +77,6 @@ static struct {
{ "t-x448" },
{ "t-ed448" },
{ "benchmark" },
- { "bench-slope" },
{ "hashtest-256g", "hashtest", "--gigs 256 SHA1 SHA256 SHA512 SM3",
LONG_RUNNING },
{ NULL }
@@ -0,0 +1,18 @@
Don't depend on a native libgpg-error to build the test driver, as it's
an optional dependency for some C annotations.
Upstream-Status: Inappropriate
Signed-off-by: Ross Burton <ross.burton@arm.com>
diff --git a/tests/testdrv.c b/tests/testdrv.c
index 0ccde326..6d6abd57 100644
--- a/tests/testdrv.c
+++ b/tests/testdrv.c
@@ -32,7 +32,6 @@
# include <fcntl.h>
# include <sys/wait.h>
#endif
-#include <gpg-error.h> /* For some macros. */
#include "stopwatch.h"
@@ -0,0 +1,9 @@
#!/bin/sh
# Run the tests in regression mode so they are quicker
export GCRYPT_IN_REGRESSION_TEST=1
# The 'random' test invokes itself, so we need to be sure that the test
# directory is on PATH.
export PATH=$PATH:.
./testdrv --verbose
@@ -0,0 +1,58 @@
SUMMARY = "General purpose cryptographic library based on the code from GnuPG"
DESCRIPTION = "A cryptography library developed as a separated module of GnuPG. \
It can also be used independently of GnuPG, but depends on its error-reporting \
library Libgpg-error."
HOMEPAGE = "http://directory.fsf.org/project/libgcrypt/"
BUGTRACKER = "https://bugs.g10code.com/gnupg/index"
SECTION = "libs"
# helper program gcryptrnd and getrandom are under GPL, rest LGPL
LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
LICENSE:${PN} = "LGPL-2.1-or-later"
LICENSE:${PN}-dev = "GPL-2.0-or-later & LGPL-2.1-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff \
file://LICENSES;md5=ef545b6cc717747072616519a1256d69 \
"
DEPENDS = "libgpg-error"
UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.bz2 \
file://0001-libgcrypt-fix-m4-file-for-oe-core.patch \
file://0002-libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch \
file://0004-tests-Makefile.am-fix-undefined-reference-to-pthread.patch \
file://no-native-gpg-error.patch \
file://no-bench-slope.patch \
file://run-ptest \
"
SRC_URI[sha256sum] = "3b9c02a004b68c256add99701de00b383accccf37177e0d6c58289664cce0c03"
CVE_STATUS[CVE-2018-12433] = "disputed: CVE is disputed and not affecting crypto libraries for any distro."
CVE_STATUS[CVE-2018-12438] = "disputed: CVE is disputed and not affecting crypto libraries for any distro."
BINCONFIG = "${bindir}/libgcrypt-config"
inherit autotools texinfo binconfig-disabled pkgconfig ptest
EXTRA_OECONF = "--disable-asm"
EXTRA_OEMAKE:class-target = "LIBTOOLFLAGS='--tag=CC'"
PACKAGECONFIG ??= "capabilities"
PACKAGECONFIG[capabilities] = "--with-capabilities,--without-capabilities,libcap"
do_configure:prepend () {
# Else this could be used in preference to the one in aclocal-copy
rm -f ${S}/m4/gpg-error.m4
}
do_install_ptest() {
cd tests
oe_runmake testdrv-build testdrv
install testdrv $(srcdir=${S}/tests ./testdrv-build --files | sort | uniq) ${D}${PTEST_PATH}
}
FILES:${PN}-dev += "${bindir}/hmac256 ${bindir}/dumpsexp"
BBCLASSEXTEND = "native nativesdk"