arch: toolchain: Introduce binary formats BINFMT_*.
PATCH v6 1/7 arch: toolchain: Introduce binary formats BINFMT_*.
From: Sonic Zhang <[email protected]>
Just introduce the symbol and options in arch generic Config.in. Append FLAT format link flags to external toolchain wrapper.
---
v6-changes:
- Make BINFMT macros depend on BR2_bfin and BR2_m68k
- Move old blackfin BINFMT macros to Config.in.legacy
v3-changes:
- Rename the BINFMT dependency names in external toolchain config file.
- Add some help text to BINFMT macros.
--- Config.in.legacy | 14 ++++++++ arch/Config.in | 34 ++++++++++++++++++++ arch/Config.in.bfin | 11 ------ toolchain/toolchain-external/Config.in | 12 +++--- toolchain/toolchain-external/ext-tool.mk | 4 ++ .../toolchain-external/ext-toolchain-wrapper.c | 3 ++ 6 files changed, 61 insertions(+), 17 deletions(-)
Config.in.legacy +14 -0
@@ -104,4 +104,18 @@ config BR2_PACKAGE_INPUT_TOOLS_EVTEST help The evtest program from input-tools is now a separate package. +choice + prompt "Target ABI" + 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 + +endchoice + endmenu
arch/Config.in +34 -0
@@ -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" + depends on BR2_bfin || BR2_m68k + default BR2_BINFMT_FDPIC + +config BR2_BINFMT_ELF + bool "ELF" + depends on !BR2_bfin && !BR2_m68k + 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 || BR2_m68k + 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 || BR2_m68k + 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
arch/Config.in.bfin +0 -11
@@ -1,14 +1,3 @@ -choice - prompt "Target ABI" - 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 -endchoice - config BR2_ARCH default "bfin"
toolchain/toolchain-external/Config.in +6 -6
@@ -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
toolchain/toolchain-external/ext-tool.mk +4 -0
@@ -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))
toolchain/toolchain-external/ext-toolchain-wrapper.c +3 -0
@@ -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
Signature · 1 line
1.7.0.4
PATCH v6 1/7 arch: toolchain: Introduce binary formats BINFMT_*.
Hi Thomas,
Can this patch be merge to upstream? Who is responsible for the merge?
Thanks
Sonic
Quoted 194 lines · Sonic Zhang
From: Sonic Zhang <[email protected]>
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 <[email protected]>Signed-off-by Thomas Petazzoni <[email protected]>---
v6-changes:
- Make BINFMT macros depend onBR2_bfinandBR2_m68k
- Move old blackfin BINFMT macros to Config.in.legacyv3-changes:
- Rename the BINFMT dependency names in external toolchain config file.
- Add some help text to BINFMT macros.--- Config.in.legacy | 14 ++++++++ arch/Config.in | 34 ++++++++++++++++++++ arch/Config.in.bfin | 11 ------ toolchain/toolchain-external/Config.in | 12 +++--- toolchain/toolchain-external/ext-tool.mk | 4 ++ .../toolchain-external/ext-toolchain-wrapper.c | 3 ++ 6 files changed, 61 insertions(+), 17 deletions(-)Config.in.legacy +14
-0@@ -104,4 +104,18 @@ config BR2_PACKAGE_INPUT_TOOLS_EVTEST help The evtest program from input-tools is now a separate package. +choice + prompt "Target ABI" + 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 + +endchoice + endmenuarch/Config.in +11
-0@@ -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" + depends on BR2_bfin || BR2_m68k + default BR2_BINFMT_FDPIC + +config BR2_BINFMT_ELF + bool "ELF" + depends on !BR2_bfin && !BR2_m68k + help + ELF (Executable and Linkable Format) is a format for librariesand
arch/Config.in +8
-0+ executables used across different architectures and operating + systems. + +config BR2_BINFMT_FDPIC + bool "FDPIC" + depends on BR2_bfin || BR2_m68k + help + ELF FDPIC binaries are based on ELF, but allow the individualload
+ segments of a binary to be located in memory independently of
each
+ other. This makes this format ideal for use in environments
where noarch/Config.in +8
-0+ MMU is available. + +config BR2_BINFMT_FLAT + bool "FLAT" + depends on BR2_bfin || BR2_m68k + select BR2_PREFER_STATIC_LIB + help + FLAT binary is a relatively simple and lightweight executableformat
+ based on the original a.out format. It is widely used in
environmentarch/Config.in +4
-0+ where no MMU is available. + +endchoice + if BR2_arm || BR2_armeb source "arch/Config.in.arm" endifarch/Config.in.bfin +0
-11@@ -1,14 +1,3 @@ -choice - prompt "Target ABI" - 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 -endchoice - config BR2_ARCH default "bfin"toolchain/toolchain-external/Config.in +0
-0@@ -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" ifBR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_X86_201203
default "i686-pc-linux-gnu" ifBR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_X86_201209
- default "bfin-uclinux" ifBR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2011R1&& !BR2_BFIN_FDPIC
- default "bfin-linux-uclibc" ifBR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2011R1&&BR2_BFIN_FDPIC
- default "bfin-uclinux" ifBR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R1&& !BR2_BFIN_FDPIC
- default "bfin-linux-uclibc" ifBR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R1&&BR2_BFIN_FDPIC
- default "bfin-uclinux" ifBR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R2&& !BR2_BFIN_FDPIC
- default "bfin-linux-uclibc" ifBR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R2&&BR2_BFIN_FDPIC
+ default "bfin-uclinux" ifBR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2011R1&&BR2_BINFMT_FLAT
+ default "bfin-linux-uclibc" ifBR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2011R1&&BR2_BINFMT_FDPIC
+ default "bfin-uclinux" ifBR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R1&&BR2_BINFMT_FLAT
+ default "bfin-linux-uclibc" ifBR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R1&&BR2_BINFMT_FDPIC
+ default "bfin-uclinux" ifBR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R2&&BR2_BINFMT_FLAT
+ default "bfin-linux-uclibc" ifBR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R2&&BR2_BINFMT_FDPICdefault $(BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX) \ if BR2_TOOLCHAIN_EXTERNAL_CUSTOM(quoted diff) +0
-0ext-tool.mk
index b477bc0..92183a4 100644toolchain/toolchain-external/ext-tool.mk +4
-0@@ -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))toolchain/toolchain-external/ext-toolchain-wrapper.c +3
-1@@ -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
Quoted 5 lines
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130423/51cbc1fa/attachment-0001.html>
PATCH v6 2/7 arch: Add blackfin CPU choice.
In reply to Sonic ZhangFrom: Sonic Zhang <[email protected]>
is patch adds a Target CPU configuration option and uses it to select a -m option for gcc.
Thomas Petazzoni <[email protected]>
--- arch/Config.in.bfin | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 94 insertions(+), 0 deletions(-)
arch/Config.in.bfin +94 -0
@@ -1,5 +1,99 @@ +choice + prompt "Target CPU" + depends on BR2_bfin + 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 default "bfin" 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
Signature · 1 line
1.7.0.4
PATCH v6 2/7 arch: Add blackfin CPU choice.
Hi Thomas,
Can this patch be merge to upstream? Who is responsible for the merge?
Thanks
Sonic
Quoted 120 lines · Sonic Zhang
From: Sonic Zhang <[email protected]>
is patch adds a Target CPU configuration option and uses it to select a -m option for gcc.
Signed-off-by Sonic Zhang <[email protected]>Thomas Petazzoni <[email protected]>
--- arch/Config.in.bfin | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 94 insertions(+), 0 deletions(-)arch/Config.in.bfin +94
-1@@ -1,5 +1,99 @@ +choice + prompt "Target CPU" + depends on BR2_bfin + 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 default "bfin" 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
Quoted 5 lines
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130423/e5a0ab57/attachment.html>
PATCH v6 2/7 arch: Add blackfin CPU choice.
In reply to Sonic ZhangDear Sonic Zhang,
Quoted 7 lines · Sonic Zhang
From: Sonic Zhang <[email protected]>
is patch adds a Target CPU configuration option and uses it to select a -m option for gcc.
Signed-off-by Sonic Zhang <[email protected]>Thomas Petazzoni <[email protected]>
I'm not sure why my name is here, but now you can add my:
on this patch.
Thanks!
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v6 3/7 arch: toolchain: Introduce target CPU revision.
In reply to Sonic ZhangFrom: Sonic Zhang <[email protected]>
Adds the possibility to have a free-form CPU revision string and append it to the target CPU. Only Blackfin actually uses this option.
Thomas Petazzoni <[email protected]>
---
v6-changes:
- The cpu revision test should have a $(call qstrip) to be effective.
- Add cpu revision to toolchain/gcc/gcc-uclibc-4.x.mk as well.
v3-changes:
- Detail the help text and fix the line length.
--- arch/Config.in | 3 +++ arch/Config.in.bfin | 8 ++++++++ toolchain/gcc/gcc-uclibc-4.x.mk | 6 +++++- toolchain/toolchain-external/ext-tool.mk | 4 ++++ 4 files changed, 20 insertions(+), 1 deletions(-)
arch/Config.in +3 -0
@@ -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"
arch/Config.in.bfin +8 -0
@@ -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.
toolchain/gcc/gcc-uclibc-4.x.mk +5 -1
@@ -85,7 +85,11 @@ ifneq ($(call qstrip,$(BR2_GCC_TARGET_ABI)),) GCC_WITH_ABI:=--with-abi=$(BR2_GCC_TARGET_ABI) endif ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU)),) -GCC_WITH_CPU:=--with-cpu=$(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 # AVR32 GCC special configuration
toolchain/toolchain-external/ext-tool.mk +4 -0
@@ -134,7 +134,11 @@ TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += \ endif CC_TARGET_TUNE_:=$(call qstrip,$(BR2_GCC_TARGET_TUNE)) +ifeq ($(call qstrip,$(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))
Signature · 1 line
1.7.0.4
PATCH v6 3/7 arch: toolchain: Introduce target CPU revision.
Hi Thomas,
Can this patch be merge to upstream? Who is responsible for the merge?
Thanks
Sonic
Quoted 94 lines · Sonic Zhang
From: Sonic Zhang <[email protected]>
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 <[email protected]>Thomas Petazzoni <[email protected]>
---
v6-changes:
- The cpu revision test should have a $(call qstrip) to be effective.
- Add cpu revision totoolchain/gcc/gcc-uclibc-4.x.mkas well.v3-changes:
- Detail the help text and fix the line length.--- arch/Config.in | 3 +++ arch/Config.in.bfin | 8 ++++++++ toolchain/gcc/gcc-uclibc-4.x.mk | 6 +++++- toolchain/toolchain-external/ext-tool.mk | 4 ++++ 4 files changed, 20 insertions(+), 1 deletions(-)arch/Config.in +3
-0@@ -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"arch/Config.in.bfin +8
-0@@ -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.toolchain/gcc/ renamed from toolchain/gcc/gcc-uclibc-4.x.mk +0
-0gcc-uclibc-4.x.mk
index bdc38cd..7fd7bdb 100644toolchain/gcc/gcc-uclibc-4.x.mk +5
-1@@ -85,7 +85,11 @@ ifneq ($(call qstrip,$(BR2_GCC_TARGET_ABI)),) GCC_WITH_ABI:=--with-abi=$(BR2_GCC_TARGET_ABI) endif ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU)),) -GCC_WITH_CPU:=--with-cpu=$(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# AVR32 GCC special configuration
(quoted diff) +0
-0ext-tool.mk
index 92183a4..57ea266 100644toolchain/toolchain-external/ext-tool.mk +4
-1@@ -134,7 +134,11 @@ TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += \ endif CC_TARGET_TUNE_:=$(call qstrip,$(BR2_GCC_TARGET_TUNE)) +ifeq ($(call qstrip,$(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
Quoted 5 lines
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130423/088861b4/attachment.html>
PATCH v6 3/7 arch: toolchain: Introduce target CPU revision.
In reply to Sonic ZhangDear Sonic Zhang,
Quoted 7 lines · Sonic Zhang
From: Sonic Zhang <[email protected]>
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 <[email protected]>Thomas Petazzoni <[email protected]>
Same here. Having just my name, without any tag before, doesn't make any sense. But now, you can add my formal:
on this patch.
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v6 4/7 arch: toolchain: Introduce binary format FLAT types.
In reply to Sonic ZhangFrom: Sonic Zhang <[email protected]>
Just introduce the symbol and options in arch generic Config.in. Add FLAT types specific compiling flags into package makefile.
---
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(-)
arch/Config.in +26 -0
@@ -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
package/Makefile.in +11 -0
@@ -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
Signature · 1 line
1.7.0.4
PATCH v6 4/7 arch: toolchain: Introduce binary format FLAT types.
Dear Sonic Zhang,
Quoted 6 lines · Sonic Zhang
From: Sonic Zhang <[email protected]>
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 <[email protected]>
You can now add my:
on this one.
Quoted 9 lines
package/Makefile.in +1
-0@@ -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)
package/Makefile.in TARGET_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET · line 116
Quoted 10 lines
package/Makefile.in +10
-0+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 +
I had a discussion with Peter Korsgaard about this, and we've decided to accept it as is, even though it should normally be part of the external toolchain wrapper. But we haven't gotten to a nice and simple solution for it, so let's do what you're proposing here.
Best regards,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v6 5/7 package: Introduce package-specific BINFMT_FLAT options.
In reply to Sonic ZhangFrom: Sonic Zhang <[email protected]>
Add new option <PKG>_FLAT_STACKSIZE. The document needs to be updated.
Thomas Petazzoni <[email protected]>
---
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(-)
package/Makefile.in +4 -0
@@ -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
Signature · 1 line
1.7.0.4
PATCH v6 5/7 package: Introduce package-specific BINFMT_FLAT options.
Hi Thomas,
Quoted 38 lines · Sonic Zhang
From: Sonic Zhang <[email protected]>
Add new option <PKG>_FLAT_STACKSIZE. The document needs to be updated.
Signed-off-by Sonic Zhang <[email protected]>Thomas Petazzoni <[email protected]>
---
v4-change:
- Use late binding in make to expand package specific flat stack size toTARGET_LDFLAGS.v2-changes:
- Fix typo error in macroBINFMT_FLAT--- package/Makefile.in | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)package/Makefile.in +4
-1@@ -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
Quoted 4 lines
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Can this patch be merge to upstream? Who is responsible for the merge?
Thanks
Sonic Zhang
PATCH v6 5/7 package: Introduce package-specific BINFMT_FLAT options.
In reply to Sonic ZhangDear Sonic Zhang,
Quoted 3 lines · Sonic Zhang
From: Sonic Zhang <[email protected]>
Add new option <PKG>_FLAT_STACKSIZE. The document needs to be updated.
The documentation still hasn't been updated.
Quoted 2 lines
Signed-off-by Sonic Zhang <[email protected]>Thomas Petazzoni <[email protected]>
Again, having just my name doesn't make any sense. But now, you can add my:
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v6 6/7 arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile.
In reply to Sonic ZhangFrom: Sonic Zhang <[email protected]>
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.
---
v6-changes:
- Move options of installing blackfin toolchain libraries into external toolchain Config.in.
- Fix typo error.
- Merge the options of the same name and add descriptions.
v5-changes:
- 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
--- toolchain/toolchain-external/Config.in | 25 ++++++++++++++++ toolchain/toolchain-external/ext-tool.mk | 46 ++++++++++++++++++++++------- 2 files changed, 60 insertions(+), 11 deletions(-)
toolchain/toolchain-external/Config.in +25 -0
@@ -887,5 +887,30 @@ config BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS endif # BR2_TOOLCHAIN_EXTERNAL_CUSTOM +# When the FDPIC shared binary format is used, the corresponding libraries are +# always installed. When a different binary format is used, we offer the option +# of installing the FDPIC shared libraries. +config BR2_BFIN_INSTALL_FDPIC_SHARED + bool "Install FDPIC shared libraries" + depends on BR2_bfin && !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. + +# 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. +config BR2_BFIN_INSTALL_FLAT_SHARED + bool "Install FLAT shared libraries" + depends on BR2_bfin && !BR2_BINFMT_FLAT_SHARED + default y if 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. + endif # BR2_TOOLCHAIN_EXTERNAL
toolchain/toolchain-external/ext-tool.mk +35 -11
66 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH v6 6/7 arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile.
Hi Thomas,
Quoted 153 lines · Sonic Zhang
From: Sonic Zhang <[email protected]>
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 <[email protected]>---
v6-changes:
- Move options of installing blackfin toolchain libraries into external toolchain Config.in.
- Fix typo error.
- Merge the options of the same name and add descriptions.v5-changes:
- Update comments.v3-changes:
- Remove arch specific makefiles.
- Reserve all 3 blackfin toolchain folders under theTOOLCHAIN_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 theTARGET_EXCEPTIONSvariable in support/scripts/graph-depends for new custom targets--- toolchain/toolchain-external/Config.in | 25 ++++++++++++++++ toolchain/toolchain-external/ext-tool.mk | 46 ++++++++++++++++++++++------- 2 files changed, 60 insertions(+), 11 deletions(-)toolchain/toolchain-external/Config.in +25
-0@@ -887,5 +887,30 @@ config BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS endif # BR2_TOOLCHAIN_EXTERNAL_CUSTOM +# When the FDPIC shared binary format is used, the corresponding libraries are +# always installed. When a different binary format is used, we offer the option +# of installing the FDPIC shared libraries. +config BR2_BFIN_INSTALL_FDPIC_SHARED + bool "Install FDPIC shared libraries" + depends on BR2_bfin && !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. + +# 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. +config BR2_BFIN_INSTALL_FLAT_SHARED + bool "Install FLAT shared libraries" + depends on BR2_bfin && !BR2_BINFMT_FLAT_SHARED + default y if 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. + endif # BR2_TOOLCHAIN_EXTERNALtoolchain/toolchain-external/ext-tool.mk +35
-12@@ -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
Quoted 4 lines
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
May I have you Acked-by against this patch?
Thanks
Sonic Zhang
PATCH v6 6/7 arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile.
In reply to Sonic ZhangHi Thomas,
Quoted 64 lines · Sonic Zhang
From: Sonic Zhang <[email protected]>
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 <[email protected]>---
v6-changes:
- Move options of installing blackfin toolchain libraries into external toolchain Config.in.
- Fix typo error.
- Merge the options of the same name and add descriptions.v5-changes:
- Update comments.v3-changes:
- Remove arch specific makefiles.
- Reserve all 3 blackfin toolchain folders under theTOOLCHAIN_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 theTARGET_EXCEPTIONSvariable in support/scripts/graph-depends for new custom targets--- toolchain/toolchain-external/Config.in | 25 ++++++++++++++++ toolchain/toolchain-external/ext-tool.mk | 46 ++++++++++++++++++++++------- 2 files changed, 60 insertions(+), 11 deletions(-)toolchain/toolchain-external/Config.in +15
-0@@ -887,5 +887,30 @@ config BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS endif # BR2_TOOLCHAIN_EXTERNAL_CUSTOM +# When the FDPIC shared binary format is used, the corresponding libraries are +# always installed. When a different binary format is used, we offer the option +# of installing the FDPIC shared libraries. +config BR2_BFIN_INSTALL_FDPIC_SHARED + bool "Install FDPIC shared libraries" + depends on BR2_bfin && !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. + +# 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.
toolchain/toolchain-external/Config.in config BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS · line 914
Quoted 10 lines
toolchain/toolchain-external/Config.in +10
-0+config BR2_BFIN_INSTALL_FLAT_SHARED + bool "Install FLAT shared libraries" + depends on BR2_bfin && !BR2_BINFMT_FLAT_SHARED + default y if 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. +
Your former suggestion to merge 2 options
---------------------------------
config BR2_BFIN_INSTALL_FLAT_SHARED
default y if BR2_BINFMT_FLAT_SHARED
config BR2_BFIN_INSTALL_FLAT_SHARED
bool "Install FLAT shared libraries" depends on BR2_bfin && !BR2_BINFMT_FLAT_SHARED
---------------------------------
into one
---------------------------------
config BR2_BFIN_INSTALL_FLAT_SHARED
bool "Install FLAT shared libraries" depends on BR2_bfin && !BR2_BINFMT_FLAT_SHARED default y if BR2_BINFMT_FLAT_SHARED
---------------------------------
doesn't work. In the later case, if BR2_BINFMT_FLAT_SHARED is selected, option BR2_BFIN_INSTALL_FLAT_SHARED is not set to y by default. Only the former case works correctly.
So, I have to revert the options back.
Regards,
Sonic Zhang
PATCH v6 6/7 arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile.
Dear Sonic Zhang,
Quoted 10 lines · Sonic Zhang
---------------------------------
configBR2_BFIN_INSTALL_FLAT_SHARED
bool "Install FLAT shared libraries" depends onBR2_bfin&& !BR2_BINFMT_FLAT_SHARED default y ifBR2_BINFMT_FLAT_SHARED
---------------------------------doesn't work. In the later case, if
BR2_BINFMT_FLAT_SHAREDis selected, optionBR2_BFIN_INSTALL_FLAT_SHAREDis not set to y by default. Only the former case works correctly.
Wasn't my suggestion:
config BR2_BFIN_INSTALL_FLAT_SHARED
bool "Install FLAT shared libraries" if !BR2_BINFMT_FLAT_SHARED depends on BR2_bfin
default y if BR2_BINFMT_FLAT_SHARED
So: option enabled by default when BR2_BINFMT_FLAT_SHARED, and the prompt is shown to optionally enable/disable it when BR2_BINFMT_FLAT_SHARED is not selected.
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v6 6/7 arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile.
Hi Thomas,
Quoted 17 lines · Thomas Petazzoni
Dear Sonic Zhang,
Quoted 10 lines · Sonic Zhang
---------------------------------
configBR2_BFIN_INSTALL_FLAT_SHARED
bool "Install FLAT shared libraries" depends onBR2_bfin&& !BR2_BINFMT_FLAT_SHARED default y ifBR2_BINFMT_FLAT_SHARED
---------------------------------doesn't work. In the later case, if
BR2_BINFMT_FLAT_SHAREDis selected, optionBR2_BFIN_INSTALL_FLAT_SHAREDis not set to y by default. Only the former case works correctly.Wasn't my suggestion:
Quoted 8 lines
config
BR2_BFIN_INSTALL_FLAT_SHARED
bool "Install FLAT shared libraries" if !BR2_BINFMT_FLAT_SHARED depends onBR2_bfin
default y ifBR2_BINFMT_FLAT_SHAREDSo: option enabled by default when
BR2_BINFMT_FLAT_SHARED, and the prompt is shown to optionally enable/disable it whenBR2_BINFMT_FLAT_SHAREDis not selected.
In this way, the developer can disable the option BR2_BFIN_INSTALL_FLAT_SHARED in share flat binary mode. This is incorrect. My solution ensures the developer have no way to disable BR2_BFIN_INSTALL_FLAT_SHARED when BR2_BINFMT_FLAT_SHARED is selected.
Regards,
Sonic
PATCH v6 6/7 arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile.
Dear Sonic Zhang,
Quoted 7 lines · Sonic Zhang
Quoted 7 lines
Wasn't my suggestion:
config
BR2_BFIN_INSTALL_FLAT_SHARED
bool "Install FLAT shared libraries" if !BR2_BINFMT_FLAT_SHARED depends onBR2_bfin
default y ifBR2_BINFMT_FLAT_SHARED
Quoted 8 lines
Quoted 3 lines
So: option enabled by default when
BR2_BINFMT_FLAT_SHARED, and the prompt is shown to optionally enable/disable it whenBR2_BINFMT_FLAT_SHAREDis not selected.In this way, the developer can disable the option
BR2_BFIN_INSTALL_FLAT_SHAREDin share flat binary mode. This is incorrect. My solution ensures the developer have no way to disableBR2_BFIN_INSTALL_FLAT_SHAREDwhenBR2_BINFMT_FLAT_SHAREDis selected.
This is what my proposed code is doing. I've just tested it on a small example:
config BR2_OPTIONA
bool "optionA"
config BR2_OPTIONB
bool "optionB" if !BR2_OPTIONA
default y if BR2_OPTIONA
With the following results:
* If the user selects option A, then the possibility of choosing the value for option B disappears, and option B is forcefully enabled.
* If the user doesn't select option A, then he is free to select or not select option B.
Thanks,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v6 6/7 arch: toolchain: Install blackfin FDPIC and FLAT libraries in external toolchain makefile.
Hi Thomas,
Quoted 30 lines · Thomas Petazzoni
Dear Sonic Zhang,
Quoted 7 lines · Sonic Zhang
Quoted 7 lines
Wasn't my suggestion:
config
BR2_BFIN_INSTALL_FLAT_SHARED
bool "Install FLAT shared libraries" if !BR2_BINFMT_FLAT_SHARED depends onBR2_bfin
default y ifBR2_BINFMT_FLAT_SHAREDQuoted 8 lines
Quoted 3 lines
So: option enabled by default when
BR2_BINFMT_FLAT_SHARED, and the prompt is shown to optionally enable/disable it whenBR2_BINFMT_FLAT_SHAREDis not selected.In this way, the developer can disable the option
BR2_BFIN_INSTALL_FLAT_SHAREDin share flat binary mode. This is incorrect. My solution ensures the developer have no way to disableBR2_BFIN_INSTALL_FLAT_SHAREDwhenBR2_BINFMT_FLAT_SHAREDis selected.This is what my proposed code is doing. I've just tested it on a small example:
config
BR2_OPTIONA
bool "optionA"config
BR2_OPTIONB
bool "optionB" if !BR2_OPTIONA
default y ifBR2_OPTIONA
Quoted 8 lines
With the following results:
* If the user selects option A, then the possibility of choosing the value for option B disappears, and option B is forcefully enabled.
* If the user doesn't select option A, then he is free to select or not select option B.
Thank you for your explanation. You are right, the if condition should be after bool other than depend.
Regards,
Sonic
PATCH v6 7/7 package: Introduce NOMMU symbol
In reply to Sonic ZhangFrom: Sonic Zhang <[email protected]>
Introduce NOMMU symbol __NOMMU__
---
v6-changes:
- Remove space between comma and y.
- Restore endif after rebase.
--- package/Makefile.in | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
package/Makefile.in +4 -0
@@ -107,6 +107,10 @@ ifeq ($(BR2_BINFMT_FLAT),y) TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE)) endif +ifneq ($(BR2_USE_MMU),y) +TARGET_CFLAGS += -D__NOMMU__ +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
Signature · 1 line
1.7.0.4
PATCH v6 7/7 package: Introduce NOMMU symbol
Hi Thomas,
Quoted 33 lines · Sonic Zhang
From: Sonic Zhang <[email protected]>
Introduce NOMMU symbol
__NOMMU__---
v6-changes:
- Remove space between comma and y.
- Restore endif after rebase.Signed-off-by Sonic Zhang <[email protected]>--- package/Makefile.in | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)package/Makefile.in +4
-1@@ -107,6 +107,10 @@ ifeq ($(BR2_BINFMT_FLAT),y) TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE)) endif +ifneq ($(BR2_USE_MMU),y) +TARGET_CFLAGS += -D__NOMMU__ +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
Quoted 4 lines
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
May I have your Acked-by against this patch?
Thanks
Sonic Zhang
PATCH v6 1/7 arch: toolchain: Introduce binary formats BINFMT_*.
In reply to Sonic ZhangDear Sonic Zhang,
Quoted 11 lines · Sonic Zhang
Config.in.legacy +3
-0@@ -104,4 +104,18 @@ config BR2_PACKAGE_INPUT_TOOLS_EVTEST help The evtest program from input-tools is now a separate package. +choice + prompt "Target ABI" + depends on BR2_bfin
Config.in.legacy config BR2_PACKAGE_INPUT_TOOLS_EVTEST · line 119
Quoted 10 lines
Config.in.legacy +10
-0+ default BR2_BFIN_FDPIC + +config BR2_BFIN_FDPIC + bool "FDPIC" + +config BR2_BFIN_FLAT + bool "FLAT" + select BR2_PREFER_STATIC_LIB + +endchoice
Hum, that's not how the legacy stuff works. You don't have to duplicate the choice, but instead do something like:
config BR2_BFIN_FDPIC
bool "BR2_BFIN_FDPIC is now BR2_BINFMT_FDPIC" select BR2_BINFMT_FDPIC
select BR2_LEGACY
config BR2_BFIN_FLAT
bool "BR2_BFIN_FLAT is now BR2_BINFMT_FLAT" select BR2_BINFMT_FLAT
select BR2_LEGACY
Once this is fixed, you'll have my Acked-by on this patch, the rest looks ok to me.
Thanks!
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com