Skip to contentSkip to conversation

core-dependencies: remove unneeded HOSTCC

PATCH New Arnout Vandecappelle (Essensium/Mind) 2 participants 3 messages Oct 22, 2017 – Jan 8, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 core-dependencies: remove unneeded HOSTCC

dependencies.sh uses HOSTCC_NOCCACHE directly, and this variable is exported from the top-level Makefile, so there is no need to pass HOSTCC to it. HOSTCC is not used at all in dependencies.sh.

Thus, we also no longer need to apply the HOSTCC override for core-dependencies. The core-depencies rule doesn't use HOSTCC or HOSTCXX.

---
 support/dependencies/dependencies.mk | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
support/dependencies/dependencies.mk +3 -4
index ef2ae9b7e1..80ba48a6a7 100644
@@ -19,12 +19,11 @@ DEPENDENCIES_HOST_PREREQ += host-ccache
 endif
 
 core-dependencies:
-	@HOSTCC="$(firstword $(HOSTCC))" MAKE="$(MAKE)" \
-		DL_TOOLS="$(sort $(DL_TOOLS_DEPENDENCIES))" \
+	@MAKE="$(MAKE)" DL_TOOLS="$(sort $(DL_TOOLS_DEPENDENCIES))" \
 		$(TOPDIR)/support/dependencies/dependencies.sh
 
-core-dependencies $(DEPENDENCIES_HOST_PREREQ): HOSTCC=$(HOSTCC_NOCCACHE)
-core-dependencies $(DEPENDENCIES_HOST_PREREQ): HOSTCXX=$(HOSTCXX_NOCCACHE)
+$(DEPENDENCIES_HOST_PREREQ): HOSTCC=$(HOSTCC_NOCCACHE)
+$(DEPENDENCIES_HOST_PREREQ): HOSTCXX=$(HOSTCXX_NOCCACHE)
 dependencies: core-dependencies $(DEPENDENCIES_HOST_PREREQ)
 
 ################################################################################
Signature · 1 line
2.15.0.rc1
#1 lore raw

PATCH 2/2 dependencies: correct dependencies for top-level parallel build

Commit 4932c8a7cc94277b3d53cecd935f725b91cfa9fe introduced the core-dependencies target to make sure that the dependencies.sh script runs before we attempt to compile any host tool, so that the absence of a compiler is properly detected. However, this relied on the left-to-right evaluation of dependencies. This will no longer be true when we enable top-level parallel build.

Fix this by letting DEPENDENCIES_HOST_PREREQ depend on core-dependencies.

Note that it is not possible to remove the
dependencies <- core-dependencies. Indeed, it is possible that DEPENDENCIES_HOST_PREREQ is completely empty, and in that case we still need to check core-dependencies.

---
 support/dependencies/dependencies.mk | 2 ++
 1 file changed, 2 insertions(+)
support/dependencies/dependencies.mk +2 -0
index 80ba48a6a7..4f606f849d 100644
@@ -24,6 +24,8 @@ core-dependencies:
 
 $(DEPENDENCIES_HOST_PREREQ): HOSTCC=$(HOSTCC_NOCCACHE)
 $(DEPENDENCIES_HOST_PREREQ): HOSTCXX=$(HOSTCXX_NOCCACHE)
+$(DEPENDENCIES_HOST_PREREQ): core-dependencies
+
 dependencies: core-dependencies $(DEPENDENCIES_HOST_PREREQ)
 
 ################################################################################
Signature · 1 line
2.15.0.rc1
#2 lore raw

PATCH 1/2 core-dependencies: remove unneeded HOSTCC

In reply to Arnout Vandecappelle (Essensium/Mind)

Hello,

Quoted 4 lines · Arnout Vandecappelle (Essensium/Mind)

dependencies.sh uses HOSTCC_NOCCACHE directly, and this variable is exported from the top-level Makefile, so there is no need to pass HOSTCC to it. HOSTCC is not used at all in dependencies.sh.

Quoted 8 lines

Thus, we also no longer need to apply the HOSTCC override for core-dependencies. The core-depencies rule doesn't use HOSTCC or HOSTCXX.

---
 support/dependencies/dependencies.mk | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Both patches applied. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com