commit:     79310839e23136450bca4c71b6ddd49475e3e0ef
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 15 17:00:37 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Mon Jun 15 17:05:29 2020 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=79310839

Bump libgpg-error to v1.38

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 gkbuilds/libgpg-error.gkbuild                      |   9 +-
 .../libgpg-error-1.36-gpg-error-config.patch       |   0
 .../libgpg-error-1.37-remove_broken_check.patch    |   0
 ...cross-compiling-into-a-separate-build-dir.patch |  41 +++++++
 ...8-002-On-cross-build-detect-hosts-objdump.patch |  54 ++++++++++
 ...1.38-003-Fix-command-line-to-make-src-dir.patch |  26 +++++
 .../libgpg-error-1.38-004-add-missing-file.patch   | 118 +++++++++++++++++++++
 7 files changed, 246 insertions(+), 2 deletions(-)

diff --git a/gkbuilds/libgpg-error.gkbuild b/gkbuilds/libgpg-error.gkbuild
index 7b74bb9..1e42881 100644
--- a/gkbuilds/libgpg-error.gkbuild
+++ b/gkbuilds/libgpg-error.gkbuild
@@ -2,6 +2,13 @@
 # Distributed under the terms of the GNU General Public License v2
 
 src_prepare() {
+       # gen-lock-obj.sh is missing in 1.38 release tarball
+       # and patch can't add non-existing files
+       echo "dummy" > "${S}"/src/gen-lock-obj.sh || die
+       chmod 0755 "${S}"/src/gen-lock-obj.sh || die
+
+       default
+
        if [[ ! -f "${S}/src/syscfg/lock-obj-pub.${CHOST}.h" ]]
        then
                print_warning 3 "CHOST '${CHOST}' not known by ${P} -- 
workaround for bug 584052 needed ..."
@@ -40,8 +47,6 @@ src_prepare() {
                        print_warning 3 "CHOST set to '${CHOST_KNOWN}'!"
                fi
        fi
-
-       default
 }
 
 src_configure() {

diff --git a/patches/libgpg-error/1.37/libgpg-error-1.36-gpg-error-config.patch 
b/patches/libgpg-error/1.38/libgpg-error-1.36-gpg-error-config.patch
similarity index 100%
rename from patches/libgpg-error/1.37/libgpg-error-1.36-gpg-error-config.patch
rename to patches/libgpg-error/1.38/libgpg-error-1.36-gpg-error-config.patch

diff --git 
a/patches/libgpg-error/1.37/libgpg-error-1.37-remove_broken_check.patch 
b/patches/libgpg-error/1.38/libgpg-error-1.37-remove_broken_check.patch
similarity index 100%
rename from 
patches/libgpg-error/1.37/libgpg-error-1.37-remove_broken_check.patch
rename to patches/libgpg-error/1.38/libgpg-error-1.37-remove_broken_check.patch

diff --git 
a/patches/libgpg-error/1.38/libgpg-error-1.38-001-fix-cross-compiling-into-a-separate-build-dir.patch
 
b/patches/libgpg-error/1.38/libgpg-error-1.38-001-fix-cross-compiling-into-a-separate-build-dir.patch
new file mode 100644
index 0000000..8f40bbc
--- /dev/null
+++ 
b/patches/libgpg-error/1.38/libgpg-error-1.38-001-fix-cross-compiling-into-a-separate-build-dir.patch
@@ -0,0 +1,41 @@
+From 013720333c6ec1d38791689bc49ba039d98e16b3 Mon Sep 17 00:00:00 2001
+From: David Michael <[email protected]>
+Date: Mon, 1 Jun 2020 10:24:53 -0400
+Subject: [PATCH] build: Fix cross-compiling into a separate build dir.
+
+* configure.ac: Create the src directory before writing into it.
+* src/Makefile.am (EXTRA_DIST): Add gen-lock-obj.sh.
+
+--
+
+Signed-off-by: David Michael <[email protected]>
+---
+ configure.ac    | 1 +
+ src/Makefile.am | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 6bd634b..1dd6489 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -598,6 +598,7 @@ if test x$cross_compiling = xyes; then
+   case $host in
+     *-*-linux*)
+     lock_obj_h_generated=yes
++    mkdir src
+     LOCK_ABI_VERSION=1 host=$host host_alias=$host_alias \
+         CC=$CC OBJDUMP=$host_alias-objdump \
+         ac_ext=$ac_ext ac_objext=$ac_objext \
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 7e36d69..b2bffd2 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -102,7 +102,7 @@ EXTRA_DIST = mkstrtable.awk err-sources.h.in 
err-codes.h.in \
+       gpg-error.vers gpg-error.def.in \
+         versioninfo.rc.in gpg-error.w32-manifest.in \
+       gpg-error-config-test.sh gpg-error.pc.in \
+-      $(lock_obj_pub)
++      gen-lock-obj.sh $(lock_obj_pub)
+ 
+ BUILT_SOURCES = $(srcdir)/err-sources.h $(srcdir)/err-codes.h \
+       code-to-errno.h code-from-errno.h \

diff --git 
a/patches/libgpg-error/1.38/libgpg-error-1.38-002-On-cross-build-detect-hosts-objdump.patch
 
b/patches/libgpg-error/1.38/libgpg-error-1.38-002-On-cross-build-detect-hosts-objdump.patch
new file mode 100644
index 0000000..2f5bd67
--- /dev/null
+++ 
b/patches/libgpg-error/1.38/libgpg-error-1.38-002-On-cross-build-detect-hosts-objdump.patch
@@ -0,0 +1,54 @@
+From ce97528fa3dcc58d86e18d4d8820f210a624f63d Mon Sep 17 00:00:00 2001
+From: NIIBE Yutaka <[email protected]>
+Date: Thu, 11 Jun 2020 10:19:15 +0900
+Subject: [PATCH] build: On cross build, detect host's objdump.
+
+* configure.ac [*-*-linux*] (CROSS_HOST_OBJDUMP): New.
+
+--
+
+To support widely, we could also use objdump configured for multiple
+archs which supports host's format (instead of $host_alias-objdump),
+like objdump in binutils-multiarch of Debian, but it's not that easy
+to maintain the code to determine format name from $host_alias.
+
+Or we could use eu-size in elfutils.
+
+GnuPG-bug-id: 4973
+Signed-off-by: NIIBE Yutaka <[email protected]>
+---
+ configure.ac | 21 +++++++++++++--------
+ 1 file changed, 13 insertions(+), 8 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 1dd6489..d5fa4b0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -597,14 +597,19 @@ fi
+ if test x$cross_compiling = xyes; then
+   case $host in
+     *-*-linux*)
+-    lock_obj_h_generated=yes
+-    mkdir src
+-    LOCK_ABI_VERSION=1 host=$host host_alias=$host_alias \
+-        CC=$CC OBJDUMP=$host_alias-objdump \
+-        ac_ext=$ac_ext ac_objext=$ac_objext \
+-        AWK=$AWK $srcdir/src/gen-lock-obj.sh \
+-        >src/lock-obj-pub.native.h
+-    AC_MSG_NOTICE([generated src/lock-obj-pub.native.h])
++    AC_CHECK_PROG(CROSS_HOST_OBJDUMP, [$host_alias-objdump], [yes])
++    if test "$CROSS_HOST_OBJDUMP" = "yes" ; then
++      lock_obj_h_generated=yes
++      if test ! -d src; mkdir src; fi
++      LOCK_ABI_VERSION=1 host=$host host_alias=$host_alias \
++          CC=$CC OBJDUMP=$host_alias-objdump \
++          ac_ext=$ac_ext ac_objext=$ac_objext \
++          AWK=$AWK $srcdir/src/gen-lock-obj.sh \
++          >src/lock-obj-pub.native.h
++      AC_MSG_NOTICE([generated src/lock-obj-pub.native.h using 
$host_alias-objdump and $AWK])
++    else
++      force_use_syscfg=yes
++    fi
+     ;;
+     *)
+     force_use_syscfg=yes

