arch: toolchain: Introduce binary formats BINFMT_*.
authorSonic Zhang <sonic.zhang@analog.com>
Fri, 3 May 2013 00:39:34 +0000 (00:39 +0000)
committerPeter Korsgaard <jacmet@sunsite.dk>
Sun, 5 May 2013 20:46:37 +0000 (22:46 +0200)
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>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Config.in.legacy
arch/Config.in
arch/Config.in.bfin
toolchain/toolchain-external/Config.in
toolchain/toolchain-external/ext-tool.mk
toolchain/toolchain-external/ext-toolchain-wrapper.c

index fc9f68f24860c5d4888f4059ed6aca0c745ec60e..7748ab390af8eaf60a68076983703a2c2f835af3 100644 (file)
@@ -172,4 +172,14 @@ config BR2_PACKAGE_INPUT_TOOLS_EVTEST
        help
          The evtest program from input-tools is now a separate package.
 
+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
+
 endmenu
index 2006f1e0de8ce17b78240f08e152c14df52e620e..e32cfd91474cb5b01ec4c8e30fa9dbd24c115bd4 100644 (file)
@@ -189,6 +189,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_arcle || BR2_arceb
 source "arch/Config.in.arc"
 endif
index 0b137ae8e8f90ec3f904a024a3a63872187a3683..2a7ff547fec1a26b98136e6a9987560c8be0c7fe 100644 (file)
@@ -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"
 
index b1aab6a2ed147f71fc80cb470794ff5cad103058..a93ada32ed8fc750acfd28b6387d2bf28195c1c4 100644 (file)
@@ -784,12 +784,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
 
index 616f4535be40fd5328f2973e4917b91071e04f3c..dce0299beefff53d9256642c63184affc140206f 100644 (file)
@@ -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))
index a92badac0d02be5f7707dc95bae680b1d61ccf2e..9a2fc70b029f501d8dcb93797c0ae9122a725f96 100644 (file)
@@ -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