﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
7491	"Parallel make for ""openssl"" package"	yuksiy	bdubbs@…	"I suggest the following change 
in [http://www.linuxfromscratch.org/blfs/view/svn/postlfs/openssl.html BLFS 2016-03-02 ""OpenSSL-1.0.2g""].
[[br]]
(If there are any mistakes in my English, please correct them.)

In ""Installation of OpenSSL"":
{{{
+ Note 1
+ This package does not support parallel test.

+ Note 2
+ This package may install broken shared libraries during the install phase when using -jN. (N>=2)

-make test
+make -j1 test

-make MANDIR=/usr/share/man MANSUFFIX=ssl install &&
+make -j1 MANDIR=/usr/share/man MANSUFFIX=ssl install &&
}}}

The reasons are as follows.

== About addition of Note 1 and change to ""make -j1 test""

The command-line for test was written as ""make -j1 test""
in [http://www.linuxfromscratch.org/blfs/view/7.8/postlfs/openssl.html BLFS 7.8 ""OpenSSL-1.0.2d""],
[[br]]
But ""-j1"" was deleted in r16708.
[[br]]
Because the commit message does not mention this deletion, 
I don't understand the reason about this deletion.

But ""openssl-1.0.2g/PROBLEMS"" file describes as follows.
{{{
* Parallell make leads to errors
(snip)
The solution is simple for now: don't run parallell make when testing.
}}}

== About addition of Note 2 and change to ""make -j1 (snip) install""

I noticed accidentally once, but 
parallel install of the openssl package seems to cause the problem that 
installed shared libraries are often broken 
(= 0 bytes)
even if ""make -jN (snip) install (N>=2)"" finished with a status of zero.

The instruction to reproduce the symptom is as follows.
{{{
cd /sources

cat > openssl_build_1.sh << ""EOF""
cd /sources                    &&
rm -fr   openssl-1.0.2g        &&
tar -xvf openssl-1.0.2g.tar.gz &&
cd       openssl-1.0.2g        &&
./config --prefix=/usr         \
         --openssldir=/etc/ssl \
         --libdir=lib          \
         shared                \
         zlib-dynamic          &&
make -j4                       &&
make -j4 INSTALL_PREFIX=`pwd`/destdir MANDIR=/usr/share/man MANSUFFIX=ssl install \
  && echo ""NO ERROR"" \
  || echo ""ERROR""
ls -Al ./destdir/usr/lib/*.so.*
EOF

sh openssl_build_1.sh
}}}

When I tried the instruction mentioned above, 
the problem occurred three of five times.
[[br]]
(See file size in TRY2, TRY4, TRY5.)
{{{
# TRY1
NO ERROR
-r-xr-xr-x 1 root root 2702392 Mar  3 18:43 ./destdir/usr/lib/libcrypto.so.1.0.0
-r-xr-xr-x 1 root root  516896 Mar  3 18:43 ./destdir/usr/lib/libssl.so.1.0.0

# TRY2
NO ERROR
-r-xr-xr-x 1 root root 2702392 Mar  3 18:46 ./destdir/usr/lib/libcrypto.so.1.0.0
-r-xr-xr-x 1 root root       0 Mar  3 18:46 ./destdir/usr/lib/libssl.so.1.0.0

# TRY3
NO ERROR
-r-xr-xr-x 1 root root 2696848 Mar  3 18:50 ./destdir/usr/lib/libcrypto.so.1.0.0
-r-xr-xr-x 1 root root  516896 Mar  3 18:50 ./destdir/usr/lib/libssl.so.1.0.0

# TRY4
NO ERROR
-r-xr-xr-x 1 root root 2702392 Mar  3 18:53 ./destdir/usr/lib/libcrypto.so.1.0.0
-r-xr-xr-x 1 root root       0 Mar  3 18:53 ./destdir/usr/lib/libssl.so.1.0.0

# TRY5
NO ERROR
-r-xr-xr-x 1 root root      0 Mar  3 18:55 ./destdir/usr/lib/libcrypto.so.1.0.0
-r-xr-xr-x 1 root root 516896 Mar  3 18:55 ./destdir/usr/lib/libssl.so.1.0.0
}}}

Then, I changed ""j4"" to ""j1"" and retried.
{{{
cat openssl_build_1.sh \
  | sed '/make -j4 INSTALL_PREFIX/ s,j4,j1,' \
  > openssl_build_2.sh

sh openssl_build_2.sh
}}}

When I tried the instruction mentioned above, 
no problem occurred at least within five times.
{{{
# TRY1
NO ERROR
-r-xr-xr-x 1 root root 2702392 Mar  3 19:06 ./destdir/usr/lib/libcrypto.so.1.0.0
-r-xr-xr-x 1 root root  516896 Mar  3 19:06 ./destdir/usr/lib/libssl.so.1.0.0

# TRY2
NO ERROR
-r-xr-xr-x 1 root root 2702392 Mar  3 19:09 ./destdir/usr/lib/libcrypto.so.1.0.0
-r-xr-xr-x 1 root root  516896 Mar  3 19:09 ./destdir/usr/lib/libssl.so.1.0.0

# TRY3
NO ERROR
-r-xr-xr-x 1 root root 2702392 Mar  3 19:11 ./destdir/usr/lib/libcrypto.so.1.0.0
-r-xr-xr-x 1 root root  516896 Mar  3 19:11 ./destdir/usr/lib/libssl.so.1.0.0

# TRY4
NO ERROR
-r-xr-xr-x 1 root root 2702392 Mar  3 19:13 ./destdir/usr/lib/libcrypto.so.1.0.0
-r-xr-xr-x 1 root root  516896 Mar  3 19:13 ./destdir/usr/lib/libssl.so.1.0.0

# TRY5
NO ERROR
-r-xr-xr-x 1 root root 2702392 Mar  3 19:16 ./destdir/usr/lib/libcrypto.so.1.0.0
-r-xr-xr-x 1 root root  516896 Mar  3 19:16 ./destdir/usr/lib/libssl.so.1.0.0
}}}
"	defect	closed	normal	7.10	BOOK	SVN	medium	fixed		yuk@…
