Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v5 1/7] arch: toolchain: Introduce binary formats BINFMT_*.
@ 2013-04-12 10:18 Sonic Zhang
  2013-04-12 10:18 ` [Buildroot] [PATCH v5 2/7] arch: Add blackfin CPU choice Sonic Zhang
                   ` (6 more replies)
  0 siblings, 7 replies; 23+ messages in thread
From: Sonic Zhang @ 2013-04-12 10:18 UTC (permalink / raw)
  To: buildroot

From: Sonic Zhang <sonic.zhang@analog.com>

Just introduce the symbol and options in arch generic Config.in.
Append FLAT format link flags to external toolchain wrapper.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>

---

v3-changes:
- Rename the BINFMT dependency names in external toolchain config file.
- Add some help text to BINFMT macros.
---
 arch/Config.in                                     |   34 ++++++++++++++++++++
 toolchain/toolchain-external/Config.in             |   12 +++---
 toolchain/toolchain-external/ext-tool.mk           |    4 ++
 .../toolchain-external/ext-toolchain-wrapper.c     |    3 ++
 4 files changed, 47 insertions(+), 6 deletions(-)

diff --git a/arch/Config.in b/arch/Config.in
index 472b10c..2a14c29 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -174,6 +174,40 @@ config BR2_GCC_TARGET_ABI
 config BR2_GCC_TARGET_CPU
 	string
 
+# Set up target binary format
+choice
+	prompt "Target Binary Format"
+	default BR2_BINFMT_FDPIC if BR2_bfin
+	default BR2_BINFMT_ELF
+
+config BR2_BINFMT_ELF
+	bool "ELF"
+	depends on !BR2_bfin
+	help
+	  ELF (Executable and Linkable Format) is a format for libraries and
+	  executables used across different architectures and operating
+	  systems.
+
+config BR2_BINFMT_FDPIC
+	bool "FDPIC"
+	depends on BR2_bfin
+	help
+	  ELF FDPIC binaries are based on ELF, but allow the individual load
+	  segments of a binary to be located in memory independently of each
+	  other. This makes this format ideal for use in environments where no
+	  MMU is available.
+
+config BR2_BINFMT_FLAT
+	bool "FLAT"
+	depends on BR2_bfin
+	select BR2_PREFER_STATIC_LIB
+	help
+	  FLAT binary is a relatively simple and lightweight executable format
+	  based on the original a.out format. It is widely used in environment
+	  where no MMU is available.
+
+endchoice
+
 if BR2_arm || BR2_armeb
 source "arch/Config.in.arm"
 endif
diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index 5b26aa9..6cf29aa 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -758,12 +758,12 @@ config BR2_TOOLCHAIN_EXTERNAL_PREFIX
 	default "i686-pc-linux-gnu"	 if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_X86_201109
 	default "i686-pc-linux-gnu"	 if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_X86_201203
 	default "i686-pc-linux-gnu"	 if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_X86_201209
-	default "bfin-uclinux"		 if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2011R1 && !BR2_BFIN_FDPIC
-	default "bfin-linux-uclibc"	 if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2011R1 && BR2_BFIN_FDPIC
-	default "bfin-uclinux"		 if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R1 && !BR2_BFIN_FDPIC
-	default "bfin-linux-uclibc"	 if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R1 && BR2_BFIN_FDPIC
-	default "bfin-uclinux"		 if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R2 && !BR2_BFIN_FDPIC
-	default "bfin-linux-uclibc"	 if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R2 && BR2_BFIN_FDPIC
+	default "bfin-uclinux"		 if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2011R1 && BR2_BINFMT_FLAT
+	default "bfin-linux-uclibc"	 if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2011R1 && BR2_BINFMT_FDPIC
+	default "bfin-uclinux"		 if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R1 && BR2_BINFMT_FLAT
+	default "bfin-linux-uclibc"	 if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R1 && BR2_BINFMT_FDPIC
+	default "bfin-uclinux"		 if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R2 && BR2_BINFMT_FLAT
+	default "bfin-linux-uclibc"	 if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R2 && BR2_BINFMT_FDPIC
 	default $(BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX) \
 					 if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
 
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index b477bc0..92183a4 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -160,6 +160,10 @@ ifneq ($(CC_TARGET_ABI_),)
 TOOLCHAIN_EXTERNAL_CFLAGS += -mabi=$(CC_TARGET_ABI_)
 TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_ABI='"$(CC_TARGET_ABI_)"'
 endif
+ifeq ($(BR2_BINFMT_FLAT),y)
+TOOLCHAIN_EXTERNAL_CFLAGS += -Wl,-elf2flt
+TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_BINFMT_FLAT
+endif
 
 ifneq ($(BR2_TARGET_OPTIMIZATION),)
 TOOLCHAIN_EXTERNAL_CFLAGS += $(call qstrip,$(BR2_TARGET_OPTIMIZATION))
diff --git a/toolchain/toolchain-external/ext-toolchain-wrapper.c b/toolchain/toolchain-external/ext-toolchain-wrapper.c
index a92bada..9a2fc70 100644
--- a/toolchain/toolchain-external/ext-toolchain-wrapper.c
+++ b/toolchain/toolchain-external/ext-toolchain-wrapper.c
@@ -47,6 +47,9 @@ static char *predef_args[] = {
 #ifdef BR_64
 	"-m64",
 #endif
+#ifdef BR_BINFMT_FLAT
+	"-Wl,-elf2flt",
+#endif
 #ifdef BR_ADDITIONAL_CFLAGS
 	BR_ADDITIONAL_CFLAGS
 #endif
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 2/7] arch: Add blackfin CPU choice.
  2013-04-12 10:18 [Buildroot] [PATCH v5 1/7] arch: toolchain: Introduce binary formats BINFMT_* Sonic Zhang
@ 2013-04-12 10:18 ` Sonic Zhang
  2013-04-16 18:52   ` Thomas Petazzoni
  2013-04-12 10:18 ` [Buildroot] [PATCH v5 3/7] arch: toolchain: Introduce target CPU revision Sonic Zhang
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 23+ messages in thread
From: Sonic Zhang @ 2013-04-12 10:18 UTC (permalink / raw)
  To: buildroot

From: Sonic Zhang <sonic.zhang@analog.com>

is patch adds a Target CPU configuration option and uses it to select a -m
option for gcc.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 arch/Config.in.bfin |   97 +++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 90 insertions(+), 7 deletions(-)

diff --git a/arch/Config.in.bfin b/arch/Config.in.bfin
index 0b137ae..ac96620 100644
--- a/arch/Config.in.bfin
+++ b/arch/Config.in.bfin
@@ -1,12 +1,65 @@
 choice
-	prompt "Target ABI"
+	prompt "Target CPU"
 	depends on BR2_bfin
-	default BR2_BFIN_FDPIC
-config BR2_BFIN_FDPIC
-	bool "FDPIC"
-config BR2_BFIN_FLAT
-	bool "FLAT"
-	select BR2_PREFER_STATIC_LIB
+	default BR2_bf609
+	help
+	  Specify target CPU
+config BR2_bf606
+	bool "bf606"
+config BR2_bf607
+	bool "bf607"
+config BR2_bf608
+	bool "bf608"
+config BR2_bf609
+	bool "bf609"
+config BR2_bf512
+	bool "bf512"
+config BR2_bf514
+	bool "bf514"
+config BR2_bf516
+	bool "bf516"
+config BR2_bf518
+	bool "bf518"
+config BR2_bf522
+	bool "bf522"
+config BR2_bf523
+	bool "bf523"
+config BR2_bf524
+	bool "bf524"
+config BR2_bf525
+	bool "bf525"
+config BR2_bf526
+	bool "bf526"
+config BR2_bf527
+	bool "bf527"
+config BR2_bf531
+	bool "bf531"
+config BR2_bf532
+	bool "bf532"
+config BR2_bf533
+	bool "bf533"
+config BR2_bf534
+	bool "bf534"
+config BR2_bf536
+	bool "bf536"
+config BR2_bf537
+	bool "bf537"
+config BR2_bf538
+	bool "bf538"
+config BR2_bf539
+	bool "bf539"
+config BR2_bf542
+	bool "bf542"
+config BR2_bf544
+	bool "bf544"
+config BR2_bf547
+	bool "bf547"
+config BR2_bf548
+	bool "bf548"
+config BR2_bf549
+	bool "bf549"
+config BR2_bf561
+	bool "bf561"
 endchoice
 
 config BR2_ARCH
@@ -14,3 +67,33 @@ config BR2_ARCH
 
 config BR2_ENDIAN
         default "LITTLE"
+
+config BR2_GCC_TARGET_CPU
+	default bf606		if BR2_bf606
+	default bf607		if BR2_bf607
+	default bf608		if BR2_bf608
+	default bf609		if BR2_bf609
+	default bf512		if BR2_bf512
+	default bf514		if BR2_bf514
+	default bf516		if BR2_bf516
+	default bf518		if BR2_bf518
+	default bf522		if BR2_bf522
+	default bf523		if BR2_bf523
+	default bf524		if BR2_bf524
+	default bf525		if BR2_bf525
+	default bf526		if BR2_bf526
+	default bf527		if BR2_bf527
+	default bf531		if BR2_bf531
+	default bf532		if BR2_bf532
+	default bf533		if BR2_bf533
+	default bf534		if BR2_bf534
+	default bf536		if BR2_bf536
+	default bf537		if BR2_bf537
+	default bf538		if BR2_bf538
+	default bf539		if BR2_bf539
+	default bf542		if BR2_bf542
+	default bf544		if BR2_bf544
+	default bf547		if BR2_bf547
+	default bf548		if BR2_bf548
+	default bf549		if BR2_bf549
+	default bf561		if BR2_bf561
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 3/7] arch: toolchain: Introduce target CPU revision.
  2013-04-12 10:18 [Buildroot] [PATCH v5 1/7] arch: toolchain: Introduce binary formats BINFMT_* Sonic Zhang
  2013-04-12 10:18 ` [Buildroot] [PATCH v5 2/7] arch: Add blackfin CPU choice Sonic Zhang
