From patchwork Fri Apr 12 10:18:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sonic Zhang X-Patchwork-Id: 236018 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id B56D22C00B3 for ; Fri, 12 Apr 2013 20:18:54 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id C003C10BAC8; Fri, 12 Apr 2013 10:18:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yr6F65CVf3NH; Fri, 12 Apr 2013 10:18:34 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 06A1410BA87; Fri, 12 Apr 2013 10:18:34 +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 56AB68F7AC for ; Fri, 12 Apr 2013 10:18:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E05CF8F7B0 for ; Fri, 12 Apr 2013 10:18:49 +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 DlPUGPZm9iCt for ; Fri, 12 Apr 2013 10:18:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ch1outboundpool.messaging.microsoft.com (ch1ehsobe001.messaging.microsoft.com [216.32.181.181]) by whitealder.osuosl.org (Postfix) with ESMTPS id EAF808F661 for ; Fri, 12 Apr 2013 10:18:47 +0000 (UTC) Received: from mail182-ch1-R.bigfish.com (10.43.68.236) by CH1EHSOBE003.bigfish.com (10.43.70.53) with Microsoft SMTP Server id 14.1.225.23; Fri, 12 Apr 2013 10:18:46 +0000 Received: from mail182-ch1 (localhost [127.0.0.1]) by mail182-ch1-R.bigfish.com (Postfix) with ESMTP id 5D3661202EB; Fri, 12 Apr 2013 10:18:46 +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 (mail182-ch1: 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 mail182-ch1 (localhost.localdomain [127.0.0.1]) by mail182-ch1 (MessageSwitch) id 136576192419979_24123; Fri, 12 Apr 2013 10:18:44 +0000 (UTC) Received: from CH1EHSMHS019.bigfish.com (snatpool3.int.messaging.microsoft.com [10.43.68.226]) by mail182-ch1.bigfish.com (Postfix) with ESMTP id DD60B200B8; Fri, 12 Apr 2013 10:18:43 +0000 (UTC) Received: from nwd2mta1.analog.com (137.71.25.55) by CH1EHSMHS019.bigfish.com (10.43.70.19) with Microsoft SMTP Server (TLS) id 14.1.225.23; Fri, 12 Apr 2013 10:18:43 +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 r3CAI3ho023981 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Fri, 12 Apr 2013 03:18:03 -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; Fri, 12 Apr 2013 06:17:39 -0400 Received: from linux.site ([10.99.22.20]) by zeus.spd.analog.com (8.14.6/8.14.6) with ESMTP id r3CAHbQo003407; Fri, 12 Apr 2013 06:17:38 -0400 Received: from localhost.localdomain (unknown [10.99.22.72]) by linux.site (Postfix) with ESMTP id EE7FB42CE48C; Thu, 11 Apr 2013 20:50:33 -0600 (MDT) From: Sonic Zhang To: Thomas Petazzoni , Arnout Vandecappelle , Date: Fri, 12 Apr 2013 18:18:26 +0800 Message-ID: <1365761909-15305-4-git-send-email-sonic.adi@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1365761909-15305-1-git-send-email-sonic.adi@gmail.com> References: <1365761909-15305-1-git-send-email-sonic.adi@gmail.com> MIME-Version: 1.0 Cc: Sonic Zhang , buildroot-devel@blackfin.uclinux.org Subject: [Buildroot] [PATCH v5 4/7] arch: toolchain: Introduce binary format FLAT types. 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. Add FLAT types specific compiling flags into package makefile. Signed-off-by: Sonic Zhang --- 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(-) diff --git a/arch/Config.in b/arch/Config.in index 047abc1..255b8b0 100644 --- a/arch/Config.in +++ b/arch/Config.in @@ -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 diff --git a/package/Makefile.in b/package/Makefile.in index a8bf36b..dd3bc7d 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -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