Skip to contentSkip to conversation

add host arch detection and Kconfig (BR2_HOSTARCH)

PATCH New Jean-Christophe PLAGNIOL-VILLARD 3 participants 11 messages Apr 17, 2012 – May 11, 2012 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 add host arch detection and Kconfig (BR2_HOSTARCH)

This will allow to install binary package only if they are supported by the host. As example Atmel SAM-BA (x86 only).

---
 Config.in |    4 ++++
 Makefile  |   10 ++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
Config.in +4 -0
index 68abb9b..be424b7 100644
@@ -10,6 +10,10 @@ config BR2_VERSION
 	string
 	option env="BR2_VERSION_FULL"
 
+config BR2_HOSTARCH
+	string
+	option env="HOSTARCH"
+
 source "target/Config.in.arch"
 
 menu "Build options"
Makefile +10 -0
index 3a09417..b14940b 100644
@@ -32,6 +32,16 @@ ifneq ($(firstword $(sort $(MAKE_VERSION) $(MIN_MAKE_VERSION))),$(MIN_MAKE_VERSI
 $(error You have make '$(MAKE_VERSION)' installed. GNU make >= $(MIN_MAKE_VERSION) is required)
 endif
 
+export HOSTARCH := $(shell uname -m | \
+	sed -e s/i.86/x86/ \
+	    -e s/sun4u/sparc64/ \
+	    -e s/arm.*/arm/ \
+	    -e s/sa110/arm/ \
+	    -e s/ppc64/powerpc/ \
+	    -e s/ppc/powerpc/ \
+	    -e s/macppc/powerpc/\
+	    -e s/sh.*/sh/)
+
 # This top-level Makefile can *not* be executed in parallel
 .NOTPARALLEL:
 
Signature · 1 line
1.7.9.1
#1 lore raw

PATCH 2/2 sam-ba: only propose it if the host is x86 or x86_64

As sam-ba is deliver as a binary for x86

---
 package/sam-ba/Config.in.host |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
package/sam-ba/Config.in.host +1 -0
index f2ea01f..20b2b36 100644
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_HOST_SAM_BA
 	bool "host sam-ba"
+	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
 	help
 	  Atmel SAM-BA software provides an open set of tools for
 	  programming the Atmel SAM3, SAM7 and SAM9 ARM-based
Signature · 1 line
1.7.9.1
#5 lore raw

PATCH 2/2 sam-ba: only propose it if the host is x86 or x86_64

Quoted 11 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 9 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 4 lines · Jean-Christophe PLAGNIOL-VILLARD

As sam-ba is deliver as a binary for x86

---

ping

ping

ping

it's the for ping

did I need to understand that noe one care of non x86 host?

Best Regards,
J.

#6 lore raw

PATCH 2/2 sam-ba: only propose it if the host is x86 or x86_64

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Jean-Christophe" == Jean-Christophe PLAGNIOL-VILLARD <[email protected]> writes:

Jean-Christophe> it's the for ping

Jean-Christophe> did I need to understand that noe one care of non x86 host?

To me it is more of a question of tradeoffs. Either we do it really right and use this kind of infrastructure for the external toolchains as well (where it really matters), or we decide the extra complexity isn't worth it for the few non-x86 users.

I haven't made up my mind about this yet, but am leaning towards the 2nd.

Signature · 1 line
Bye, Peter Korsgaard
#7 lore raw

PATCH 2/2 sam-ba: only propose it if the host is x86 or x86_64

Quoted 6 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Jean-Christophe" == Jean-Christophe PLAGNIOL-VILLARD <[email protected]> writes:

Jean-Christophe> it's the for ping

Jean-Christophe> did I need to understand that noe one care of non x86 host?

Quoted 7 lines

To me it is more of a question of tradeoffs. Either we do it really right and use this kind of infrastructure for the external toolchains as well (where it really matters), or we decide the extra complexity isn't worth it for the few non-x86 users.

I haven't made up my mind about this yet, but am leaning towards the 2nd.

as a non x86 user I really care

and as the ARM A15 will come soon on the market for serer as example it will be more and more problematic for binary package

Best Regards,
J.

Quoted 3 lines
Signature · 2 lines
-- 
Bye, Peter Korsgaard
#8 lore raw

PATCH 2/2 sam-ba: only propose it if the host is x86 or x86_64

Quoted 7 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 7 lines
Quoted 7 lines

Jean-Christophe> did I need to understand that noe one care of non x86 host?

To me it is more of a question of tradeoffs. Either we do it really right and use this kind of infrastructure for the external toolchains as well (where it really matters), or we decide the extra complexity isn't worth it for the few non-x86 users.

Quoted 6 lines
Quoted 2 lines
Quoted 2 lines

I haven't made up my mind about this yet, but am leaning towards the 2nd.

as a non x86 user I really care

and as the ARM A15 will come soon on the market for serer as example it will be more and more problematic for binary package

... except that it's not really problematic. The only problem is that you can
configure buildroot to download something that won't actually run on your system. This problem is a lot worse for external toolchains than for sam-ba.

That said, the patch is really simple and doesn't create a maintenance burden.
Having it in paves the way for disallowing other downloaded host binaries, and for downloading host binaries for the correct platform. Therefore:

Jean-Christophe, maybe it's worthwhile to resend and perhaps add
a patch for external toolchains as well?

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#9 lore raw

PATCH 1/2 add host arch detection and Kconfig (BR2_HOSTARCH)

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 31 lines · On Tuesday 17 April 2012 17:05:39 Jean-Christophe PLAGNIOL-VILLARD wrote:

This will allow to install binary package only if they are supported by the host. As example Atmel SAM-BA (x86 only).

---
 Config.in |    4 ++++
 Makefile  |   10 ++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
Config.in +4 -0
index 68abb9b..be424b7 100644
@@ -10,6 +10,10 @@ config BR2_VERSION
 	string
 	option env="BR2_VERSION_FULL"
 
+config BR2_HOSTARCH
+	string
+	option env="HOSTARCH"
+
 source "target/Config.in.arch"
 
 menu "Build options"
Makefile +0 -0
index 3a09417..b14940b 100644
@@ -32,6 +32,16 @@ ifneq ($(firstword $(sort $(MAKE_VERSION) $(MIN_MAKE_VERSION))),$(MIN_MAKE_VERSI
 $(error You have make '$(MAKE_VERSION)' installed. GNU make >= $(MIN_MAKE_VERSION) is required)
 endif

Makefile ifneq ($(firstword $(sort $(MAKE_VERSION) $(MIN_MAKE_VERSION))),$(MIN_MAKE_VERSI · line 43

Quoted 10 lines
Makefile +9 -0
 
+export HOSTARCH := $(shell uname -m | \
+	sed -e s/i.86/x86/ \
+	    -e s/sun4u/sparc64/ \
+	    -e s/arm.*/arm/ \
+	    -e s/sa110/arm/ \
+	    -e s/ppc64/powerpc/ \
+	    -e s/ppc/powerpc/ \
+	    -e s/macppc/powerpc/\
+	    -e s/sh.*/sh/)

If it's going to be any use, I guess we still need to be able to
distinguish arm/armeb and sh/sh64. But I don't know how these look in the uname.

Makefile ifneq ($(firstword $(sort $(MAKE_VERSION) $(MIN_MAKE_VERSION))),$(MIN_MAKE_VERSI · line 46

Quoted 3 lines
Makefile +1 -0
+
 # This top-level Makefile can *not* be executed in parallel
 .NOTPARALLEL:

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#10 lore raw

PATCH 1/2 add host arch detection and Kconfig (BR2_HOSTARCH)

Quoted 33 lines · Arnout Vandecappelle
Quoted 32 lines · On Tuesday 17 April 2012 17:05:39 Jean-Christophe PLAGNIOL-VILLARD wrote:

This will allow to install binary package only if they are supported by the host. As example Atmel SAM-BA (x86 only).

---
 Config.in |    4 ++++
 Makefile  |   10 ++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
Config.in +4 -0
index 68abb9b..be424b7 100644
@@ -10,6 +10,10 @@ config BR2_VERSION
 	string
 	option env="BR2_VERSION_FULL"
 
+config BR2_HOSTARCH
+	string
+	option env="HOSTARCH"
+
 source "target/Config.in.arch"
 
 menu "Build options"
Makefile +0 -0
index 3a09417..b14940b 100644
@@ -32,6 +32,16 @@ ifneq ($(firstword $(sort $(MAKE_VERSION) $(MIN_MAKE_VERSION))),$(MIN_MAKE_VERSI
 $(error You have make '$(MAKE_VERSION)' installed. GNU make >= $(MIN_MAKE_VERSION) is required)
 endif
 
Quoted 13 lines

Makefile ifneq ($(firstword $(sort $(MAKE_VERSION) $(MIN_MAKE_VERSION))),$(MIN_MAKE_VERSI · line 43

Quoted 9 lines
Makefile +9 -0
+export HOSTARCH := $(shell uname -m | \
+	sed -e s/i.86/x86/ \
+	    -e s/sun4u/sparc64/ \
+	    -e s/arm.*/arm/ \
+	    -e s/sa110/arm/ \
+	    -e s/ppc64/powerpc/ \
+	    -e s/ppc/powerpc/ \
+	    -e s/macppc/powerpc/\
+	    -e s/sh.*/sh/)

If it's going to be any use, I guess we still need to be able to
distinguish arm/armeb and sh/sh64. But I don't know how these look in the uname.

If you can found one sh64 board good luck I may have one somewhere but not even sure I can still found a sh64

for arme if you can found a board with enough power power to build something on it as big as buildroot

today the Cortex A15 and A9 are little endian

Best Regards,
J.