@ 2013-04-12 10:18 ` Sonic Zhang
  2013-04-16 21:20   ` Thomas Petazzoni
  2013-04-12 10:18 ` [Buildroot] [PATCH v5 4/7] arch: toolchain: Introduce binary format FLAT types Sonic Zhang
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 23+ messages in thread
From: Sonic Zhang @ 2013-04-12 10:18 UTC (permalink / raw)
  To: buildroot

From: Sonic Zhang <sonic.zhang@analog.com>

Adds the possibility to have a free-form CPU revision string and append it
to the target CPU. Only Blackfin actually uses this option.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>

---

v3-changes:
- Detail the help text and fix the line length.
---
 arch/Config.in                           |    3 +++
 arch/Config.in.bfin                      |    8 ++++++++
 toolchain/toolchain-external/ext-tool.mk |    4 ++++
 3 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/arch/Config.in b/arch/Config.in
index 2a14c29..047abc1 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -174,6 +174,9 @@ config BR2_GCC_TARGET_ABI
 config BR2_GCC_TARGET_CPU
 	string
 
+config BR2_GCC_TARGET_CPU_REVISION
+	string
+
 # Set up target binary format
 choice
 	prompt "Target Binary Format"
diff --git a/arch/Config.in.bfin b/arch/Config.in.bfin
index ac96620..f755c8d 100644
--- a/arch/Config.in.bfin
+++ b/arch/Config.in.bfin
@@ -97,3 +97,11 @@ config BR2_GCC_TARGET_CPU
 	default bf548		if BR2_bf548
 	default bf549		if BR2_bf549
 	default bf561		if BR2_bf561
+
+config BR2_GCC_TARGET_CPU_REVISION
+	string "Target CPU revision"
+	help
+	  Specify a target CPU revision, which will be appended to the
+	  value of the -mcpu option. For example, if the selected CPU is
+	  bf609, and then selected CPU revision is "0.0", then gcc will
+	  receive the -mcpu=bf609-0.0 option.
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index 92183a4..27fd296 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -134,7 +134,11 @@ TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += \
 endif
 
 CC_TARGET_TUNE_:=$(call qstrip,$(BR2_GCC_TARGET_TUNE))
+ifeq ($(BR2_GCC_TARGET_CPU_REVISION),)
 CC_TARGET_CPU_:=$(call qstrip,$(BR2_GCC_TARGET_CPU))
+else
+CC_TARGET_CPU_:=$(call qstrip,$(BR2_GCC_TARGET_CPU)-$(BR2_GCC_TARGET_CPU_REVISION))
+endif
 CC_TARGET_ARCH_:=$(call qstrip,$(BR2_GCC_TARGET_ARCH))
 CC_TARGET_ABI_:=$(call qstrip,$(BR2_GCC_TARGET_ABI))
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 4/7] arch: toolchain: Introduce binary format FLAT types.
  2013-04-12 10:18 [Buildroot] [PATCH v5 1/7] arch: toolchain: Introduce binary formats BINFMT_* Sonic Zhang
  2013-04-12 10:18 ` [Buildroot] [PATCH v5 2/7] arch: Add blackfin CPU choice Sonic Zhang
  2013-04-12 10:18 ` [Buildroot] [PATCH v5 3/7] arch: toolchain: Introduce target CPU revision Sonic Zhang
@ 2013-04-12 10:18 ` Sonic Zhang
  2013-04-12 10:18 ` [Buildroot] [PATCH v5 5/7] package: Introduce package-specific BINFMT_FLAT options Sonic Zhang
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 23+ messages in thread
From: Sonic Zhang @ 2013-04-12 10:18 UTC (permalink / raw)
  To: buildroot

From: Sonic Zhang <sonic.zhang@analog.com>

Just introduce the symbol and options in arch generic Config.in.
Add FLAT types specific compiling flags into package makefile.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>

---

v5-change:
- Move FLAT types specific compiling flags back to package makefile.
The flags can't be set to compile Linux kernel.

v3-changes:
- Add dependancy to bfin and m68k
- Add help text for FLAT binary types.
- Split shared flat flags.
---
 arch/Config.in      |   26 ++++++++++++++++++++++++++
 package/Makefile.in |   11 +++++++++++
 2 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/arch/Config.in b/arch/Config.in
index 047abc1..255b8b0 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -211,6 +211,32 @@ config BR2_BINFMT_FLAT
 
 endchoice
 
+# Set up flat binary type
+choice
+	prompt "FLAT Binary type"
+	depends on BR2_BINFMT_FLAT
+	default BR2_BINFMT_FLAT_ONE
+
+config BR2_BINFMT_FLAT_ONE
+	bool "One memory region"
+	help
+	  All segments are linked into one memory region.
+
+config BR2_BINFMT_FLAT_SEP_DATA
+	bool "Separate data and code region"
+	depends on BR2_bfin || BR2_m68k
+	help
+	  Allow for the data and text segments to be separated and placed in
+	  different regions of memory.
+
+config BR2_BINFMT_FLAT_SHARED
+	bool "Shared binary"
+	depends on BR2_bfin || BR2_m68k
+	help
+	  Allow to load and link indiviual FLAT binaries at run time.
+
+endchoice
+
 if BR2_arm || BR2_armeb
 source "arch/Config.in.arm"
 endif
diff --git a/package/Makefile.in b/package/Makefile.in
index a8bf36b..dd3bc7d 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -103,6 +103,17 @@ TARGET_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET
 TARGET_CXXFLAGS = $(TARGET_CFLAGS)
 TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS))
 
+ifeq ($(BR2_BINFMT_FLAT_SHARED),y)
+TARGET_LDFLAGS += -mid-shared-library -mshared-library-id=0
+TARGET_CFLAGS += -mid-shared-library -mshared-library-id=0
+TARGET_CXXFLAGS += -mid-shared-library -mshared-library-id=0
+endif
+ifeq ($(BR2_BINFMT_FLAT_SEP_DATA),y)
+TARGET_LDFLAGS += -msep-data
+TARGET_CFLAGS += -msep-data
+TARGET_CXXFLAGS += -msep-data
+endif
+
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT)$(BR2_TOOLCHAIN_CTNG),y)
 TARGET_CROSS=$(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-
 else
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 5/7] package: Introduce package-specific BINFMT_FLAT options.
  2013-04-12 10:18 [Buildroot] [PATCH v5 1/7] arch: toolchain: Introduce binary formats BINFMT_* Sonic Zhang
                   ` (2 preceding siblings ...)
  2013-04-12 10:18 ` [Buildroot] [PATCH v5 4/7] arch: toolchain: Introduce binary format FLAT types Sonic Zhang
@ 2013-04-12 10:18 ` Sonic Zhang
  2013-04-16 21:31   ` Thomas Petazzoni
  2013-04-12 10:18 ` [Buildroot] [PATCH v5 6/7] arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile Sonic Zhang
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 23+ messages in thread
From: Sonic Zhang @ 2013-04-12 10:18 UTC (permalink / raw)
  To: buildroot

