[packages/libxcrypt] Fix build with glibc >= 2.16 (patch from debian)

megabajt megabajt at pld-linux.org
Mon Feb 4 13:19:00 CET 2013


commit 475fb145024d97fcaf40cc71a0684e6ec36ba0c4
Author: Marcin Banasiak <marcin.banasiak at gmail.com>
Date:   Mon Feb 4 13:12:59 2013 +0100

    Fix build with glibc >= 2.16 (patch from debian)

 libxcrypt-libc-lock.patch | 40 ++++++++++++++++++++++++++++++++++++++++
 libxcrypt.spec            |  2 ++
 2 files changed, 42 insertions(+)
---
diff --git a/libxcrypt.spec b/libxcrypt.spec
index e1a4d9f..cc3357a 100644
--- a/libxcrypt.spec
+++ b/libxcrypt.spec
@@ -8,6 +8,7 @@ Group:		Libraries
 Source0:	ftp://ftp.suse.com/pub/people/kukuk/libxcrypt/%{name}-%{version}.tar.bz2
 # Source0-md5:	56cf4285086f26649b8792b53fe8b00f
 Patch0:		%{name}-noWerror.patch
+Patch1:		%{name}-libc-lock.patch
 BuildRequires:	sed >= 4.0
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -55,6 +56,7 @@ Ten pakiet zawiera statyczną wersję biblioteki libxcrypt.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 %configure \
diff --git a/libxcrypt-libc-lock.patch b/libxcrypt-libc-lock.patch
new file mode 100644
index 0000000..150ff99
--- /dev/null
+++ b/libxcrypt-libc-lock.patch
@@ -0,0 +1,40 @@
+diff -urN libxcrypt-3.0.2/src/crypt_util.c libxcrypt-3.0.2.new/src/crypt_util.c
+--- libxcrypt-3.0.2/src/crypt_util.c	2007-10-25 15:17:46.000000000 +0200
++++ libxcrypt-3.0.2.new/src/crypt_util.c	2013-02-04 12:45:20.560191479 +0100
+@@ -30,8 +30,7 @@
+ #endif
+ #include <string.h>
+ 
+-#include <bits/libc-lock.h>
+-#define __libc_lock_t pthread_mutex_t
++#include <pthread.h>
+ 
+ #ifndef STATIC
+ #define STATIC static
+@@ -265,7 +264,7 @@
+  */
+ struct crypt_data _ufc_foobar;
+ 
+-__libc_lock_define_initialized (static, _ufc_tables_lock)
++static pthread_mutex_t _ufc_tables_lock = PTHREAD_MUTEX_INITIALIZER;
+ 
+ #ifdef DEBUG
+ 
+@@ -362,7 +361,7 @@
+ #endif
+ 
+   if(small_tables_initialized == 0) {
+-    __libc_lock_lock (_ufc_tables_lock);
++    pthread_mutex_lock (&_ufc_tables_lock);
+     if(small_tables_initialized)
+       goto small_tables_done;
+ 
+@@ -471,7 +470,7 @@
+     }
+     small_tables_initialized = 1;
+ small_tables_done:
+-    __libc_lock_unlock(_ufc_tables_lock);
++    pthread_mutex_unlock (&_ufc_tables_lock);
+   }
+ 
+   /*
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libxcrypt.git/commitdiff/475fb145024d97fcaf40cc71a0684e6ec36ba0c4



More information about the pld-cvs-commit mailing list