Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 545028 - dev-libs/openssl-1.0.2a: parallel build issue: ln: failed to create symbolic link ‘libssl.so’: File exists
Summary: dev-libs/openssl-1.0.2a: parallel build issue: ln: failed to create symbolic ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-30 07:39 UTC by Martin von Gagern
Modified: 2015-04-03 05:44 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (dev-libs:openssl-1.0.2a:20150330-065630.log,509.20 KB, text/plain)
2015-03-30 07:39 UTC, Martin von Gagern
Details
emerge --info (dev-libs:openssl-1.0.2a.emerge--info,9.00 KB, text/plain)
2015-03-30 07:39 UTC, Martin von Gagern
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2015-03-30 07:39:04 UTC
Created attachment 400124 [details]
build log

After switching from 32-bit emul packages to abi_x86_32, the openssl rebuild failed since apparently some target got built twice in parallel. A second attempt with MAKEOPTS=-j1 succeeded.

make[4]: Entering directory '/var/tmp/portage/dev-libs/openssl-1.0.2a/work/opens
sl-1.0.2a-abi_x86_32.x86'
+ rm -f libssl.so
+ rm -f libssl.so
+ ln -s libssl.so.1.0.0 libssl.so
+ ln -s libssl.so.1.0.0 libssl.so
make[4]: Leaving directory '/var/tmp/portage/dev-libs/openssl-1.0.2a/work/openss
l-1.0.2a-abi_x86_32.x86'
ln: failed to create symbolic link ‘libssl.so’: File exists
Makefile.shared:171: recipe for target 'link_a.gnu' failed
make[4]: *** [link_a.gnu] Error 1
make[4]: Leaving directory '/var/tmp/portage/dev-libs/openssl-1.0.2a/work/openss
l-1.0.2a-abi_x86_32.x86'
Makefile:352: recipe for target 'do_linux-shared' failed
make[3]: *** [do_linux-shared] Error 2
make[3]: Leaving directory '/var/tmp/portage/dev-libs/openssl-1.0.2a/work/openss
l-1.0.2a-abi_x86_32.x86'
Makefile:319: recipe for target 'libssl.so.1.0.0' failed
make[2]: *** [libssl.so.1.0.0] Error 2
Comment 1 Martin von Gagern 2015-03-30 07:39:25 UTC
Created attachment 400126 [details]
emerge --info
Comment 2 SpanKY gentoo-dev 2015-04-03 03:47:50 UTC
does this fail frequently ?  it'd help if you could add -O to your MAKEOPTS in general, and if you could post a log with that ...
Comment 3 SpanKY gentoo-dev 2015-04-03 05:04:52 UTC
nm, found the race.  affects both crypto & ssl due to the way the targets work.

- top level runs `make all`
- all triggers build_crypto
- build in crypto/ generates libcrypto.a and then hits "shared" target
- crypto/Makefile "shared" does `cd ..; make libcrypto.so.1.0.0`
- top level libcrypto.so.1.0.0 runs `make SHLIBDIRS=crypto build-shared`
- build-shared depends on do_$(SHLIB_TARGET) & link-shared
... now we hit the start of the race ...

job 1:
- do_$(SHLIB_TARGET) runs `make -f Makefile.shared link_a.$(SHLIB_TARGET)` for libcrypto (where SHLIB_TARGET=linux-shared)
- link_a.linux-shared turns into link_a.gnu which does:
  $(DO_GNU_SO); $(LINK_SO_A)
- LINK_SO_A calls $(LINK_SO)
- LINK_SO calls $(SYMLINK_SO)

job 2:
- link-shared runs `make -f Makefile.shared symlink.$(SHLIB_TARGET)` for libcrypto (where SHLIB_TARGET=linux-shared)
- symlink.linux-shared turns into symlink.gnu which does:
  ...; $(SYMLINK_SO)

so these two jobs are both calling SYMLINK_SO.  fun times.
Comment 4 SpanKY gentoo-dev 2015-04-03 05:44:50 UTC
should be all set now in the tree; thanks for the report!

Commit message: Fix parallel build wrt symlinking of generated libs
http://sources.gentoo.org/dev-libs/openssl/files/openssl-1.0.2a-parallel-symlinking.patch?rev=1.1
http://sources.gentoo.org/dev-libs/openssl/openssl-1.0.2a.ebuild?r1=1.8&r2=1.9