diff --git 
a/patches/libgpg-error/1.38/libgpg-error-1.38-003-Fix-command-line-to-make-src-dir.patch
 
b/patches/libgpg-error/1.38/libgpg-error-1.38-003-Fix-command-line-to-make-src-dir.patch
new file mode 100644
index 0000000..5fc7f15
--- /dev/null
+++ 
b/patches/libgpg-error/1.38/libgpg-error-1.38-003-Fix-command-line-to-make-src-dir.patch
@@ -0,0 +1,26 @@
+From 159e394920f6be822d771fe003498de4d93b07c3 Mon Sep 17 00:00:00 2001
+From: NIIBE Yutaka <[email protected]>
+Date: Fri, 12 Jun 2020 08:59:01 +0900
+Subject: [PATCH] build: Fix command-line to make 'src 'dir.
+
+* configure.ac: Mistake, then, fix it.
+
+Fixes-commit: ce97528fa3dcc58d86e18d4d8820f210a624f63d
+Signed-off-by: NIIBE Yutaka <[email protected]>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index d5fa4b0..80d24db 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -600,7 +600,7 @@ if test x$cross_compiling = xyes; then
+     AC_CHECK_PROG(CROSS_HOST_OBJDUMP, [$host_alias-objdump], [yes])
+     if test "$CROSS_HOST_OBJDUMP" = "yes" ; then
+       lock_obj_h_generated=yes
+-      if test ! -d src; mkdir src; fi
++      if test ! -d src; then mkdir src; fi
+       LOCK_ABI_VERSION=1 host=$host host_alias=$host_alias \
+           CC=$CC OBJDUMP=$host_alias-objdump \
+           ac_ext=$ac_ext ac_objext=$ac_objext \