From: Sonic Zhang <sonic.zhang@analog.com>

Add new option <PKG>_FLAT_STACKSIZE. The document needs to be updated.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>

---

v4-change:
- Use late binding in make to expand package specific flat stack size
to TARGET_LDFLAGS.

v2-changes:
- Fix typo error in macro BINFMT_FLAT
---
 package/Makefile.in |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index dd3bc7d..a449089 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -103,6 +103,10 @@ TARGET_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET
 TARGET_CXXFLAGS = $(TARGET_CFLAGS)
 TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS))
 
+ifeq ($(BR2_BINFMT_FLAT),y)
+TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE))
+endif
+
 ifeq ($(BR2_BINFMT_FLAT_SHARED),y)
 TARGET_LDFLAGS += -mid-shared-library -mshared-library-id=0
 TARGET_CFLAGS += -mid-shared-library -mshared-library-id=0
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 6/7] arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile.
  2013-04-12 10:18 [Buildroot] [PATCH v5 1/7] arch: toolchain: Introduce binary formats BINFMT_* Sonic Zhang
                   ` (3 preceding siblings ...)
  2013-04-12 10:18 ` [Buildroot] [PATCH v5 5/7] package: Introduce package-specific BINFMT_FLAT options Sonic Zhang
@ 2013-04-12 10:18 ` Sonic Zhang
  2013-04-16 21:29   ` Thomas Petazzoni
  2013-04-12 10:18 ` [Buildroot] [PATCH v5 7/7] package: Introduce NOMMU symbol Sonic Zhang
  2013-04-16 18:51 ` [Buildroot] [PATCH v5 1/7] arch: toolchain: Introduce binary formats BINFMT_* Thomas Petazzoni
  6 siblings, 1 reply; 23+ messages in thread
From: Sonic Zhang @ 2013-04-12 10:18 UTC (permalink / raw)
  To: buildroot

From: Sonic Zhang <sonic.zhang@analog.com>

Reserve all 3 blackfin toolchain folders under the TOOLCHAIN_EXTERNAL_DIR.
Set current blackfin toolchain bin folder to the toolchain prefix subfolder.
Install FDPIC and FLAT library in target ext-toolchain-installed.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>

---

v5-change:
- Update comments.

v3-changes:
- Remove arch specific makefiles.
- Reserve all 3 blackfin toolchain folders under the TOOLCHAIN_EXTERNAL_DIR.
- Set current blackfin toolchain bin folder to the toolchain prefix subfolder.
- Move FDPIC and FLAT library installation target from blackfin makefile to
the ext-toolchain-installed target in external toolchain makefile.

v2-changes:
- Remove useless Macro __uClinux__

v1-changes:
- Create arch makefile.
- Create blackfin makefile.
- Add FDPIC and FLAT library options and makefile targets to install
libraries for different binary formats into the same rootfs image.
- update the TARGET_EXCEPTIONS variable in support/scripts/graph-depends for
new custom targets
---
 arch/Config.in.bfin                      |   22 ++++++++++++++
 toolchain/toolchain-external/ext-tool.mk |   46 ++++++++++++++++++++++-------
 2 files changed, 57 insertions(+), 11 deletions(-)

diff --git a/arch/Config.in.bfin b/arch/Config.in.bfin
index f755c8d..917282d 100644
--- a/arch/Config.in.bfin
+++ b/arch/Config.in.bfin
@@ -62,6 +62,28 @@ config BR2_bf561
 	bool "bf561"
 endchoice
 
+config BR2_BFIN_INSTALL_FDPIC_SHARED
+	bool "Install FDPIC shared libraries"
+	depends on !BR2_BINFMT_FDPIC
+	help
+	  The Linux kernel supports running both FDPIC and FLAT applications
+	  concurrently if the binary format specific libraries are installed properly.
+	  This option allows developer to install FDPIC libraries into a buildroot
+	  rootfs image built with binary format that is not FDPIC.
+
+config BR2_BFIN_INSTALL_FLAT_SHARED
+	depends on BR2_BINFMT_FLAT_SHARED
+	default y
+
+config BR2_BFIN_INSTALL_FLAT_SHARED
+	bool "Install FLAT shared libraries"
+	depends on !BR2_BINFMT_FLAT_SHARED
+	help
+	  The Linux kernel supports running both FDPIC and FLAT applications
+	  concurrently if the binary format specific libraries are installed properly.
+	  This option allows developer to install FLAT libraries into a buildroot
+	  rootfs image built with binary format that is not shared FLAT.
+
 config BR2_ARCH
 	default "bfin"
 
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index 27fd296..23824ab 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -115,8 +115,12 @@ ifeq ($(TOOLCHAIN_EXTERNAL_DIR),)
 # if no path set, figure it out from path
 TOOLCHAIN_EXTERNAL_BIN:=$(shell dirname $(shell which $(TOOLCHAIN_EXTERNAL_PREFIX)-gcc))
 else
+ifeq ($(BR2_bfin,y)
+TOOLCHAIN_EXTERNAL_BIN:=$(TOOLCHAIN_EXTERNAL_DIR)/$(TOOLCHAIN_EXTERNAL_PREFIX)/bin
+else
 TOOLCHAIN_EXTERNAL_BIN:=$(TOOLCHAIN_EXTERNAL_DIR)/bin
 endif
+endif
 
 TOOLCHAIN_EXTERNAL_CROSS=$(TOOLCHAIN_EXTERNAL_BIN)/$(TOOLCHAIN_EXTERNAL_PREFIX)-
 TOOLCHAIN_EXTERNAL_CC=$(TOOLCHAIN_EXTERNAL_CROSS)gcc
@@ -312,17 +316,6 @@ $(TOOLCHAIN_EXTERNAL_DIR)/.extracted: $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_1) $
 		$(TAR) $(TAR_STRIP_COMPONENTS)=3 --hard-dereference -C $(@D) $(TAR_OPTIONS) -
 	$(INFLATE$(suffix $(TOOLCHAIN_EXTERNAL_SOURCE_2))) $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_2) | \
 		$(TAR) $(TAR_STRIP_COMPONENTS)=3 --hard-dereference -C $(@D) $(TAR_OPTIONS) -
