Commit 57133825 authored by Sonic Zhang's avatar Sonic Zhang Committed by Peter Korsgaard
Browse files

arch: toolchain: Introduce binary formats BINFMT_*.



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

Signed-off-by: default avatarSonic Zhang <sonic.zhang@analog.com>
Acked-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
parent f88188f0
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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
+34 −0
Original line number Diff line number Diff line
@@ -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
+0 −11
Original line number Diff line number Diff line
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"

+6 −6
Original line number Diff line number Diff line
@@ -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

+4 −0
Original line number Diff line number Diff line
@@ -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))
Loading