diff --git 
a/patches/libgpg-error/1.38/libgpg-error-1.38-004-add-missing-file.patch 
b/patches/libgpg-error/1.38/libgpg-error-1.38-004-add-missing-file.patch
new file mode 100644
index 0000000..36e9af1
--- /dev/null
+++ b/patches/libgpg-error/1.38/libgpg-error-1.38-004-add-missing-file.patch
@@ -0,0 +1,118 @@
+diff --git a/src/gen-lock-obj.sh b/src/gen-lock-obj.sh
+index 421376d..13858cf 100755
+--- a/src/gen-lock-obj.sh
++++ b/src/gen-lock-obj.sh
+@@ -1 +1,112 @@
+-dummy
++#! /bin/sh
++#
++# gen-lock-obj.sh - Build tool to construct the lock object.
++#
++# Copyright (C) 2020 g10 Code GmbH
++#
++# This file is part of libgpg-error.
++#
++# libgpg-error is free software; you can redistribute it and/or
++# modify it under the terms of the GNU Lesser General Public License
++# as published by the Free Software Foundation; either version 2.1 of
++# the License, or (at your option) any later version.
++#
++# libgpg-error is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++# Lesser General Public License for more details.
++#
++# You should have received a copy of the GNU Lesser General Public
++# License along with this program; if not, see 
<https://www.gnu.org/licenses/>.
++#
++
++#
++# Following variables should be defined to invoke this script
++#
++#   CC
++#   OBJDUMP
++#   AWK
++#   ac_ext
++#   ac_object
++#   host
++#   LOCK_ABI_VERSION
++#
++# An example:
++#
++# LOCK_ABI_VERSION=1 host=x86_64-pc-linux-gnu host_alias=x86_64-linux-gnu \
++#     CC=$host_alias-gcc OBJDUMP=$host_alias-objdump ac_ext=c ac_objext=o \
++#     AWK=gawk ./gen-lock-obj.sh
++#
++
++AWK_VERSION_OUTPUT=$($AWK 'BEGIN { print PROCINFO["version"] }')
++if test -n "$AWK_VERSION_OUTPUT"; then
++    # It's GNU awk, which supports PROCINFO.
++    AWK_OPTION=--non-decimal-data
++fi
++
++cat <<'EOF' >conftest.$ac_ext
++#include <pthread.h>
++pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
++EOF
++
++if $CC -c conftest.$ac_ext; then :
++  ac_mtx_size=$($OBJDUMP -j .bss -t conftest.$ac_objext \
++         | $AWK $AWK_OPTION '
++/mtx$/ { mtx_size = int("0x" $5) }
++END { print mtx_size }')
++else
++    echo "Can't determine mutex size"
++    exit 1
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++
++cat <<EOF
++## lock-obj-pub.$host.h
++## File created by gen-lock-obj.sh - DO NOT EDIT
++## To be included by mkheader into gpg-error.h
++
++typedef struct
++{
++  long _vers;
++  union {
++    volatile char _priv[$ac_mtx_size];
++    long _x_align;
++    long *_xp_align;
++  } u;
++} gpgrt_lock_t;
++
++EOF
++
++# FIXME: Support different alignment conditions of:
++#
++#     USE_16BYTE_ALIGNMENT
++#     USE_DOUBLE_FOR_ALIGNMENT
++#     USE_LONG_DOUBLE_FOR_ALIGNMENT
++#
++
++echo -n "#define GPGRT_LOCK_INITIALIZER {$LOCK_ABI_VERSION,{{"
++
++i=0
++while test "$i" -lt $ac_mtx_size; do
++    if test "$i" -ne 0 -a "$(( $i % 8 ))" -eq 0; then
++        echo ' \'
++        echo -n "                                    "
++    fi
++    echo -n '0'
++    if test "$i" -lt $(($ac_mtx_size - 1)); then
++        echo -n ','
++    fi
++    i=$(( i + 1 ))
++done
++
++cat <<'EOF'
++}}}
++##
++## Local Variables:
++## mode: c
++## buffer-read-only: t
++## End:
++##
++EOF
++
++exit 0

Reply via email to