-ifeq ($(TOOLCHAIN_EXTERNAL_PREFIX),bfin-uclinux)
-	rm -rf $(TOOLCHAIN_EXTERNAL_DIR)/bfin-linux-uclibc
-	mv $(TOOLCHAIN_EXTERNAL_DIR)/bfin-uclinux $(TOOLCHAIN_EXTERNAL_DIR)/tmp
-	mv $(TOOLCHAIN_EXTERNAL_DIR)/tmp/* $(TOOLCHAIN_EXTERNAL_DIR)/
-	rmdir $(TOOLCHAIN_EXTERNAL_DIR)/tmp
-else
-	rm -rf $(TOOLCHAIN_EXTERNAL_DIR)/bfin-uclinux
-	mv $(TOOLCHAIN_EXTERNAL_DIR)/bfin-linux-uclibc $(TOOLCHAIN_EXTERNAL_DIR)/tmp
-	mv $(TOOLCHAIN_EXTERNAL_DIR)/tmp/* $(TOOLCHAIN_EXTERNAL_DIR)/
-	rmdir $(TOOLCHAIN_EXTERNAL_DIR)/tmp
-endif
 	$(Q)touch $@
 else
 # Download and extraction of a toolchain
@@ -417,6 +410,37 @@ $(STAMP_DIR)/ext-toolchain-installed: $(STAMP_DIR)/ext-toolchain-checked
 		@echo "External toolchain doesn't support --sysroot. Cannot use." ; \
 		exit 1 ; \
 	fi ; \
+	if test x"$(BR2_BFIN_INSTALL_FDPIC_SHARED)" == x"y" ; then \
+		$(call MESSAGE,"Install external toolchain FDPIC libraries to target...") ; \
+		FDPIC_EXTERNAL_CC=$(dir $(TOOLCHAIN_EXTERNAL_CC))/../../bfin-linux-uclibc/bin/bfin-linux-uclibc-gcc ; \
+		FDPIC_LIBC_A_LOCATION=`readlink -f $$(LANG=C $${FDPIC_EXTERNAL_CC} $(TOOLCHAIN_EXTERNAL_CFLAGS) -print-file-name=libc.a)` ; \
+		FDPIC_SYSROOT_DIR=`echo $${FDPIC_LIBC_A_LOCATION} | sed -r -e 's:usr/lib(64)?/(.*/)?libc\.a::'` ; \
+		FDPIC_LIB_DIR=`echo $${FDPIC_LIBC_A_LOCATION} | sed -r -e 's:.*/usr/(lib(64)?)/(.*/)?libc.a:\1:'` ; \
+		FDPIC_SUPPORT_LIB_DIR="" ; \
+		if test `find $${FDPIC_SYSROOT_DIR} -name 'libstdc++.a' | wc -l` -eq 0 ; then \
+			FDPIC_LIBSTDCPP_A_LOCATION=$$(LANG=C $${FDPIC_EXTERNAL_CC} $(TOOLCHAIN_EXTERNAL_CFLAGS) -print-file-name=libstdc++.a) ; \
+			if [ -e "$${FDPIC_LIBSTDCPP_A_LOCATION}" ]; then \
+				FDPIC_SUPPORT_LIB_DIR=`readlink -f $${FDPIC_LIBSTDCPP_A_LOCATION} | sed -r -e 's:libstdc\+\+\.a::'` ; \
+			fi ; \
+		fi ; \
+		for libs in $(LIB_EXTERNAL_LIBS); do \
+			$(call copy_toolchain_lib_root,$${FDPIC_SYSROOT_DIR},$${FDPIC_SUPPORT_LIB_DIR},$${FDPIC_LIB_DIR},$$libs,/lib); \
+		done ; \
+		for libs in $(USR_LIB_EXTERNAL_LIBS); do \
+			$(call copy_toolchain_lib_root,$${FDPIC_SYSROOT_DIR},$${FDPIC_SUPPORT_LIB_DIR},$${FDPIC_LIB_DIR},$$libs,/usr/lib); \
+		done ; \
+	fi ; \
+	if test x"$(BR2_BFIN_INSTALL_FLAT_SHARED)" == x"y" ; then \
+		$(call MESSAGE,"Install external toolchain FLAT libraries to target...") ; \
+		FLAT_EXTERNAL_CC=$(dir $(TOOLCHAIN_EXTERNAL_CC))../../bfin-uclinux/bin/bfin-uclinux-gcc ; \
+		FLAT_LIBC_A_LOCATION=`$${FLAT_EXTERNAL_CC} $(TOOLCHAIN_EXTERNAL_CFLAGS) -mid-shared-library -print-file-name=libc`; \
+		if [ -f $${FLAT_LIBC_A_LOCATION} -a ! -h $${FLAT_LIBC_A_LOCATION} ] ; then \
+# The flat libraries are found and linked according to the index in \
+# name "libN.so". Index 1 is reserved for the standard C library. \
+# Customer libraries can use 4 and above. \
+			$(INSTALL) -D $${FLAT_LIBC_A_LOCATION} $(TARGET_DIR)/lib/lib1.so; \
+		fi ; \
+	fi ; \
 	ARCH_LIBC_A_LOCATION=`readlink -f $$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS) -print-file-name=libc.a)` ; \
 	ARCH_SYSROOT_DIR=`echo $${ARCH_LIBC_A_LOCATION} | sed -r -e 's:usr/lib(64)?/(.*/)?libc\.a::'` ; \
 	ARCH_LIB_DIR=`echo $${ARCH_LIBC_A_LOCATION} | sed -r -e 's:.*/usr/(lib(64)?)/(.*/)?libc.a:\1:'` ; \
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 7/7] package: Introduce NOMMU symbol
  2013-04-12 10:18 [Buildroot] [PATCH v5 1/7] arch: toolchain: Introduce binary formats BINFMT_* Sonic Zhang
                   ` (4 preceding siblings ...)
  2013-04-12 10:18 ` [Buildroot] [PATCH v5 6/7] arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile Sonic Zhang
@ 2013-04-12 10:18 ` Sonic Zhang
  2013-04-16 21:30   ` Thomas Petazzoni
  2013-04-16 18:51 ` [Buildroot] [PATCH v5 1/7] arch: toolchain: Introduce binary formats BINFMT_* Thomas Petazzoni
  6 siblings, 1 reply; 23+ messages in thread
From: Sonic Zhang @ 2013-04-12 10:18 UTC (permalink / raw)
  To: buildroot

From: Sonic Zhang <sonic.zhang@analog.com>

Introduce NOMMU symbol __NOMMU__

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 package/Makefile.in |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index a449089..e7bb61f 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -105,6 +105,9 @@ TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS))
 
 ifeq ($(BR2_BINFMT_FLAT),y)
 TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE))
+
+ifneq ($(BR2_USE_MMU), y)
+TARGET_CFLAGS += -D__NOMMU__
 endif
 
 ifeq ($(BR2_BINFMT_FLAT_SHARED),y)
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 1/7] arch: toolchain: Introduce binary formats BINFMT_*.
  2013-04-12 10:18 [Buildroot] [PATCH v5 1/7] arch: toolchain: Introduce binary formats BINFMT_* Sonic Zhang
                   ` (5 preceding siblings ...)
  2013-04-12 10:18 ` [Buildroot] [PATCH v5 7/7] package: Introduce NOMMU symbol Sonic Zhang
@ 2013-04-16 18:51 ` Thomas Petazzoni
  2013-04-17 16:42   ` Arnout Vandecappelle
  6 siblings, 1 reply; 23+ messages in thread
From: Thomas Petazzoni @ 2013-04-16 18:51 UTC (permalink / raw)
  To: buildroot

Dear Sonic Zhang,

On Fri, 12 Apr 2013 18:18:23 +0800, Sonic Zhang wrote:

> +# Set up target binary format
> +choice
> +	prompt "Target Binary Format"
> +	default BR2_BINFMT_FDPIC if BR2_bfin
> +	default BR2_BINFMT_ELF
> +
> +config BR2_BINFMT_ELF
> +	bool "ELF"
> +	depends on !BR2_bfin
> +	help
> +	  ELF (Executable and Linkable Format) is a format for libraries and
> +	  executables used across different architectures and operating
> +	  systems.

I do agree with Arnout on one point here: we can hide this choice
when !BR2_bfin. However, contrary to Arnout, I'd like to keep this
BR2_BINFMT_ELF choice as an invisible option, that is always selected
on !BR2_bfin. Yes it's useless, but I think it makes the binfmt options
clearer.

Sonic, once this is changed, you have my Acked-by: Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> on this patch.

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 2/7] arch: Add blackfin CPU choice.
  2013-04-12 10:18 ` [Buildroot] [PATCH v5 2/7] arch: Add blackfin CPU choice Sonic Zhang
@ 2013-04-16 18:52   ` Thomas Petazzoni
  0 siblings, 0 replies; 23+ messages in thread
From: Thomas Petazzoni @ 2013-04-16 18:52 UTC (permalink / raw)
  To: buildroot

Dear Sonic Zhang,

On Fri, 12 Apr 2013 18:18:24 +0800, Sonic Zhang wrote:
> From: Sonic Zhang <sonic.zhang@analog.com>
> 
> is patch adds a Target CPU configuration option and uses it to select a -m
> option for gcc.
> 
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
> ---
>  arch/Config.in.bfin |   97 +++++++++++++++++++++++++++++++++++++++++++++++----
>  1 files changed, 90 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/Config.in.bfin b/arch/Config.in.bfin
> index 0b137ae..ac96620 100644
> --- a/arch/Config.in.bfin
> +++ b/arch/Config.in.bfin
> @@ -1,12 +1,65 @@
>  choice
> -	prompt "Target ABI"
> +	prompt "Target CPU"
>  	depends on BR2_bfin
> -	default BR2_BFIN_FDPIC
> -config BR2_BFIN_FDPIC
> -	bool "FDPIC"
> -config BR2_BFIN_FLAT
> -	bool "FLAT"
> -	select BR2_PREFER_STATIC_LIB

Those options (BR2_BFIN_FPIC, BR2_BFIN_FLAT) should have been removed
in PATCH 1, and added in Config.in.legacy (main Buildroot directory) to
ensure that users experience a smooth transition from the old options
to the new ones.

Once this is fixed, you have my Acked-by for this patch.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 3/7] arch: toolchain: Introduce target CPU revision.
  2013-04-12 10:18 ` [Buildroot] [PATCH v5 3/7] arch: toolchain: Introduce target CPU revision Sonic Zhang
