Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Thomas Orgis (796e1c0bf020456d45995dc7505049d844155942)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Thomas Orgis <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Thomas Orgis (796e1c0bf020456d45995dc7505049d844155942)
  • Date: Wed, 27 Sep 2017 15:35:21 +0000

GIT changes to master grimoire by Thomas Orgis <sobukus AT sourcemage.org>:

libs/glibc/DETAILS | 1
libs/glibc/HISTORY | 4 +
libs/glibc/PRE_BUILD | 7 ++
libs/glibc/pthread-longjmp.patch | 111
+++++++++++++++++++++++++++++++++++++++
4 files changed, 122 insertions(+), 1 deletion(-)

New commits:
commit 796e1c0bf020456d45995dc7505049d844155942
Author: Thomas Orgis <sobukus AT sourcemage.org>
Commit: Thomas Orgis <sobukus AT sourcemage.org>

glibc: longjmp + pthread fix

Programs that link to pthread and use libpng failed like that
with glibc 2.25+:

/usr/bin/gdk-pixbuf-csource: Relink `/usr/lib/../lib/libpng16.so.16'
with `/lib/libpthread.so.0' for IFUNC symbol `longjmp'

This breaks various spells. This commit pulls in a patch from
glibc repo that is about to appear in a future release, avoiding
the the need to load libpthread early for the longjmp() games.

diff --git a/libs/glibc/DETAILS b/libs/glibc/DETAILS
index ca23eb6..65d4704 100755
--- a/libs/glibc/DETAILS
+++ b/libs/glibc/DETAILS
@@ -38,6 +38,7 @@ SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELL-$VERSION
SOURCE_GPG=glibc.gpg:$SOURCE.sig:UPSTREAM_KEY
SOURCE2_IGNORE=signature
SECURITY_PATCH=9
+ PATCHLEVEL=1
fi
if [[ $GLIBC_SANITIZE_HEADERS == n ]]; then
HEADERS_VERSION=3.17.4
diff --git a/libs/glibc/HISTORY b/libs/glibc/HISTORY
index 5f6b58e..7b9c1d1 100644
--- a/libs/glibc/HISTORY
+++ b/libs/glibc/HISTORY
@@ -1,6 +1,10 @@
2017-09-24 Thomas Orgis <sobukus AT sourcemage.org>
* UP_TRIGGERS: add icu to the xlocale.h offenders,
also trigger on any update crossing 2.26
+ * PRE_BUILD, pthread-longjmp.patch: Fix mixture of libs
+ using longjmp but no pthread with applications linking with
+ pthread.
+ * DETAILS: PATCHLEVEL++

