From 324856a3a4d29c18e993cfd9f10dd52e2d4d3c4b Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Sun, 16 Mar 2025 22:02:45 +0100 Subject: [PATCH] package/libopenssl do not build in parallel With highly parallel builds on a heavily loaded machine, the libopenssl build often (about half of the time) fails with spurious missing rules in its Makefile: >>> host-libopenssl 3.4.1 Installing to host directory [...] /usr/bin/make -C [...]/build/host-libopenssl-3.4.1 install "/usr/bin/make" depend && "/usr/bin/make" _build_libs "/usr/bin/make" depend && "/usr/bin/make" _build_modules "/usr/bin/make" depend && "/usr/bin/make" _build_programs [...] make[3]: *** No rule to make target '_build_modules'. Stop. make[2]: *** [Makefile:3159: build_modules] Error 2 make[2]: *** Waiting for unfinished jobs.... make[3]: Nothing to be done for '_build_programs'. make[3]: Nothing to be done for '_build_libs'. make[1]: *** [package/pkg-generic.mk:283: [...]/build/host-libopenssl-3.4.1/.stamp_host_installed] Error 2 make[1]: *** Waiting for unfinished jobs.... [...] make: *** [Makefile:23: _all] Error 2 Ideally, we'd like to fix the issue. However, the Nakefile is generated by the Configure script, written in perl, from the template in Configurations/unix-Makefile.tmpl, which also uses some kind of special (perl-related, probably) templating language. That makes it pretty difficult to see what is going on, though, and nigh impossible to fix without a deep understanding of the openssl buildsystem. So, we can only disable parallel builds until the issue is fixed upstream [0]. Add a comment to both build commands (host and target) to reference the upstream issue report. Note that the issue has mostly been observed in the build of the host variant so far, but there is no reason why it can't happen in the build of the target variant. [0] https://github.com/openssl/openssl/issues/27074 Signed-off-by: Yann E. MORIN Signed-off-by: Peter Korsgaard (cherry picked from commit 27ab880ebb9a3efdec15733841f7b88063604247) Signed-off-by: Peter Korsgaard --- package/libopenssl/libopenssl.mk | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/package/libopenssl/libopenssl.mk b/package/libopenssl/libopenssl.mk index c1c5b818d7..663e8d9b9f 100644 --- a/package/libopenssl/libopenssl.mk +++ b/package/libopenssl/libopenssl.mk @@ -132,24 +132,26 @@ endef LIBOPENSSL_POST_CONFIGURE_HOOKS += LIBOPENSSL_FIXUP_STATIC_MAKEFILE endif +# Parallel build broken: https://github.com/openssl/openssl/issues/27074 define HOST_LIBOPENSSL_BUILD_CMDS - $(HOST_MAKE_ENV) $(MAKE) -C $(@D) + $(HOST_MAKE_ENV) $(MAKE1) -C $(@D) endef +# Parallel build broken: https://github.com/openssl/openssl/issues/27074 define LIBOPENSSL_BUILD_CMDS - $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) + $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) endef define LIBOPENSSL_INSTALL_STAGING_CMDS - $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install + $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) DESTDIR=$(STAGING_DIR) install endef define HOST_LIBOPENSSL_INSTALL_CMDS - $(HOST_MAKE_ENV) $(MAKE) -C $(@D) install + $(HOST_MAKE_ENV) $(MAKE1) -C $(@D) install endef define LIBOPENSSL_INSTALL_TARGET_CMDS - $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install + $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) DESTDIR=$(TARGET_DIR) install $(RM) -rf $(TARGET_DIR)/usr/lib/ssl $(RM) -f $(TARGET_DIR)/usr/bin/c_rehash endef