From: Sonic Zhang <sonic.adi@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v5 1/7] arch: toolchain: Introduce binary formats BINFMT_*.
Date: Fri, 12 Apr 2013 18:18:23 +0800 [thread overview]
Message-ID: <1365761909-15305-1-git-send-email-sonic.adi@gmail.com> (raw)
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
next reply other threads:[~2013-04-12 10:18 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-12 10:18 Sonic Zhang [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1365761909-15305-1-git-send-email-sonic.adi@gmail.com \
--to=sonic.adi@gmail.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox