From patchwork Thu Mar 21 06:38:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sonic Zhang X-Patchwork-Id: 229571 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 8A5BE2C00C3 for ; Thu, 21 Mar 2013 17:51:15 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7AE77305BD; Thu, 21 Mar 2013 06:51:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QTdvzkYMLk4i; Thu, 21 Mar 2013 06:51:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 07DD7305CE; Thu, 21 Mar 2013 06:51:13 +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 DF5898F753 for ; Thu, 21 Mar 2013 06:51:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 544798D419 for ; Thu, 21 Mar 2013 06:51:10 +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 uywzclsT0x9i for ; Thu, 21 Mar 2013 06:51:08 +0000 (UTC) X-Greylist: delayed 00:15:01 by SQLgrey-1.7.6 Received: from tx2outboundpool.messaging.microsoft.com (tx2ehsobe001.messaging.microsoft.com [65.55.88.11]) by whitealder.osuosl.org (Postfix) with ESMTPS id 9FD1F8A93E for ; Thu, 21 Mar 2013 06:51:08 +0000 (UTC) Received: from mail225-tx2-R.bigfish.com (10.9.14.243) by TX2EHSOBE012.bigfish.com (10.9.40.32) with Microsoft SMTP Server id 14.1.225.23; Thu, 21 Mar 2013 06:36:06 +0000 Received: from mail225-tx2 (localhost [127.0.0.1]) by mail225-tx2-R.bigfish.com (Postfix) with ESMTP id D5065A0008C; Thu, 21 Mar 2013 06:36:05 +0000 (UTC) X-Forefront-Antispam-Report: CIP:137.71.25.57; KIP:(null); UIP:(null); IPV:NLI; H:nwd2mta2.analog.com; RD:nwd2mail11.analog.com; EFVD:NLI X-SpamScore: 12 X-BigFish: VS12(zzzz1f42h1ee6h1ce5h1202h1e76h1d1ah1cabh1d2ahzz8275bhz2ei87h2a8h668h839hd24he5bh1288h12a5h12a9h12bdh12e5h1354h137ah139eh13b6h13eah1441h1504h1537h15a8h162dh1631h1758h17eeh1898h18e1h1946h19b5h1b0ahff4m1355m129fi1155h) Received-SPF: neutral (mail225-tx2: 137.71.25.57 is neither permitted nor denied by domain of gmail.com) client-ip=137.71.25.57; envelope-from=sonic.adi@gmail.com; helo=nwd2mta2.analog.com ; 2.analog.com ; X-FB-DOMAIN-IP-MATCH: fail Received: from mail225-tx2 (localhost.localdomain [127.0.0.1]) by mail225-tx2 (MessageSwitch) id 1363847763977714_16603; Thu, 21 Mar 2013 06:36:03 +0000 (UTC) Received: from TX2EHSMHS042.bigfish.com (unknown [10.9.14.226]) by mail225-tx2.bigfish.com (Postfix) with ESMTP id E1965900052; Thu, 21 Mar 2013 06:36:03 +0000 (UTC) Received: from nwd2mta2.analog.com (137.71.25.57) by TX2EHSMHS042.bigfish.com (10.9.99.142) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 21 Mar 2013 06:36:03 +0000 Received: from NWD2HUBCAS5.ad.analog.com (nwd2hubcas5.ad.analog.com [10.64.72.161]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id r2L7wUNN022499 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Thu, 21 Mar 2013 03:58:30 -0400 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.2.328.9; Thu, 21 Mar 2013 02:36:01 -0400 Received: from linux.site ([10.99.22.20]) by zeus.spd.analog.com (8.14.6/8.14.6) with ESMTP id r2L6a1lk003897; Thu, 21 Mar 2013 02:36:01 -0400 Received: from localhost.localdomain (unknown [10.99.22.72]) by linux.site (Postfix) with ESMTP id 5FEF742CB277; Wed, 20 Mar 2013 16:08:19 -0700 (MST) From: Sonic Zhang To: Thomas Petazzoni , Thomas De Schampheleire Date: Thu, 21 Mar 2013 14:38:27 +0800 Message-ID: <1363847908-5662-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 1/2] package: Makefile.in: Add target compilation flags for NOMMU architecture. 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 - Add BR2_TARGET_ABI_FLAT option - Add NOMMU compiling macro - Add FLAT ABI specific link flags - Add stack size to FLAT link flags if macro _FLAT_STACKSIZE is defined. Signed-off-by: Sonic Zhang --- arch/Config.in | 3 +++ package/Makefile.in | 8 ++++++++ package/pkg-autotools.mk | 5 +++++ package/pkg-generic.mk | 5 +++++ 4 files changed, 21 insertions(+), 0 deletions(-) diff --git a/arch/Config.in b/arch/Config.in index 472b10c..120c67e 100644 --- a/arch/Config.in +++ b/arch/Config.in @@ -174,6 +174,9 @@ config BR2_GCC_TARGET_ABI config BR2_GCC_TARGET_CPU string +config BR2_TARGET_ABI_FLAT + bool + if BR2_arm || BR2_armeb source "arch/Config.in.arm" endif diff --git a/package/Makefile.in b/package/Makefile.in index a8bf36b..acfd9c8 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -103,6 +103,14 @@ TARGET_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET TARGET_CXXFLAGS = $(TARGET_CFLAGS) TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS)) +ifeq ($(BR2_TARGET_ABI_FLAT),y) +TARGET_LDFLAGS += -Wl,-elf2flt +endif + +ifneq ($(BR2_USE_MMU), y) +TARGET_CFLAGS += -D__NOMMU__ +endif + ifeq ($(BR2_TOOLCHAIN_BUILDROOT)$(BR2_TOOLCHAIN_CTNG),y) TARGET_CROSS=$(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)- else diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk index 890506b..b23feec 100644 --- a/package/pkg-autotools.mk +++ b/package/pkg-autotools.mk @@ -82,6 +82,11 @@ $(2)_CLEAN_OPT ?= clean $(2)_UNINSTALL_STAGING_OPT ?= DESTDIR=$$(STAGING_DIR) uninstall $(2)_UNINSTALL_TARGET_OPT ?= DESTDIR=$$(TARGET_DIR) uninstall +ifeq ($(BR2_TARGET_ABI_FLAT),y) + ifneq ($$($(2)_FLAT_STACKSIZE),) + $(2)_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -Wl,-elf2flt=-s$($(2)_FLAT_STACKSIZE)" + endif +endif # # Configure step. Only define it if not already defined by the package diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 57b0fd0..47ac33a 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -303,6 +303,11 @@ endif $(2)_REDISTRIBUTE ?= YES +ifeq ($(BR2_TARGET_ABI_FLAT),y) + ifneq ($$($(2)_FLAT_STACKSIZE),) + $(2)_FLAT_LDFLAGS = -Wl,-elf2flt=-s$($(2)_FLAT_STACKSIZE) + endif +endif $(2)_DEPENDENCIES ?= $(filter-out $(1),$(patsubst host-host-%,host-%,$(addprefix host-,$($(3)_DEPENDENCIES))))