2017-08-16 Eric Sandall <sandalle AT sourcemage.org>
* DEPENDS: Force gcc to be built if major version upgrade
diff --git a/libs/glibc/PRE_BUILD b/libs/glibc/PRE_BUILD
index f4bf63f..c4933c2 100755
--- a/libs/glibc/PRE_BUILD
+++ b/libs/glibc/PRE_BUILD
@@ -53,7 +53,12 @@ if [ "$GLIBC_NPTL" = "y" ]; then
return 1
fi
fi &&
- make mrproper
+ make mrproper &&
+ # A fix from git that avoids linking breakage with pthread and longjmp.
+ if ! [[ "${GLIBC_BRANCH}" == "scm" ]]; then
+ (cd "$SOURCE_DIRECTORY" &&
+ patch -Np1 < "$SCRIPT_DIRECTORY/pthread-longjmp.patch")
+ fi
else
cd $SOURCE_DIRECTORY &&
#
diff --git a/libs/glibc/pthread-longjmp.patch
b/libs/glibc/pthread-longjmp.patch
new file mode 100644
index 0000000..9d16a0c
--- /dev/null
+++ b/libs/glibc/pthread-longjmp.patch
@@ -0,0 +1,111 @@
+From fc5ad7024c620cdfe9b76e94638aac83b99c5bf8 Mon Sep 17 00:00:00 2001
+From: Andreas Schwab <schwab AT suse.de>
+Date: Tue, 8 Aug 2017 16:21:58 +0200
+Subject: [PATCH 1/1] Don't use IFUNC resolver for longjmp or system in
+ libpthread (bug 21041)
+
+Unlike the vfork forwarder and like the fork forwarder as in bug 19861,
+there won't be a problem when the compiler does not turn this into a tail
+call.
+---
+ ChangeLog | 6 ++++++
+ nptl/pt-longjmp.c | 31 ++++++++++---------------------
+ nptl/pt-system.c | 24 ++++++++----------------
+ 3 files changed, 24 insertions(+), 37 deletions(-)
+
+diff --git a/nptl/pt-longjmp.c b/nptl/pt-longjmp.c
+index 2ef757e..8f3c6b3 100644
+--- a/nptl/pt-longjmp.c
++++ b/nptl/pt-longjmp.c
+@@ -25,21 +25,14 @@
+ symbol in libpthread, but the historical ABI requires it. For static
+ linking, there is no need to provide anything here--the libc version
+ will be linked in. For shared library ABI compatibility, there must be
+- longjmp and siglongjmp symbols in libpthread.so; so we define them using
+- IFUNC to redirect to the libc function. */
++ longjmp and siglongjmp symbols in libpthread.so.
+
+-#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)
+-
+-# if HAVE_IFUNC
+-
+-# undef INIT_ARCH
+-# define INIT_ARCH()
+-# define DEFINE_LONGJMP(name) libc_ifunc (name, &__libc_longjmp)
+-
+-extern __typeof(longjmp) longjmp_ifunc;
+-extern __typeof(siglongjmp) siglongjmp_ifunc;
++ With an IFUNC resolver, it would be possible to avoid the indirection,
++ but the IFUNC resolver might run before the __libc_longjmp symbol has
++ been relocated, in which case the IFUNC resolver would not be able to
++ provide the correct address. */
+
+-# else /* !HAVE_IFUNC */
++#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)
+
+ static void __attribute__ ((noreturn, used))
+ longjmp_compat (jmp_buf env, int val)
+@@ -47,14 +40,10 @@ longjmp_compat (jmp_buf env, int val)
+ __libc_longjmp (env, val);
+ }
+
+-# define DEFINE_LONGJMP(name) strong_alias (longjmp_compat, name)
+-
+-# endif /* HAVE_IFUNC */
+-
+-DEFINE_LONGJMP (longjmp_ifunc)
+-compat_symbol (libpthread, longjmp_ifunc, longjmp, GLIBC_2_0);
++strong_alias (longjmp_compat, longjmp_alias)
++compat_symbol (libpthread, longjmp_alias, longjmp, GLIBC_2_0);
+
+-strong_alias (longjmp_ifunc, siglongjmp_ifunc)
+-compat_symbol (libpthread, siglongjmp_ifunc, siglongjmp, GLIBC_2_0);
++strong_alias (longjmp_alias, siglongjmp_alias)
++compat_symbol (libpthread, siglongjmp_alias, siglongjmp, GLIBC_2_0);
+
+ #endif
+diff --git a/nptl/pt-system.c b/nptl/pt-system.c
+index f8ca6ba..b30ddf2 100644
+--- a/nptl/pt-system.c
++++ b/nptl/pt-system.c
+@@ -25,29 +25,21 @@
+ libpthread, but the historical ABI requires it. For static linking,
+ there is no need to provide anything here--the libc version will be
+ linked in. For shared library ABI compatibility, there must be a
+- 'system' symbol in libpthread.so; so we define it using IFUNC to
+- redirect to the libc function. */
++ 'system' symbol in libpthread.so.
+
+-#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)
+-
+-# if HAVE_IFUNC
+-
+-extern __typeof(system) system_ifunc;
+-# undef INIT_ARCH
+-# define INIT_ARCH()
+-libc_ifunc (system_ifunc, &__libc_system)
++ With an IFUNC resolver, it would be possible to avoid the indirection,
++ but the IFUNC resolver might run before the __libc_system symbol has
++ been relocated, in which case the IFUNC resolver would not be able to
++ provide the correct address. */
+
+-# else /* !HAVE_IFUNC */
++#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)
+
+ static int __attribute__ ((used))
+ system_compat (const char *line)
+ {
+ return __libc_system (line);
+ }
+-strong_alias (system_compat, system_ifunc)
+-
+-# endif /* HAVE_IFUNC */
+-
+-compat_symbol (libpthread, system_ifunc, system, GLIBC_2_0);
++strong_alias (system_compat, system_alias)
++compat_symbol (libpthread, system_alias, system, GLIBC_2_0);
+
+ #endif
+--
+2.9.3
+



  • [SM-Commit] GIT changes to master grimoire by Thomas Orgis (796e1c0bf020456d45995dc7505049d844155942), Thomas Orgis, 09/27/2017

Archive powered by MHonArc 2.6.24.

Top of Page