From patchwork Thu Apr 11 02:08:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sonic Zhang X-Patchwork-Id: 235537 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 846452C00AD for ; Thu, 11 Apr 2013 12:10:29 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2AFD28D581; Thu, 11 Apr 2013 02:10:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WP5jzsQ-uHjF; Thu, 11 Apr 2013 02:10:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 8D7BD8F768; Thu, 11 Apr 2013 02:09:54 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 75D8C8F7A5 for ; Thu, 11 Apr 2013 02:09:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E1CBB8E870 for ; Thu, 11 Apr 2013 02:09:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QEenyOAt6nWR for ; Thu, 11 Apr 2013 02:09:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from db8outboundpool.messaging.microsoft.com (mail-db8lp0186.outbound.messaging.microsoft.com [213.199.154.186]) by whitealder.osuosl.org (Postfix) with ESMTPS id CA3518D5C6 for ; Thu, 11 Apr 2013 02:09:18 +0000 (UTC) Received: from mail90-db8-R.bigfish.com (10.174.8.236) by DB8EHSOBE034.bigfish.com (10.174.4.97) with Microsoft SMTP Server id 14.1.225.23; Thu, 11 Apr 2013 02:09:16 +0000 Received: from mail90-db8 (localhost [127.0.0.1]) by mail90-db8-R.bigfish.com (Postfix) with ESMTP id BFEC8540252; Thu, 11 Apr 2013 02:09:16 +0000 (UTC) X-Forefront-Antispam-Report: CIP:137.71.25.55; KIP:(null); UIP:(null); IPV:NLI; H:nwd2mta1.analog.com; RD:nwd2mail10.analog.com; EFVD:NLI X-SpamScore: 12 X-BigFish: VS12(zzzz1f42h1fc6h1ee6h1ce5h1fdah1202h1fd0h1e76h1d1ah1cabh1d2ahzz8275bhz2ei87h2a8h668h839hd24he5bh1288h12a5h12a9h12bdh12e5h1354h137ah139eh13b6h13eah1441h1504h1537h15a8h162dh1631h1758h17eeh1898h18e1h1946h19b5h1b0ahff4m1355m129fi1155h) Received-SPF: neutral (mail90-db8: 137.71.25.55 is neither permitted nor denied by domain of gmail.com) client-ip=137.71.25.55; envelope-from=sonic.adi@gmail.com; helo=nwd2mta1.analog.com ; 1.analog.com ; X-FB-DOMAIN-IP-MATCH: fail Received: from mail90-db8 (localhost.localdomain [127.0.0.1]) by mail90-db8 (MessageSwitch) id 13656461551624_7522; Thu, 11 Apr 2013 02:09:15 +0000 (UTC) Received: from DB8EHSMHS017.bigfish.com (unknown [10.174.8.238]) by mail90-db8.bigfish.com (Postfix) with ESMTP id E888CC80049; Thu, 11 Apr 2013 02:09:14 +0000 (UTC) Received: from nwd2mta1.analog.com (137.71.25.55) by DB8EHSMHS017.bigfish.com (10.174.4.27) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 11 Apr 2013 02:09:14 +0000 Received: from NWD2HUBCAS5.ad.analog.com (nwd2hubcas5.ad.analog.com [10.64.72.161]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id r3B28Wsx007768 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 10 Apr 2013 19:08:33 -0700 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS5.ad.analog.com (10.64.72.161) with Microsoft SMTP Server id 14.3.123.3; Wed, 10 Apr 2013 22:08:07 -0400 Received: from linux.site ([10.99.22.20]) by zeus.spd.analog.com (8.14.6/8.14.6) with ESMTP id r3B2851D008592; Wed, 10 Apr 2013 22:08:06 -0400 Received: from localhost.localdomain (unknown [10.99.22.72]) by linux.site (Postfix) with ESMTP id BD99A42CE374; Wed, 10 Apr 2013 12:40:59 -0600 (MDT) From: Sonic Zhang To: Arnout Vandecappelle , Thomas De Schampheleire Date: Thu, 11 Apr 2013 10:08:58 +0800 Message-ID: <1365646144-8214-1-git-send-email-sonic.adi@gmail.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 Cc: buildroot@busybox.net, Sonic Zhang , buildroot-devel@blackfin.uclinux.org Subject: [Buildroot] [PATCH v4 1/7] arch: toolchain: Introduce binary formats BINFMT_*. X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net From: Sonic Zhang 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 --- 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