* [Buildroot] [PATCH v3 2/7] arch: Add blackfin CPU choice.
2013-04-09 6:29 [Buildroot] [PATCH v3 1/7] arch: toolchain: Introduce binary formats BINFMT_* Sonic Zhang
@ 2013-04-09 6:29 ` Sonic Zhang
2013-04-10 6:20 ` Arnout Vandecappelle
2013-04-09 6:29 ` [Buildroot] [PATCH v3 3/7] arch: toolchain: Introduce target CPU revision Sonic Zhang
` (5 subsequent siblings)
6 siblings, 1 reply; 13+ messages in thread
From: Sonic Zhang @ 2013-04-09 6:29 UTC (permalink / raw)
To: buildroot
From: Sonic Zhang <sonic.zhang@analog.com>
v3-changes:
none
v2-changes:
none
v1-changes:
- 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] 13+ messages in thread* [Buildroot] [PATCH v3 2/7] arch: Add blackfin CPU choice.
2013-04-09 6:29 ` [Buildroot] [PATCH v3 2/7] arch: Add blackfin CPU choice Sonic Zhang
@ 2013-04-10 6:20 ` Arnout Vandecappelle
2013-04-10 7:19 ` Sonic Zhang
0 siblings, 1 reply; 13+ messages in thread
From: Arnout Vandecappelle @ 2013-04-10 6:20 UTC (permalink / raw)
To: buildroot
On 09/04/13 08:29, Sonic Zhang wrote:
> From: Sonic Zhang <sonic.zhang@analog.com>
>
> v3-changes:
> none
>
> v2-changes:
> none
>
> v1-changes:
> - 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
These should have been removed in the previous patch.
> + default BR2_bf609
I could be wrong, but wasn't bf60x introduced relatively recently? Do
all toolchains support it? If not, it would be better to default to
something more traditional. Also, the toolchains will need conditionals
to check if they support the selected architecture.
Regards,
Arnout
> + 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
>
--
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] 13+ messages in thread
* [Buildroot] [PATCH v3 2/7] arch: Add blackfin CPU choice.
2013-04-10 6:20 ` Arnout Vandecappelle
@ 2013-04-10 7:19 ` Sonic Zhang
2013-04-10 7:20 ` Sonic Zhang
0 siblings, 1 reply; 13+ messages in thread
From: Sonic Zhang @ 2013-04-10 7:19 UTC (permalink / raw)
To: buildroot
Hi Arnout,
On Wed, Apr 10, 2013 at 2:20 PM, Arnout Vandecappelle <arnout@mind.be> wrote:
> On 09/04/13 08:29, Sonic Zhang wrote:
>>
>> From: Sonic Zhang <sonic.zhang@analog.com>
>>
>> v3-changes:
>> none
>>
>> v2-changes:
>> none
>>
>> v1-changes:
>> - 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
>
>
> These should have been removed in the previous patch.
>
>> + default BR2_bf609
>
>
> I could be wrong, but wasn't bf60x introduced relatively recently? Do all
> toolchains support it? If not, it would be better to default to something
> more traditional. Also, the toolchains will need conditionals to check if
> they support the selected architecture.
>
The Blackfin toochain releases before 2012R1 should be removed from
the buildroot toolchain makefile.
ADI supports buildroot for blackfin only since the 2012R1 release and
bf60x is enabled in the 2012R2 Blackfin toolchain release.
Regards,
Sonic
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH v3 2/7] arch: Add blackfin CPU choice.
2013-04-10 7:19 ` Sonic Zhang
@ 2013-04-10 7:20 ` Sonic Zhang
0 siblings, 0 replies; 13+ messages in thread
From: Sonic Zhang @ 2013-04-10 7:20 UTC (permalink / raw)
To: buildroot
On Wed, Apr 10, 2013 at 3:19 PM, Sonic Zhang <sonic.adi@gmail.com> wrote:
> Hi Arnout,
>
> On Wed, Apr 10, 2013 at 2:20 PM, Arnout Vandecappelle <arnout@mind.be> wrote:
>> On 09/04/13 08:29, Sonic Zhang wrote:
>>>
>>> From: Sonic Zhang <sonic.zhang@analog.com>
>>>
>>> v3-changes:
>>> none
>>>
>>> v2-changes:
>>> none
>>>
>>> v1-changes:
>>> - 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
>>
>>
>> These should have been removed in the previous patch.
>>
>>> + default BR2_bf609
>>
>>
>> I could be wrong, but wasn't bf60x introduced relatively recently? Do all
>> toolchains support it? If not, it would be better to default to something
>> more traditional. Also, the toolchains will need conditionals to check if
>> they support the selected architecture.
>>
>
> The Blackfin toochain releases before 2012R1 should be removed from
> the buildroot toolchain makefile.
> ADI supports buildroot for blackfin only since the 2012R1 release and
> bf60x is enabled in the 2012R2 Blackfin toolchain release.
>
Sorry, should be "bf60x is enabled in the 2012R1 Blackfin toolchain release".
Regards,
Sonic
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH v3 3/7] arch: toolchain: Introduce target CPU revision.
2013-04-09 6:29 [Buildroot] [PATCH v3 1/7] arch: toolchain: Introduce binary formats BINFMT_* Sonic Zhang
2013-04-09 6:29 ` [Buildroot] [PATCH v3 2/7] arch: Add blackfin CPU choice Sonic Zhang
@ 2013-04-09 6:29 ` Sonic Zhang
2013-04-09 6:29 ` [Buildroot] [PATCH v3 4/7] arch: toolchain: Introduce binary format FLAT types Sonic Zhang
` (4 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Sonic Zhang @ 2013-04-09 6:29 UTC (permalink / raw)
To: buildroot
From: Sonic Zhang <sonic.zhang@analog.com>
v3-changes:
- Detail the help text and fix the line length.
v2-changes:
none
v1-changes:
- 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>
---
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 5dd6467..b4ee38b 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] 13+ messages in thread* [Buildroot] [PATCH v3 4/7] arch: toolchain: Introduce binary format FLAT types.
2013-04-09 6:29 [Buildroot] [PATCH v3 1/7] arch: toolchain: Introduce binary formats BINFMT_* Sonic Zhang
2013-04-09 6:29 ` [Buildroot] [PATCH v3 2/7] arch: Add blackfin CPU choice Sonic Zhang
2013-04-09 6:29 ` [Buildroot] [PATCH v3 3/7] arch: toolchain: Introduce target CPU revision Sonic Zhang
@ 2013-04-09 6:29 ` Sonic Zhang
2013-04-09 6:29 ` [Buildroot] [PATCH v3 5/7] package: Introduce package-specific BINFMT_FLAT options Sonic Zhang
` (3 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Sonic Zhang @ 2013-04-09 6:29 UTC (permalink / raw)
To: buildroot
From: Sonic Zhang <sonic.zhang@analog.com>
v3-changes:
- Add dependancy to bfin and m68k
- Add help text for FLAT binary types.
- Split shared flat flags.
v2-changes:
none
v1-changes:
- Just introduce the symbol and options in arch generic Config.in.
Append FLAT types specific link flags into external toolchain wrapper.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
arch/Config.in | 23 ++++++++++++++++++++
toolchain/toolchain-external/ext-tool.mk | 8 +++++++
.../toolchain-external/ext-toolchain-wrapper.c | 7 ++++++
3 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/arch/Config.in b/arch/Config.in
index b4ee38b..9bc2d6e 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -206,6 +206,29 @@ config BR2_BINFMT_FLAT
where no MMU is available.
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/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index 27fd296..0ca1307 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -168,6 +168,14 @@ ifeq ($(BR2_BINFMT_FLAT),y)
TOOLCHAIN_EXTERNAL_CFLAGS += -Wl,-elf2flt
TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_BINFMT_FLAT
endif
+ifeq ($(BR2_BINFMT_FLAT_SEP_DATA),y)
+TOOLCHAIN_EXTERNAL_CFLAGS += -msep-data
+TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_BINFMT_FLAT_SEP_DATA
+endif
+ifeq ($(BR2_BINFMT_FLAT_SHARED),y)
+TOOLCHAIN_EXTERNAL_CFLAGS += -mid-shared-library -mshared-library-id=0
+TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_BINFMT_FLAT_SHARED
+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 9a2fc70..78f1152 100644
--- a/toolchain/toolchain-external/ext-toolchain-wrapper.c
+++ b/toolchain/toolchain-external/ext-toolchain-wrapper.c
@@ -50,6 +50,13 @@ static char *predef_args[] = {
#ifdef BR_BINFMT_FLAT
"-Wl,-elf2flt",
#endif
+#ifdef BR_BINFMT_FLAT_SEP_DATA
+ "-msep-data",
+#endif
+#ifdef BR_BINFMT_FLAT_SHARED
+ "-mid-shared-library",
+ "-mshared-library-id=0",
+#endif
#ifdef BR_ADDITIONAL_CFLAGS
BR_ADDITIONAL_CFLAGS
#endif
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [Buildroot] [PATCH v3 5/7] package: Introduce package-specific BINFMT_FLAT options.
2013-04-09 6:29 [Buildroot] [PATCH v3 1/7] arch: toolchain: Introduce binary formats BINFMT_* Sonic Zhang
` (2 preceding siblings ...)
2013-04-09 6:29 ` [Buildroot] [PATCH v3 4/7] arch: toolchain: Introduce binary format FLAT types Sonic Zhang
@ 2013-04-09 6:29 ` Sonic Zhang
2013-04-09 6:29 ` [Buildroot] [PATCH v3 6/7] arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile Sonic Zhang
` (2 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Sonic Zhang @ 2013-04-09 6:29 UTC (permalink / raw)
To: buildroot
From: Sonic Zhang <sonic.zhang@analog.com>
v3-changes:
None. Wait for more comments from Arnout.
v2-changes:
- Fix typo error in macro BINFMT_FLAT
v1-changes:
- Add new option <PKG>_FLAT_STACKSIZE. The document needs to be updated.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
package/pkg-autotools.mk | 5 +++++
package/pkg-generic.mk | 5 +++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
index 890506b..bdfea20 100644
--- a/package/pkg-autotools.mk
+++ b/package/pkg-autotools.mk
@@ -82,6 +82,11 @@ $(2)_CLEAN_OPT ?= clean
$(2)_UNINSTALL_STAGING_OPT ?= DESTDIR=$$(STAGING_DIR) uninstall
$(2)_UNINSTALL_TARGET_OPT ?= DESTDIR=$$(TARGET_DIR) uninstall
+ifeq ($(BR2_BINFMT_FLAT),y)
+ ifneq ($$($(2)_FLAT_STACKSIZE),)
+ $(2)_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -Wl,-elf2flt=-s$$($(2)_FLAT_STACKSIZE)"
+ endif
+endif
#
# Configure step. Only define it if not already defined by the package
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 57b0fd0..8ee2b20 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -303,6 +303,11 @@ endif
$(2)_REDISTRIBUTE ?= YES
+ifeq ($(BR2_BINFMT_FLAT),y)
+ ifneq ($$($(2)_FLAT_STACKSIZE),)
+ $(2)_FLAT_LDFLAGS = -Wl,-elf2flt=-s$$($(2)_FLAT_STACKSIZE)
+ endif
+endif
$(2)_DEPENDENCIES ?= $(filter-out $(1),$(patsubst host-host-%,host-%,$(addprefix host-,$($(3)_DEPENDENCIES))))
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [Buildroot] [PATCH v3 6/7] arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile.
2013-04-09 6:29 [Buildroot] [PATCH v3 1/7] arch: toolchain: Introduce binary formats BINFMT_* Sonic Zhang
` (3 preceding siblings ...)
2013-04-09 6:29 ` [Buildroot] [PATCH v3 5/7] package: Introduce package-specific BINFMT_FLAT options Sonic Zhang
@ 2013-04-09 6:29 ` Sonic Zhang
2013-04-09 6:29 ` [Buildroot] [PATCH v3 7/7] package: Introduce NOMMU symbol Sonic Zhang
2013-04-10 6:11 ` [Buildroot] [PATCH v3 1/7] arch: toolchain: Introduce binary formats BINFMT_* Arnout Vandecappelle
6 siblings, 0 replies; 13+ messages in thread
From: Sonic Zhang @ 2013-04-09 6:29 UTC (permalink / raw)
To: buildroot
From: Sonic Zhang <sonic.zhang@analog.com>
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
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
arch/Config.in.bfin | 22 ++++++++++++++
toolchain/toolchain-external/ext-tool.mk | 47 +++++++++++++++++++++++-------
2 files changed, 58 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 0ca1307..01578d2 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
@@ -320,17 +324,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
@@ -425,6 +418,38 @@ $(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] 13+ messages in thread* [Buildroot] [PATCH v3 7/7] package: Introduce NOMMU symbol
2013-04-09 6:29 [Buildroot] [PATCH v3 1/7] arch: toolchain: Introduce binary formats BINFMT_* Sonic Zhang
` (4 preceding siblings ...)
2013-04-09 6:29 ` [Buildroot] [PATCH v3 6/7] arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile Sonic Zhang
@ 2013-04-09 6:29 ` Sonic Zhang
2013-04-10 6:11 ` [Buildroot] [PATCH v3 1/7] arch: toolchain: Introduce binary formats BINFMT_* Arnout Vandecappelle
6 siblings, 0 replies; 13+ messages in thread
From: Sonic Zhang @ 2013-04-09 6:29 UTC (permalink / raw)
To: buildroot
From: Sonic Zhang <sonic.zhang@analog.com>
v3-changes:
none
v2-changes:
none
v1-chagnes:
- Introduce NOMMU symbol __NOMMU__
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
package/Makefile.in | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/package/Makefile.in b/package/Makefile.in
index a8bf36b..3a26b09 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))
+ifneq ($(BR2_USE_MMU), y)
+TARGET_CFLAGS += -D__NOMMU__
+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] 13+ messages in thread* [Buildroot] [PATCH v3 1/7] arch: toolchain: Introduce binary formats BINFMT_*.
2013-04-09 6:29 [Buildroot] [PATCH v3 1/7] arch: toolchain: Introduce binary formats BINFMT_* Sonic Zhang
` (5 preceding siblings ...)
2013-04-09 6:29 ` [Buildroot] [PATCH v3 7/7] package: Introduce NOMMU symbol Sonic Zhang
@ 2013-04-10 6:11 ` Arnout Vandecappelle
2013-04-10 7:10 ` Sonic Zhang
6 siblings, 1 reply; 13+ messages in thread
From: Arnout Vandecappelle @ 2013-04-10 6:11 UTC (permalink / raw)
To: buildroot
Hi Sonic,
On 09/04/13 08:29, Sonic Zhang wrote:
> From: Sonic Zhang <sonic.zhang@analog.com>
>
> v3-changes:
Please put your changelog below the Signed-off-by line, separated by ---
This way, the changelog doesn't appear in the final git commit log (it's
anyway not relevant anymore).
> - Rename the BINFMT dependency names in external toolchain config file.
> - Add some help text to BINFMT macros.
>
> v2-changes:
> none
>
> v1-changes:
> - 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>
> ---
> arch/Config.in | 29 ++++++++++++++++++++
> toolchain/toolchain-external/Config.in | 12 ++++----
> toolchain/toolchain-external/ext-tool.mk | 4 +++
> .../toolchain-external/ext-toolchain-wrapper.c | 3 ++
> 4 files changed, 42 insertions(+), 6 deletions(-)
>
> diff --git a/arch/Config.in b/arch/Config.in
> index 472b10c..5dd6467 100644
> --- a/arch/Config.in
> +++ b/arch/Config.in
> @@ -174,6 +174,35 @@ config BR2_GCC_TARGET_ABI
> config BR2_GCC_TARGET_CPU
> string
>
> +# Set up target binary format
> +choice
> + prompt "Target Binary Format"
I don't really like to have this choice-which-isn't-really-a-choice for
all platforms. I think the following should work:
prompt "Target Binary Format" if BR2_bfin
> + default BR2_BINFMT_ELF
There should be a default for blackfin as well. So either put
default BR2_BINFMT_FDPIC if BR2_bfin
default BR2_BINFMT_ELF
or alternatively you can put a 'default y' at the appropriate places below.
> +config BR2_BINFMT_ELF
This symbol isn't used anywhere. Does it make sense to have it? We only
need a binfmt choice on platforms that offer the choice, right?
> + 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.
An empty line between the config options would be nice.
> +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.
I like this help text! It's very clear.
Regards,
Arnout
> +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
[snip]
--
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] 13+ messages in thread* [Buildroot] [PATCH v3 1/7] arch: toolchain: Introduce binary formats BINFMT_*.
2013-04-10 6:11 ` [Buildroot] [PATCH v3 1/7] arch: toolchain: Introduce binary formats BINFMT_* Arnout Vandecappelle
@ 2013-04-10 7:10 ` Sonic Zhang
2013-04-12 5:01 ` Sonic Zhang
0 siblings, 1 reply; 13+ messages in thread
From: Sonic Zhang @ 2013-04-10 7:10 UTC (permalink / raw)
To: buildroot
Hi Arnout,
On Wed, Apr 10, 2013 at 2:11 PM, Arnout Vandecappelle <arnout@mind.be> wrote:
> Hi Sonic,
>
>
> On 09/04/13 08:29, Sonic Zhang wrote:
>>
>> From: Sonic Zhang <sonic.zhang@analog.com>
>>
>> v3-changes:
>
>
> Please put your changelog below the Signed-off-by line, separated by ---
> This way, the changelog doesn't appear in the final git commit log (it's
> anyway not relevant anymore).
>
OK.
>
>> - Rename the BINFMT dependency names in external toolchain config file.
>> - Add some help text to BINFMT macros.
>>
>> v2-changes:
>> none
>>
>> v1-changes:
>> - 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>
>> ---
>> arch/Config.in | 29
>> ++++++++++++++++++++
>> toolchain/toolchain-external/Config.in | 12 ++++----
>> toolchain/toolchain-external/ext-tool.mk | 4 +++
>> .../toolchain-external/ext-toolchain-wrapper.c | 3 ++
>> 4 files changed, 42 insertions(+), 6 deletions(-)
>>
>> diff --git a/arch/Config.in b/arch/Config.in
>> index 472b10c..5dd6467 100644
>> --- a/arch/Config.in
>> +++ b/arch/Config.in
>> @@ -174,6 +174,35 @@ config BR2_GCC_TARGET_ABI
>> config BR2_GCC_TARGET_CPU
>> string
>>
>> +# Set up target binary format
>> +choice
>> + prompt "Target Binary Format"
>
>
> I don't really like to have this choice-which-isn't-really-a-choice for all
> platforms. I think the following should work:
>
> prompt "Target Binary Format" if BR2_bfin
>
Thomas suggests to have this BINFMT macro for all architectures. If
you disagree, could you and Thomas make an agreement?
>> + default BR2_BINFMT_ELF
>
>
> There should be a default for blackfin as well. So either put
>
> default BR2_BINFMT_FDPIC if BR2_bfin
> default BR2_BINFMT_ELF
>
> or alternatively you can put a 'default y' at the appropriate places below.
>
>
>> +config BR2_BINFMT_ELF
>
OK
>
> This symbol isn't used anywhere. Does it make sense to have it? We only
> need a binfmt choice on platforms that offer the choice, right?
>
Symbol "ELF" is also suggested by Thomas. I am fine to both ways.
>
>> + 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.
>
>
> An empty line between the config options would be nice.
>
OK.
>
>> +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.
>
>
> I like this help text! It's very clear.
>
> Regards,
> Arnout
>
>
>> +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
>
> [snip]
>
>
> --
> 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] 13+ messages in thread