[openssl-dev] [openssl.org #3905] AutoReply: Bug report: segfault while cleaning up in libgost

bug-reporting0000@cneufeld.ca via RT rt at openssl.org
Sat Jun 20 19:34:01 UTC 2015


Just to finish off this thread, I've got a small patch that aims to prevent
issues with parallel builds.

Now, the openssl Makefile hides the $(MAKE) variable in another variable
expansion, which means that the jobserver can't tell that there are
submakes in the subdir rules, so those submakes are invoked with -j1,
meaning that each subdirectory itself is serially compiled.  However, the
toplevel Makefile as it exists in 1.0.2b allows the parallel invocation of
several of these submakes.  So, running "make -j8" will invoke a serial
compilation in each of the directories crypto, ssl, engines, apps, test,
and tools.  The problem is that some of these subdirectories call back to
the toplevel and ask it to build one of the other directories.  So, for
instance, engines depends on crypto, but rather than making the dependency
explicit in the toplevel Makefile, engines calls its own make on the
../crypto directory.  Now you've got two independent makes running in
crypto, and havoc ensues.


This patch puts in some dependencies on the subdirectory builds and
prevents them from interfering with one another in this way when parallel
makes are run.  Note that it does not allow "make -j <NUM>" to build in
parallel, because of the issue I mentioned above relating to the $(MAKE)
variable, it simply prevents an imprudent -j invocation from corrupting the
build and producing bad libraries.


--- openssl-1.0.2b/Makefile.org 2015-06-11 09:50:11.000000000 -0400
+++ openssl-1.0.2b.PATCHED/Makefile.org 2015-06-20 15:24:44.000000000 -0400
@@ -280,11 +280,11 @@
        @dir=crypto; target=all; $(BUILD_ONE_CMD)
 build_ssl:
        @dir=ssl; target=all; $(BUILD_ONE_CMD)
-build_engines:
+build_engines: build_crypto
        @dir=engines; target=all; $(BUILD_ONE_CMD)
-build_apps:
+build_apps: build_crypto build_ssl build_engines
        @dir=apps; target=all; $(BUILD_ONE_CMD)
-build_tests:
+build_tests: build_crypto build_ssl
        @dir=test; target=all; $(BUILD_ONE_CMD)
 build_tools:
        @dir=tools; target=all; $(BUILD_ONE_CMD)


-- 
 Christopher Neufeld
 Home page:  http://www.cneufeld.ca/neufeld
 "Don't edit reality for the sake of simplicity"




More information about the openssl-dev mailing list