@ 2013-04-16 21:20   ` Thomas Petazzoni
  0 siblings, 0 replies; 23+ messages in thread
From: Thomas Petazzoni @ 2013-04-16 21:20 UTC (permalink / raw)
  To: buildroot

Dear Sonic Zhang,

On Fri, 12 Apr 2013 18:18:25 +0800, Sonic Zhang wrote:
> From: Sonic Zhang <sonic.zhang@analog.com>

> diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
> index 92183a4..27fd296 100644
> --- a/toolchain/toolchain-external/ext-tool.mk
> +++ b/toolchain/toolchain-external/ext-tool.mk
> @@ -134,7 +134,11 @@ TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += \
>  endif
>  
>  CC_TARGET_TUNE_:=$(call qstrip,$(BR2_GCC_TARGET_TUNE))
> +ifeq ($(BR2_GCC_TARGET_CPU_REVISION),)

I think this test should have a $(call qstrip) to be effective.

>  CC_TARGET_CPU_:=$(call qstrip,$(BR2_GCC_TARGET_CPU))
> +else
> +CC_TARGET_CPU_:=$(call qstrip,$(BR2_GCC_TARGET_CPU)-$(BR2_GCC_TARGET_CPU_REVISION))
> +endif
>  CC_TARGET_ARCH_:=$(call qstrip,$(BR2_GCC_TARGET_ARCH))
>  CC_TARGET_ABI_:=$(call qstrip,$(BR2_GCC_TARGET_ABI))

It should also be changed in toolchain/gcc/gcc-uclibc-4.x.mk in a
similar way. Code is currently:

ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU)),)
GCC_WITH_CPU:=--with-cpu=$(BR2_GCC_TARGET_CPU)
endif

It should be:

ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU)),)
ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU_REVISION)),)
GCC_WITH_CPU:=--with-cpu=$(call qstrip,$(BR2_GCC_TARGET_CPU)-$(BR2_GCC_TARGET_CPU_REVISION))
else
GCC_WITH_CPU:=--with-cpu=$(call qstrip,$(BR2_GCC_TARGET_CPU))
endif
endif

Once this is one, I think the patch is OK.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 6/7] arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile.
  2013-04-12 10:18 ` [Buildroot] [PATCH v5 6/7] arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile Sonic Zhang
@ 2013-04-16 21:29   ` Thomas Petazzoni
  2013-04-17  7:50     ` Sonic Zhang
  0 siblings, 1 reply; 23+ messages in thread
From: Thomas Petazzoni @ 2013-04-16 21:29 UTC (permalink / raw)
  To: buildroot

Dear Sonic Zhang,

On Fri, 12 Apr 2013 18:18:28 +0800, Sonic Zhang wrote:
> diff --git a/arch/Config.in.bfin b/arch/Config.in.bfin
> index f755c8d..917282d 100644
> --- a/arch/Config.in.bfin
> +++ b/arch/Config.in.bfin
> @@ -62,6 +62,28 @@ config BR2_bf561
>  	bool "bf561"
>  endchoice
>  
> +config BR2_BFIN_INSTALL_FDPIC_SHARED
> +	bool "Install FDPIC shared libraries"
> +	depends on !BR2_BINFMT_FDPIC
> +	help
> +	  The Linux kernel supports running both FDPIC and FLAT applications
> +	  concurrently if the binary format specific libraries are installed properly.
> +	  This option allows developer to install FDPIC libraries into a buildroot
> +	  rootfs image built with binary format that is not FDPIC.
> +
> +config BR2_BFIN_INSTALL_FLAT_SHARED
> +	depends on BR2_BINFMT_FLAT_SHARED
> +	default y
> +
> +config BR2_BFIN_INSTALL_FLAT_SHARED
> +	bool "Install FLAT shared libraries"

Same name as the previous option.

> +	depends on !BR2_BINFMT_FLAT_SHARED
> +	help
> +	  The Linux kernel supports running both FDPIC and FLAT applications
> +	  concurrently if the binary format specific libraries are installed properly.
> +	  This option allows developer to install FLAT libraries into a buildroot
> +	  rootfs image built with binary format that is not shared FLAT.

I think those options should be preference of the external toolchain,
so in toolchain/toolchain-external/Config.in. Because if we ever
support internal toolchain for Blackfin, they won't be multilib
toolchains, so it won't make sense to have those options.

> +ifeq ($(BR2_bfin,y)

Do you actually test the patches you're posting?

> +TOOLCHAIN_EXTERNAL_BIN:=$(TOOLCHAIN_EXTERNAL_DIR)/$(TOOLCHAIN_EXTERNAL_PREFIX)/bin
> +else
>  TOOLCHAIN_EXTERNAL_BIN:=$(TOOLCHAIN_EXTERNAL_DIR)/bin
>  endif
> +endif
>  
>  TOOLCHAIN_EXTERNAL_CROSS=$(TOOLCHAIN_EXTERNAL_BIN)/$(TOOLCHAIN_EXTERNAL_PREFIX)-
>  TOOLCHAIN_EXTERNAL_CC=$(TOOLCHAIN_EXTERNAL_CROSS)gcc
> @@ -312,17 +316,6 @@ $(TOOLCHAIN_EXTERNAL_DIR)/.extracted: $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_1) $
>  		$(TAR) $(TAR_STRIP_COMPONENTS)=3 --hard-dereference -C $(@D) $(TAR_OPTIONS) -
>  	$(INFLATE$(suffix $(TOOLCHAIN_EXTERNAL_SOURCE_2))) $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_2) | \
>  		$(TAR) $(TAR_STRIP_COMPONENTS)=3 --hard-dereference -C $(@D) $(TAR_OPTIONS) -
> -ifeq ($(TOOLCHAIN_EXTERNAL_PREFIX),bfin-uclinux)
> -	rm -rf $(TOOLCHAIN_EXTERNAL_DIR)/bfin-linux-uclibc
> -	mv $(TOOLCHAIN_EXTERNAL_DIR)/bfin-uclinux $(TOOLCHAIN_EXTERNAL_DIR)/tmp
> -	mv $(TOOLCHAIN_EXTERNAL_DIR)/tmp/* $(TOOLCHAIN_EXTERNAL_DIR)/
> -	rmdir $(TOOLCHAIN_EXTERNAL_DIR)/tmp
> -else
> -	rm -rf $(TOOLCHAIN_EXTERNAL_DIR)/bfin-uclinux
> -	mv $(TOOLCHAIN_EXTERNAL_DIR)/bfin-linux-uclibc $(TOOLCHAIN_EXTERNAL_DIR)/tmp
> -	mv $(TOOLCHAIN_EXTERNAL_DIR)/tmp/* $(TOOLCHAIN_EXTERNAL_DIR)/
> -	rmdir $(TOOLCHAIN_EXTERNAL_DIR)/tmp
> -endif
>  	$(Q)touch $@
>  else
>  # Download and extraction of a toolchain
> @@ -417,6 +410,37 @@ $(STAMP_DIR)/ext-toolchain-installed: $(STAMP_DIR)/ext-toolchain-checked
>  		@echo "External toolchain doesn't support --sysroot. Cannot use." ; \
>  		exit 1 ; \
>  	fi ; \
> +	if test x"$(BR2_BFIN_INSTALL_FDPIC_SHARED)" == x"y" ; then \
> +		$(call MESSAGE,"Install external toolchain FDPIC libraries to target...") ; \
> +		FDPIC_EXTERNAL_CC=$(dir $(TOOLCHAIN_EXTERNAL_CC))/../../bfin-linux-uclibc/bin/bfin-linux-uclibc-gcc ; \
> +		FDPIC_LIBC_A_LOCATION=`readlink -f $$(LANG=C $${FDPIC_EXTERNAL_CC} $(TOOLCHAIN_EXTERNAL_CFLAGS) -print-file-name=libc.a)` ; \
> +		FDPIC_SYSROOT_DIR=`echo $${FDPIC_LIBC_A_LOCATION} | sed -r -e 's:usr/lib(64)?/(.*/)?libc\.a::'` ; \
> +		FDPIC_LIB_DIR=`echo $${FDPIC_LIBC_A_LOCATION} | sed -r -e 's:.*/usr/(lib(64)?)/(.*/)?libc.a:\1:'` ; \
> +		FDPIC_SUPPORT_LIB_DIR="" ; \
> +		if test `find $${FDPIC_SYSROOT_DIR} -name 'libstdc++.a' | wc -l` -eq 0 ; then \
> +			FDPIC_LIBSTDCPP_A_LOCATION=$$(LANG=C $${FDPIC_EXTERNAL_CC} $(TOOLCHAIN_EXTERNAL_CFLAGS) -print-file-name=libstdc++.a) ; \
> +			if [ -e "$${FDPIC_LIBSTDCPP_A_LOCATION}" ]; then \
> +				FDPIC_SUPPORT_LIB_DIR=`readlink -f $${FDPIC_LIBSTDCPP_A_LOCATION} | sed -r -e 's:libstdc\+\+\.a::'` ; \
> +			fi ; \
> +		fi ; \
> +		for libs in $(LIB_EXTERNAL_LIBS); do \
> +			$(call copy_toolchain_lib_root,$${FDPIC_SYSROOT_DIR},$${FDPIC_SUPPORT_LIB_DIR},$${FDPIC_LIB_DIR},$$libs,/lib); \
> +		done ; \
> +		for libs in $(USR_LIB_EXTERNAL_LIBS); do \
> +			$(call copy_toolchain_lib_root,$${FDPIC_SYSROOT_DIR},$${FDPIC_SUPPORT_LIB_DIR},$${FDPIC_LIB_DIR},$$libs,/usr/lib); \
> +		done ; \
> +	fi ; \
> +	if test x"$(BR2_BFIN_INSTALL_FLAT_SHARED)" == x"y" ; then \
> +		$(call MESSAGE,"Install external toolchain FLAT libraries to target...") ; \
> +		FLAT_EXTERNAL_CC=$(dir $(TOOLCHAIN_EXTERNAL_CC))../../bfin-uclinux/bin/bfin-uclinux-gcc ; \
> +		FLAT_LIBC_A_LOCATION=`$${FLAT_EXTERNAL_CC} $(TOOLCHAIN_EXTERNAL_CFLAGS) -mid-shared-library -print-file-name=libc`; \
> +		if [ -f $${FLAT_LIBC_A_LOCATION} -a ! -h $${FLAT_LIBC_A_LOCATION} ] ; then \
> +# The flat libraries are found and linked according to the index in \
> +# name "libN.so". Index 1 is reserved for the standard C library. \
> +# Customer libraries can use 4 and above. \
> +			$(INSTALL) -D $${FLAT_LIBC_A_LOCATION} $(TARGET_DIR)/lib/lib1.so; \
> +		fi ; \
> +	fi ; \
>  	ARCH_LIBC_A_LOCATION=`readlink -f $$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS) -print-file-name=libc.a)` ; \
>  	ARCH_SYSROOT_DIR=`echo $${ARCH_LIBC_A_LOCATION} | sed -r -e 's:usr/lib(64)?/(.*/)?libc\.a::'` ; \
>  	ARCH_LIB_DIR=`echo $${ARCH_LIBC_A_LOCATION} | sed -r -e 's:.*/usr/(lib(64)?)/(.*/)?libc.a:\1:'` ; \

