Page MenuHome GnuPG

921_0001-fix-libgpg-error-lock-madness.patch
AbandonedPublic

Authored by musluser on Nov 26 2016, 4:02 PM.

Details

Reviewers
None
Summary

From 065f16768b0d790ae2d5b1b255f526f98d5a7802 Mon Sep 17 00:00:00 2001
From: rofl0r <retnyg@gmx.net>
Date: Sat, 26 Nov 2016 14:31:27 +0000
Subject: [PATCH] fix libgpg-error lock madness

libgpg-error has, for "portability" reasons, an utterly overdesigned
mutex implementation that basically does nothing more than calling the
pthread_mutex* functions, however it is designed in such a way that it
needs to know the size of phtread_mutex_t and other implementation details
of every arch/os/libc combination.

there's a hardcoded list for some archs (which is a bad idea if the
size of pthread_mutex_t on that arch changes), and any arch/libc
combination that is not yet in this list fails to compile.

according to the author this is by design[0], and you're supposed to
crosscompile a helper program and run that on your target computer
so it spits out a header that has the right values filled in.
this is a lunatic idea and completely unacceptable as we're trying
to do *automated* builds and not copying stuff around manually between
different machines.
there is an easy fix: just use the pthread primitives directly instead
of doing all the circus with the arch specific intermediate type.

[0] https://bugs.gnupg.org/gnupg/issue2845

src/mkheader.c | 6 ++
src/posix-lock.c | 192 ++++++-------------------------------------------------
2 files changed, 26 insertions(+), 172 deletions(-)

2.10.2

Test Plan

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped