kyz / libmspack

A library for some loosely related Microsoft compression formats, CAB, CHM, HLP, LIT, KWAJ and SZDD.
https://www.cabextract.org.uk/libmspack/
169 stars 45 forks source link

Parallel build issue: error: cannot find the library 'libmschmd.la' or unhandled argument 'libmschmd.la' #19

Closed Whissi closed 6 years ago

Whissi commented 6 years ago

When compiling with make -j 4 or larger you sometimes hit a parallel make issue:

libtool: link: x86_64-pc-linux-gnu-ar cru .libs/libmscabd.a mspack/.libs/system.o mspack/.libs/cabd.o mspack/.libs/lzxd>
libtool:   error: cannot find the library 'libmschmd.la' or unhandled argument 'libmschmd.la'
libtool: link: x86_64-pc-linux-gnu-ranlib .libs/libmschmd.a
make[1]: *** [Makefile:836: test/chmd_test] Error 1

Doesn't happen with "-j1".

build.log.gz

kyz commented 6 years ago

Thanks for bringing it up. automake should generate parallel-safe Makefiles by default.

I think the issue is specifically with chmd_test, it is the only one with a _DEPENDENCIES setting, and I think that there's an implicit dependency on sources that gets lost when adding an explicit _DEPENDENCIES. I found that adding libmschmd.la to test_chmd_test_DEPENDENCIES fixes the issue. Could you confirm?

-test_chmd_test_DEPENDENCIES =  test/test_files/chmd/cve-2015-4467-reset-interval-zero.chm
+test_chmd_test_DEPENDENCIES =  libmschmd.la test/test_files/chmd/cve-2015-4467-reset-interval-zero.chm
Whissi commented 6 years ago

Yes, I can confirm that with this change I can build with make -j5.

kyz commented 6 years ago

I've fixed this in commit 43099fb, thanks for reporting it!