This external toolchain installation starts to be complicated, and
should probably be split in sub-functions. But that can be done as a
followup improvement, you don't have to do it right now.

Thanks,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 7/7] package: Introduce NOMMU symbol
  2013-04-12 10:18 ` [Buildroot] [PATCH v5 7/7] package: Introduce NOMMU symbol Sonic Zhang
@ 2013-04-16 21:30   ` Thomas Petazzoni
  2013-04-17  7:27     ` Sonic Zhang
  0 siblings, 1 reply; 23+ messages in thread
From: Thomas Petazzoni @ 2013-04-16 21:30 UTC (permalink / raw)
  To: buildroot

Dear Sonic Zhang,

On Fri, 12 Apr 2013 18:18:29 +0800, Sonic Zhang wrote:

>  ifeq ($(BR2_BINFMT_FLAT),y)
>  TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE))
> +
> +ifneq ($(BR2_USE_MMU), y)

There shouldn't be any space between the comma and the y.

> +TARGET_CFLAGS += -D__NOMMU__
>  endif
>  
>  ifeq ($(BR2_BINFMT_FLAT_SHARED),y)

And you're adding a ifneq condition without adding any endif. Smells
like untested code :)

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 5/7] package: Introduce package-specific BINFMT_FLAT options.
  2013-04-12 10:18 ` [Buildroot] [PATCH v5 5/7] package: Introduce package-specific BINFMT_FLAT options Sonic Zhang
@ 2013-04-16 21:31   ` Thomas Petazzoni
  0 siblings, 0 replies; 23+ messages in thread
From: Thomas Petazzoni @ 2013-04-16 21:31 UTC (permalink / raw)
  To: buildroot

Dear Sonic Zhang,

On Fri, 12 Apr 2013 18:18:27 +0800, Sonic Zhang wrote:

> +ifeq ($(BR2_BINFMT_FLAT),y)
> +TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE))
> +endif

I haven't tested this, but it follows Arnout suggestion, and I find it
quite nice. It just lacks some documentation update, but I'm otherwise
fine with this patch.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 7/7] package: Introduce NOMMU symbol
  2013-04-16 21:30   ` Thomas Petazzoni
@ 2013-04-17  7:27     ` Sonic Zhang
  0 siblings, 0 replies; 23+ messages in thread
From: Sonic Zhang @ 2013-04-17  7:27 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Wed, Apr 17, 2013 at 5:30 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Sonic Zhang,
>
> On Fri, 12 Apr 2013 18:18:29 +0800, Sonic Zhang wrote:
>
>>  ifeq ($(BR2_BINFMT_FLAT),y)
>>  TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE))
>> +
>> +ifneq ($(BR2_USE_MMU), y)
>
> There shouldn't be any space between the comma and the y.
>
>> +TARGET_CFLAGS += -D__NOMMU__
>>  endif
>>
>>  ifeq ($(BR2_BINFMT_FLAT_SHARED),y)
>
> And you're adding a ifneq condition without adding any endif. Smells
> like untested code :)
>
That's an error when I rebase this patch automatically. Should be fixed soon.

Regards,

Sonic

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 6/7] arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile.
  2013-04-16 21:29   ` Thomas Petazzoni
@ 2013-04-17  7:50     ` Sonic Zhang
  2013-04-17  8:05       ` Thomas Petazzoni
  0 siblings, 1 reply; 23+ messages in thread
From: Sonic Zhang @ 2013-04-17  7:50 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Wed, Apr 17, 2013 at 5:29 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Sonic Zhang,
>
> On Fri, 12 Apr 2013 18:18:28 +0800, Sonic Zhang wrote:
>> diff --git a/arch/Config.in.bfin b/arch/Config.in.bfin
>> index f755c8d..917282d 100644
>> --- a/arch/Config.in.bfin
>> +++ b/arch/Config.in.bfin
>> @@ -62,6 +62,28 @@ config BR2_bf561
>>       bool "bf561"
>>  endchoice
>>
>> +config BR2_BFIN_INSTALL_FDPIC_SHARED
>> +     bool "Install FDPIC shared libraries"
>> +     depends on !BR2_BINFMT_FDPIC
>> +     help
>> +       The Linux kernel supports running both FDPIC and FLAT applications
>> +       concurrently if the binary format specific libraries are installed properly.
>> +       This option allows developer to install FDPIC libraries into a buildroot
>> +       rootfs image built with binary format that is not FDPIC.
>> +
>> +config BR2_BFIN_INSTALL_FLAT_SHARED
>> +     depends on BR2_BINFMT_FLAT_SHARED
>> +     default y
>> +
>> +config BR2_BFIN_INSTALL_FLAT_SHARED
>> +     bool "Install FLAT shared libraries"
>
> Same name as the previous option.

This is intended. When option BINFMT_FLAT_SHARED is selected option
BR2_BFIN_INSTALL_FLAT_SHARED should always be set to y. While other
BINFMT is selected, BR2_BFIN_INSTALL_FLAT_SHARED is optional for
developer to decide.


