[gentoo-commits] gentoo-x86 commit in dev-libs/openssl/files: openssl-1.0.2a-parallel-symlinking.patch

2015-07-10 Thread Mike Frysinger (vapier)
vapier  15/07/10 06:07:51

  Modified: openssl-1.0.2a-parallel-symlinking.patch
  Log:
  add upstream link

Revision  ChangesPath
1.2  
dev-libs/openssl/files/openssl-1.0.2a-parallel-symlinking.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/openssl/files/openssl-1.0.2a-parallel-symlinking.patch?rev=1.2view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/openssl/files/openssl-1.0.2a-parallel-symlinking.patch?rev=1.2content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/openssl/files/openssl-1.0.2a-parallel-symlinking.patch?r1=1.1r2=1.2

Index: openssl-1.0.2a-parallel-symlinking.patch
===
RCS file: 
/var/cvsroot/gentoo-x86/dev-libs/openssl/files/openssl-1.0.2a-parallel-symlinking.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- openssl-1.0.2a-parallel-symlinking.patch3 Apr 2015 05:44:45 -   
1.1
+++ openssl-1.0.2a-parallel-symlinking.patch10 Jul 2015 06:07:51 -  
1.2
@@ -1,3 +1,5 @@
+https://rt.openssl.org/Ticket/Display.html?id=3780user=guestpass=guest
+
 From cc81af135bda47eaa6956a0329cbbc55bf993ac1 Mon Sep 17 00:00:00 2001
 From: Mike Frysinger vap...@gentoo.org
 Date: Fri, 3 Apr 2015 01:16:23 -0400






[gentoo-commits] gentoo-x86 commit in dev-libs/openssl/files: openssl-1.0.2a-parallel-symlinking.patch

2015-04-02 Thread Mike Frysinger (vapier)
vapier  15/04/03 05:44:45

  Added:openssl-1.0.2a-parallel-symlinking.patch
  Log:
  Fix parallel build wrt symlinking of generated libs #545028 by Martin von 
Gagern.
  
  (Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key 
D2E96200)

Revision  ChangesPath
1.1  
dev-libs/openssl/files/openssl-1.0.2a-parallel-symlinking.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/openssl/files/openssl-1.0.2a-parallel-symlinking.patch?rev=1.1view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/openssl/files/openssl-1.0.2a-parallel-symlinking.patch?rev=1.1content-type=text/plain

Index: openssl-1.0.2a-parallel-symlinking.patch
===
From cc81af135bda47eaa6956a0329cbbc55bf993ac1 Mon Sep 17 00:00:00 2001
From: Mike Frysinger vap...@gentoo.org
Date: Fri, 3 Apr 2015 01:16:23 -0400
Subject: [PATCH] fix race when symlink shareds libs

When the crypto/ssl targets attempt to build their shared libs, they run:
cd ..; make libcrypto.so.1.0.0
The top level Makefile in turn runs the build-shared target for that lib.

The build-shared target depends on both do_$(SHLIB_TARGET)  link-shared.
When building in parallel, make is allowed to run both of these.  They
both run Makefile.shared for their respective targets:
do_$(SHLIB_TARGET) -
link_a.linux-shared -
link_a.gnu -
...; $(LINK_SO_A) -
$(LINK_SO) -
$(SYMLINK_SO)
link-shared -
symlink.linux-shared -
symlink.gnu -
...; $(SYMLINK_SO)

The shell code for SYMLINK_SO attempts to do a [ -e lib ] check, but fails
basic TOCTOU semantics.  Depending on the load, that means two processes
will run the sequence:
rm -f libcrypto.so
ln -s libcrypto.so.1.0.0 libcrypto.so

Which obviously fails:
ln: failed to create symbolic link 'libcrypto.so': File exists

Since we know do_$(SHLIB_TARGET) will create the symlink for us, don't
bother depending on link-shared at all in the top level Makefile when
building things.

Reported-by: Martin von Gagern martin.vgag...@gmx.net
URL: https://bugs.gentoo.org/545028
---
 Makefile.org | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Makefile.org b/Makefile.org
index 890bfe4..576c60e 100644
--- a/Makefile.org
+++ b/Makefile.org
@@ -350,7 +350,10 @@ link-shared:
libs=$$libs -l$$i; \
done
 
-build-shared: do_$(SHLIB_TARGET) link-shared
+# The link target in Makefile.shared will create the symlink for us, so no need
+# to call link-shared directly.  Doing so will cause races with two processes
+# trying to symlink the lib.
+build-shared: do_$(SHLIB_TARGET)
 
 do_$(SHLIB_TARGET):
@ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \
-- 
2.3.4