Skip to contentSkip to conversation

tools: Fix default target compile tools in Python tools

PATCH In review Alper Nebi Yasak 2 participants 2 messages Jun 7, 2021 – Jul 4, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: Fix default target compile tools in Python tools

In commit 1e4687aa47ed ("binman: Use target-specific tools when cross-compiling"), a utility function was implemented to get preferred compilation tools using environment variables like CC and CROSS_COMPILE. Although it intended to provide custom default tools (same as those in the global Makefile) when no relevant variables were set (for example using "gcc" for "cc"), it is only doing so when CROSS_COMPILE is set and returning the literal name of the tool otherwise.

Remove the check for an empty CROSS_COMPILE, which makes the function use it as an empty prefix to the custom defaults and return the intended executables.

Fixes 1e4687aa47ed ("binman: Use target-specific tools when cross-compiling")

---

 tools/patman/tools.py | 2 --
 1 file changed, 2 deletions(-)
tools/patman/tools.py +0 -2
index e5f391b7aa9a..ec95a543bd92 100644
@@ -292,8 +292,6 @@ def GetTargetCompileTool(name, cross_compile=None):
 
     if cross_compile is None:
         cross_compile = env.get('CROSS_COMPILE', '')
-    if not cross_compile:
-        return name, []
 
     if name in ('as', 'ar', 'nm', 'ldr', 'strip', 'objcopy', 'objdump'):
         target_name = cross_compile + name
Signature · 1 line
2.32.0.rc2
#1 lore raw

In commit 1e4687aa47ed ("binman: Use target-specific tools when cross-compiling"), a utility function was implemented to get preferred compilation tools using environment variables like CC and CROSS_COMPILE. Although it intended to provide custom default tools (same as those in the global Makefile) when no relevant variables were set (for example using "gcc" for "cc"), it is only doing so when CROSS_COMPILE is set and returning the literal name of the tool otherwise.

Remove the check for an empty CROSS_COMPILE, which makes the function use it as an empty prefix to the custom defaults and return the intended executables.

Fixes 1e4687aa47ed ("binman: Use target-specific tools when cross-compiling")

---

 tools/patman/tools.py | 2 --
 1 file changed, 2 deletions(-)

Applied to u-boot-dm/next, thanks!