>
>> +     depends on !BR2_BINFMT_FLAT_SHARED
>> +     help
>> +       The Linux kernel supports running both FDPIC and FLAT applications
>> +       concurrently if the binary format specific libraries are installed properly.
>> +       This option allows developer to install FLAT libraries into a buildroot
>> +       rootfs image built with binary format that is not shared FLAT.
>
> I think those options should be preference of the external toolchain,
> so in toolchain/toolchain-external/Config.in. Because if we ever
> support internal toolchain for Blackfin, they won't be multilib
> toolchains, so it won't make sense to have those options.
>
>> +ifeq ($(BR2_bfin,y)
>
> Do you actually test the patches you're posting?

Yes, but when I prepare patches for upstream, I apply to a different
branch, and sometimes make typo error.

Regards,

Sonic

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 6/7] arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile.
  2013-04-17  7:50     ` Sonic Zhang
@ 2013-04-17  8:05       ` Thomas Petazzoni
  2013-04-17  8:16         ` Sonic Zhang
  0 siblings, 1 reply; 23+ messages in thread
From: Thomas Petazzoni @ 2013-04-17  8:05 UTC (permalink / raw)
  To: buildroot

Dear Sonic Zhang,

On Wed, 17 Apr 2013 15:50:01 +0800, Sonic Zhang wrote:

> This is intended. When option BINFMT_FLAT_SHARED is selected option
> BR2_BFIN_INSTALL_FLAT_SHARED should always be set to y. While other
> BINFMT is selected, BR2_BFIN_INSTALL_FLAT_SHARED is optional for
> developer to decide.

Ok, I see, makes sense. But then, why don't we have the same for FDPIC?
Also, I think I'd prefer something like:

# When the FDPIC binary format is used, we force the installation
# of the corresponding libraries. When a different binary format is
# used, we offer the option of installing the FDPIC shared libraries
# (typically in addition to the FLAT shared ones).
config BR2_BFIN_INSTALL_FDPIC_SHARED
	bool "Install FDPIC shared libraries" if !BR2_BINFMT_FDPIC
	default y if BR2_BINFMT_FDPIC
	help
	  ...

# When the FLAT shared binary format is used, we force the installation
# of the corresponding libraries. When a different binary format is
# used, we offer the option of installing the FLAT shared libraries
# (typically in addition to the FDPIC ones).
config BR2_BFIN_INSTALL_FLAT_SHARED
	bool "Install FLAT shared libraries" if !BR2_BINFMT_FLAT_SHARED
	default y if BR2_BINFMT_FLAT_SHARED
	help
	  ...

Would this makes sense?

> >> +ifeq ($(BR2_bfin,y)
> >
> > Do you actually test the patches you're posting?
> 
> Yes, but when I prepare patches for upstream, I apply to a different
> branch, and sometimes make typo error.

Ok. But then at some point we'll want to apply your patches, so they
should be working :-) (Though I understand during the review process
you want to make quick iterations, that's fine, but ultimately, we'll
want working patches).

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 6/7] arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile.
  2013-04-17  8:05       ` Thomas Petazzoni
@ 2013-04-17  8:16         ` Sonic Zhang
  2013-04-17  8:56           ` Thomas Petazzoni
  0 siblings, 1 reply; 23+ messages in thread
From: Sonic Zhang @ 2013-04-17  8:16 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Wed, Apr 17, 2013 at 4:05 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Sonic Zhang,
>
> On Wed, 17 Apr 2013 15:50:01 +0800, Sonic Zhang wrote:
>
>> This is intended. When option BINFMT_FLAT_SHARED is selected option
>> BR2_BFIN_INSTALL_FLAT_SHARED should always be set to y. While other
>> BINFMT is selected, BR2_BFIN_INSTALL_FLAT_SHARED is optional for
>> developer to decide.
>
> Ok, I see, makes sense. But then, why don't we have the same for FDPIC?
> Also, I think I'd prefer something like:
>
> # When the FDPIC binary format is used, we force the installation
> # of the corresponding libraries. When a different binary format is
> # used, we offer the option of installing the FDPIC shared libraries
> # (typically in addition to the FLAT shared ones).
> config BR2_BFIN_INSTALL_FDPIC_SHARED
>         bool "Install FDPIC shared libraries" if !BR2_BINFMT_FDPIC
>         default y if BR2_BINFMT_FDPIC
>         help
>           ...

Because current library installation scripts in
toolchain-external/ext-tool.mk always install FDPIC libraries when
BINFMT_FDPIC is selected. No necessary to set
BR2_BFIN_INSTALL_FDPIC_SHARED y in this case.

>
> # When the FLAT shared binary format is used, we force the installation
> # of the corresponding libraries. When a different binary format is
> # used, we offer the option of installing the FLAT shared libraries
> # (typically in addition to the FDPIC ones).
> config BR2_BFIN_INSTALL_FLAT_SHARED
>         bool "Install FLAT shared libraries" if !BR2_BINFMT_FLAT_SHARED
>         default y if BR2_BINFMT_FLAT_SHARED
>         help
>           ...
>
> Would this makes sense?
>

Looks better.

>> >> +ifeq ($(BR2_bfin,y)
>> >
>> > Do you actually test the patches you're posting?
>>
>> Yes, but when I prepare patches for upstream, I apply to a different
>> branch, and sometimes make typo error.
>
> Ok. But then at some point we'll want to apply your patches, so they
> should be working :-) (Though I understand during the review process
> you want to make quick iterations, that's fine, but ultimately, we'll
> want working patches).
>
> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 6/7] arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile.
  2013-04-17  8:16         ` Sonic Zhang
@ 2013-04-17  8:56           ` Thomas Petazzoni
  2013-04-17  9:40             ` Sonic Zhang
  0 siblings, 1 reply; 23+ messages in thread
From: Thomas Petazzoni @ 2013-04-17  8:56 UTC (permalink / raw)
  To: buildroot

Dear Sonic Zhang,

On Wed, 17 Apr 2013 16:16:21 +0800, Sonic Zhang wrote:

> > # When the FDPIC binary format is used, we force the installation
> > # of the corresponding libraries. When a different binary format is
> > # used, we offer the option of installing the FDPIC shared libraries
> > # (typically in addition to the FLAT shared ones).
> > config BR2_BFIN_INSTALL_FDPIC_SHARED
> >         bool "Install FDPIC shared libraries" if !BR2_BINFMT_FDPIC
> >         default y if BR2_BINFMT_FDPIC
> >         help
> >           ...
> 
> Because current library installation scripts in
> toolchain-external/ext-tool.mk always install FDPIC libraries when
> BINFMT_FDPIC is selected. No necessary to set
> BR2_BFIN_INSTALL_FDPIC_SHARED y in this case.

Ok. But then why do we have to duplicate this code in ext-tool.mk. If
it already has the code to copy the FDPIC libraries when FDPIC is
selected as the primary binary format, we should be able to re-use this
code when FLAT shared is used as the primary binary format, but we want
the FDPIC libraries to be installed in addition.

Thanks,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 6/7] arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile.
  2013-04-17  8:56           ` Thomas Petazzoni
@ 2013-04-17  9:40             ` Sonic Zhang
  2013-04-17 16:41               ` Arnout Vandecappelle
  0 siblings, 1 reply; 23+ messages in thread
From: Sonic Zhang @ 2013-04-17  9:40 UTC (permalink / raw)
  To: buildroot

Hi Thomas,


On Wed, Apr 17, 2013 at 4:56 PM, Thomas Petazzoni <
thomas.petazzoni@free-electrons.com> wrote:

> Dear Sonic Zhang,
>
> On Wed, 17 Apr 2013 16:16:21 +0800, Sonic Zhang wrote:
>
> > > # When the FDPIC binary format is used, we force the installation
> > > # of the corresponding libraries. When a different binary format is
> > > # used, we offer the option of installing the FDPIC shared libraries
> > > # (typically in addition to the FLAT shared ones).
> > > config BR2_BFIN_INSTALL_FDPIC_SHARED
> > >         bool "Install FDPIC shared libraries" if !BR2_BINFMT_FDPIC
> > >         default y if BR2_BINFMT_FDPIC
> > >         help
> > >           ...
> >
> > Because current library installation scripts in
> > toolchain-external/ext-tool.mk always install FDPIC libraries when
> > BINFMT_FDPIC is selected. No necessary to set
> > BR2_BFIN_INSTALL_FDPIC_SHARED y in this case.
>
> Ok. But then why do we have to duplicate this code in ext-tool.mk. If
> it already has the code to copy the FDPIC libraries when FDPIC is
> selected as the primary binary format, we should be able to re-use this
> code when FLAT shared is used as the primary binary format, but we want
> the FDPIC libraries to be installed in addition.
>

Yes, I do reuse the function copy_toolchain_lib_root() in the code to
install shared FDPIC libraries when FLAT format is selected. But, rest part
of the library installation code depends on current TOOLCHAIN_EXTERNAL_CC,
which is different from the FDPIC one in this case. And the following
sysroot to staging installation code depends on macro SYSROOT_DIR,
ARCH_SYSROOT_DIR, ARCH_SUBDIR, ARCH_LIB_DIR and SUPPORT_LIB_DIR, which are
based on current TOOLCHAIN_EXTERNAL_CC as well.

I feel the individual FDPIC installation code for FLAT format is a simple
and clear solution.

Regards,

