Skip to contentSkip to conversation

Default to HOSTARCH if ARCH isn't specified

PATCH New Kumar Gala 4 participants 4 messages Apr 20, 2009 Kbuild

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/1 Default to HOSTARCH if ARCH isn't specified

Its possible to build natively on several platforms so we might not explicitly set ARCH but detect it via HOSTARCH. As such there are some things that expect ARCH to be set to work correctly.

---
 Makefile |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
Makefile +4 -0
index e91c051..c56d6db 100644
@@ -137,6 +137,10 @@ ifeq ($(ARCH),powerpc)
 ARCH = ppc
 endif
 
+ifndef ARCH
+ARCH = $(HOSTARCH)
+endif
+
 ifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk))
 
 # load ARCH, BOARD, and CPU configuration
Signature · 1 line
1.6.0.6
#2 lore raw

PATCH 1/1 Default to HOSTARCH if ARCH isn't specified

In reply to Kumar Gala

Dear Kumar Gala,

Quoted 14 lines · In message <[email protected]> you…

Its possible to build natively on several platforms so we might not explicitly set ARCH but detect it via HOSTARCH. As such there are some things that expect ARCH to be set to work correctly.

---
 Makefile |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
Makefile +0 -0
index e91c051..c56d6db 100644

Makefile ifeq ($(ARCH),powerpc) · line 143

Quoted 7 lines
Makefile +4 -0
@@ -137,6 +137,10 @@ ifeq ($(ARCH),powerpc)
 ARCH = ppc
 endif
 
+ifndef ARCH
+ARCH = $(HOSTARCH)
+endif
+

In current mainline U-Boot, such a patch is not needed (which is just a friendly version of saying it does not make sense :-), because ARCH gets loaded from include/config.mk after running "make <board>_config".

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"I used to think that the brain was the most wonderful  organ  in  my
body. Then I realized who was telling me this."        - Emo Phillips
#3 lore raw

PATCH 1/1 Default to HOSTARCH if ARCH isn't specified

Quoted 11 lines · Wolfgang Denk

Dear Kumar Gala,

Quoted 8 lines · In message <[email protected]> you…
Makefile +0 -0
index e91c051..c56d6db 100644
@@ -137,6 +137,10 @@ ifeq ($(ARCH),powerpc)
 ARCH = ppc
 endif
 
Quoted 8 lines

Makefile ifeq ($(ARCH),powerpc) · line 143

Quoted 4 lines
Makefile +4 -0
+ifndef ARCH
+ARCH = $(HOSTARCH)
+endif
+

In current mainline U-Boot, such a patch is not needed (which is just a friendly version of saying it does not make sense :-), because ARCH gets loaded from include/config.mk after running "make <board>_config".

In which case, we should probably add "override" to the place where it is set, so as to avoid interference from any ARCH variable that might be set (we could then remove the powerpc->ppc bit).

-Scott