From patchwork Wed Mar 18 09:49:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bamvor Jian Zhang X-Patchwork-Id: 451322 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 5E10B14009B for ; Wed, 18 Mar 2015 20:49:20 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 566CC891D8; Wed, 18 Mar 2015 09:49:19 +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 WgqTHzoRW7mJ; Wed, 18 Mar 2015 09:49:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 38BBA8A388; Wed, 18 Mar 2015 09:49:09 +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 BAD4A1C2348 for ; Wed, 18 Mar 2015 09:49:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B65C78A187 for ; Wed, 18 Mar 2015 09:49:02 +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 mcmumEUPu4qk for ; Wed, 18 Mar 2015 09:49:01 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [58.251.152.64]) by whitealder.osuosl.org (Postfix) with ESMTPS id 6BFB488B50 for ; Wed, 18 Mar 2015 09:49:01 +0000 (UTC) Received: from 172.24.2.119 (EHLO szxeml426-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CKZ44547; Wed, 18 Mar 2015 17:48:58 +0800 (CST) Received: from linux696.huawei.com (10.110.52.23) by szxeml426-hub.china.huawei.com (10.82.67.181) with Microsoft SMTP Server id 14.3.158.1; Wed, 18 Mar 2015 17:48:45 +0800 From: "Zhang Jian(Bamvor)" To: Date: Wed, 18 Mar 2015 17:49:50 +0800 Message-ID: <1426672192-21041-4-git-send-email-bamvor.zhangjian@huawei.com> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1426672192-21041-1-git-send-email-bamvor.zhangjian@huawei.com> References: <1426672192-21041-1-git-send-email-bamvor.zhangjian@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.110.52.23] X-CFilter-Loop: Reflected Cc: thomas.petazzoni@free-electrons.com, bintian.wang@huawei.com, dingtianhong@huawei.com Subject: [Buildroot] [RFC PATCH v2 3/5] aarch64: ilp32: add ilp32 compiler and linker flags X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 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" In aarch64, lp64 is the default ABI. Need pass the special flags if the user want to compile and link ilp32 application. Signed-off-by: Zhang Jian(Bamvor) --- package/Makefile.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/package/Makefile.in b/package/Makefile.in index 803b162..23f376f 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -106,6 +106,14 @@ ifeq ($(BR2_arc)$(BR2_ARC_ATOMIC_EXT),yy) TARGET_ABI += -matomic endif +ifeq ($(BR2_AARCH64_ILP32)$(BR2_aarch64),yy) +TARGET_ABI += -mabi=ilp32 -Xlinker -maarch64linux32 +endif + +ifeq ($(BR2_AARCH64_ILP32)$(BR2_aarch64_be),yy) +TARGET_ABI += -mabi=ilp32 -Xlinker -EB -Xlinker -maarch64linux32b +endif + STAGING_SUBDIR = usr/$(GNU_TARGET_NAME)/sysroot STAGING_DIR = $(HOST_DIR)/$(STAGING_SUBDIR) @@ -142,7 +150,7 @@ endif TARGET_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) TARGET_CXXFLAGS = $(TARGET_CFLAGS) -TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS)) +TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS)) $(TARGET_ABI) ifeq ($(BR2_BINFMT_FLAT),y) TARGET_CFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),\