Sonic
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130417/dfddaa42/attachment.html>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 6/7] arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile.
  2013-04-17  9:40             ` Sonic Zhang
@ 2013-04-17 16:41               ` Arnout Vandecappelle
  2013-04-18  7:25                 ` Thomas Petazzoni
  0 siblings, 1 reply; 23+ messages in thread
From: Arnout Vandecappelle @ 2013-04-17 16:41 UTC (permalink / raw)
  To: buildroot

On 17/04/13 11:40, Sonic Zhang wrote:
> Hi Thomas,
>
>
> On Wed, Apr 17, 2013 at 4:56 PM, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com
> <mailto:thomas.petazzoni@free-electrons.com>> wrote:
>
>     Dear Sonic Zhang,
>
>     On Wed, 17 Apr 2013 16:16:21 +0800, Sonic Zhang wrote:
>
>      > > # When the FDPIC binary format is used, we force the installation
>      > > # of the corresponding libraries. When a different binary format is
>      > > # used, we offer the option of installing the FDPIC shared libraries
>      > > # (typically in addition to the FLAT shared ones).
>      > > config BR2_BFIN_INSTALL_FDPIC_SHARED
>      > >         bool "Install FDPIC shared libraries" if !BR2_BINFMT_FDPIC
>      > >         default y if BR2_BINFMT_FDPIC
>      > >         help
>      > >           ...
>      >
>      > Because current library installation scripts in
>      > toolchain-external/ext-tool.mk <http://ext-tool.mk> always install
>     FDPIC libraries when
>      > BINFMT_FDPIC is selected. No necessary to set
>      > BR2_BFIN_INSTALL_FDPIC_SHARED y in this case.
>
>     Ok. But then why do we have to duplicate this code in ext-tool.mk
>     <http://ext-tool.mk>. If
>     it already has the code to copy the FDPIC libraries when FDPIC is
>     selected as the primary binary format, we should be able to re-use this
>     code when FLAT shared is used as the primary binary format, but we want
>     the FDPIC libraries to be installed in addition.
>
>
> Yes, I do reuse the function copy_toolchain_lib_root() in the code to
> install shared FDPIC libraries when FLAT format is selected. But, rest
> part of the library installation code depends on current
> TOOLCHAIN_EXTERNAL_CC, which is different from the FDPIC one in this
> case. And the following sysroot to staging installation code depends on
> macro SYSROOT_DIR, ARCH_SYSROOT_DIR, ARCH_SUBDIR, ARCH_LIB_DIR and
> SUPPORT_LIB_DIR, which are based on current TOOLCHAIN_EXTERNAL_CC as well.
>
> I feel the individual FDPIC installation code for FLAT format is a simple
> and clear solution.

  And anyway it can be refactored away later (e.g. when moving the 
ext-toolchain stuff to a script or to functions).


  Regards,
  Arnout

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 1/7] arch: toolchain: Introduce binary formats BINFMT_*.
  2013-04-16 18:51 ` [Buildroot] [PATCH v5 1/7] arch: toolchain: Introduce binary formats BINFMT_* Thomas Petazzoni
@ 2013-04-17 16:42   ` Arnout Vandecappelle
  2013-04-18  7:25     ` Thomas Petazzoni
  0 siblings, 1 reply; 23+ messages in thread
From: Arnout Vandecappelle @ 2013-04-17 16:42 UTC (permalink / raw)
  To: buildroot

On 16/04/13 20:51, Thomas Petazzoni wrote:
> Dear Sonic Zhang,
>
> On Fri, 12 Apr 2013 18:18:23 +0800, Sonic Zhang wrote:
>
>> +# Set up target binary format
>> +choice
>> +	prompt "Target Binary Format"
>> +	default BR2_BINFMT_FDPIC if BR2_bfin
>> +	default BR2_BINFMT_ELF
>> +
>> +config BR2_BINFMT_ELF
>> +	bool "ELF"
>> +	depends on !BR2_bfin
>> +	help
>> +	  ELF (Executable and Linkable Format) is a format for libraries and
>> +	  executables used across different architectures and operating
>> +	  systems.
>
> I do agree with Arnout on one point here: we can hide this choice
> when !BR2_bfin. However, contrary to Arnout, I'd like to keep this
> BR2_BINFMT_ELF choice as an invisible option, that is always selected
> on !BR2_bfin. Yes it's useless, but I think it makes the binfmt options
> clearer.

  OK for me. Most important is that the choice is hidden when empty.

  Regards,
  Arnout

>
> Sonic, once this is changed, you have my Acked-by: Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> on this patch.
>
> Thanks!
>
> Thomas
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 6/7] arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile.
  2013-04-17 16:41               ` Arnout Vandecappelle
@ 2013-04-18  7:25                 ` Thomas Petazzoni
  0 siblings, 0 replies; 23+ messages in thread
From: Thomas Petazzoni @ 2013-04-18  7:25 UTC (permalink / raw)
  To: buildroot

Dear Arnout Vandecappelle,

On Wed, 17 Apr 2013 18:41:02 +0200, Arnout Vandecappelle wrote:

> > Yes, I do reuse the function copy_toolchain_lib_root() in the code to
> > install shared FDPIC libraries when FLAT format is selected. But, rest
> > part of the library installation code depends on current
> > TOOLCHAIN_EXTERNAL_CC, which is different from the FDPIC one in this
> > case. And the following sysroot to staging installation code depends on
> > macro SYSROOT_DIR, ARCH_SYSROOT_DIR, ARCH_SUBDIR, ARCH_LIB_DIR and
> > SUPPORT_LIB_DIR, which are based on current TOOLCHAIN_EXTERNAL_CC as well.
> >
> > I feel the individual FDPIC installation code for FLAT format is a simple
> > and clear solution.
> 
>   And anyway it can be refactored away later (e.g. when moving the 
> ext-toolchain stuff to a script or to functions).

Yes, I agree. Let's keep Sonic code as is for now, and as we get a
better understanding of the potential similarities with the existing
code, we can refactor if it makes sense.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v5 1/7] arch: toolchain: Introduce binary formats BINFMT_*.
  2013-04-17 16:42   ` Arnout Vandecappelle
@ 2013-04-18  7:25     ` Thomas Petazzoni
  0 siblings, 0 replies; 23+ messages in thread
From: Thomas Petazzoni @ 2013-04-18  7:25 UTC (permalink / raw)
  To: buildroot

Dear Arnout Vandecappelle,

On Wed, 17 Apr 2013 18:42:24 +0200, Arnout Vandecappelle wrote:

> > I do agree with Arnout on one point here: we can hide this choice
> > when !BR2_bfin. However, contrary to Arnout, I'd like to keep this
> > BR2_BINFMT_ELF choice as an invisible option, that is always selected
> > on !BR2_bfin. Yes it's useless, but I think it makes the binfmt options
> > clearer.
> 
>   OK for me. Most important is that the choice is hidden when empty.

Agreed.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2013-04-18  7:25 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-12 10:18 [Buildroot] [PATCH v5 1/7] arch: toolchain: Introduce binary formats BINFMT_* Sonic Zhang
2013-04-12 10:18 ` [Buildroot] [PATCH v5 2/7] arch: Add blackfin CPU choice Sonic Zhang
2013-04-16 18:52   ` Thomas Petazzoni
2013-04-12 10:18 ` [Buildroot] [PATCH v5 3/7] arch: toolchain: Introduce target CPU revision Sonic Zhang
2013-04-16 21:20   ` Thomas Petazzoni
2013-04-12 10:18 ` [Buildroot] [PATCH v5 4/7] arch: toolchain: Introduce binary format FLAT types Sonic Zhang
2013-04-12 10:18 ` [Buildroot] [PATCH v5 5/7] package: Introduce package-specific BINFMT_FLAT options Sonic Zhang
2013-04-16 21:31   ` Thomas Petazzoni
2013-04-12 10:18 ` [Buildroot] [PATCH v5 6/7] arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile Sonic Zhang
2013-04-16 21:29   ` Thomas Petazzoni
2013-04-17  7:50     ` Sonic Zhang
2013-04-17  8:05       ` Thomas Petazzoni
2013-04-17  8:16         ` Sonic Zhang
2013-04-17  8:56           ` Thomas Petazzoni
2013-04-17  9:40             ` Sonic Zhang
2013-04-17 16:41               ` Arnout Vandecappelle
2013-04-18  7:25                 ` Thomas Petazzoni
2013-04-12 10:18 ` [Buildroot] [PATCH v5 7/7] package: Introduce NOMMU symbol Sonic Zhang
2013-04-16 21:30   ` Thomas Petazzoni
2013-04-17  7:27     ` Sonic Zhang
2013-04-16 18:51 ` [Buildroot] [PATCH v5 1/7] arch: toolchain: Introduce binary formats BINFMT_* Thomas Petazzoni
2013-04-17 16:42   ` Arnout Vandecappelle
2013-04-18  7:25     ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox