From patchwork Thu Aug 13 01:16:43 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: 506800 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 66A20140342 for ; Thu, 13 Aug 2015 11:19:12 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6EA2EA2957; Thu, 13 Aug 2015 01:19:11 +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 ZHDe6FvJ_D7D; Thu, 13 Aug 2015 01:19:09 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 44FB3A2940; Thu, 13 Aug 2015 01:19:09 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 647821C1481 for ; Thu, 13 Aug 2015 01:19:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5D9068D6C4 for ; Thu, 13 Aug 2015 01:19:07 +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 QrEsG2fyduAg for ; Thu, 13 Aug 2015 01:19:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by whitealder.osuosl.org (Postfix) with ESMTPS id A484B8D6A2 for ; Thu, 13 Aug 2015 01:19:05 +0000 (UTC) Received: by pdrh1 with SMTP id h1so13127508pdr.0 for ; Wed, 12 Aug 2015 18:19:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0dwb0d+Hk7qub3PMQMafcTc+64emml0dXlVLgQ/hrq4=; b=C8ZymzA3xSTLbIoTKWWkpZyE/lMtjwC+ZJoluZrW7SrjM1eSSI3etLgP8i8ztsQnnb yKZqyBrIfRG6qBRl2tzr3UMFFojqkgJ+oSvDlBOvYXO4JnstgKK2hHA6iX0M36EDbMyW EBl0JCVn8BAU29sCf39KavQnVH6Hj7PuCl6I1ocMLPaZiBKvnT3DGc+wZrmM+d4D/J8Q VIjMbpuUlirZ7xDcEy0+Gz3FGQHCCXwoYzzgjAMWB87FzqtSSytiOtm5q0SgfUL0qQ6v dVUKvCEHrUJM6o0nD3HDZMMbZMB9L3HygsgQiS0+fY1Xjdo9YM/Y4ITV+KaBuJspTUqY MlnA== X-Gm-Message-State: ALoCoQlcBJBhKQNcLuWK8W1wPS9+bY1Lnf0yGvU2sEM1Er4deOp41iPvXruVynybV47VD0m5W+AV X-Received: by 10.70.44.133 with SMTP id e5mr73702163pdm.24.1439428745427; Wed, 12 Aug 2015 18:19:05 -0700 (PDT) Received: from linux-j170.site ([104.156.239.73]) by smtp.gmail.com with ESMTPSA id tz1sm402197pbc.50.2015.08.12.18.19.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Aug 2015 18:19:04 -0700 (PDT) From: Bamvor Jian Zhang To: buildroot@busybox.net Date: Thu, 13 Aug 2015 09:16:43 +0800 Message-Id: <1439428605-17453-4-git-send-email-bamvor.zhangjian@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1439428605-17453-1-git-send-email-bamvor.zhangjian@linaro.org> References: <1439428605-17453-1-git-send-email-bamvor.zhangjian@linaro.org> Cc: thomas.petazzoni@free-electrons.com, gustavo.zacarias@free-electrons.com Subject: [Buildroot] [PATCH V3 RESEND 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: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Bamvor Jian Zhang In aarch64, lp64 is the default ABI. Need pass the special flags if the user want to compile and link ilp32 application. Pass the special flags to linker to ensure that linker see the same abi with compiler. Signed-off-by: Bamvor Jian Zhang --- package/Makefile.in | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/package/Makefile.in b/package/Makefile.in index 545694f..fa81b44 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -107,6 +107,17 @@ ifeq ($(BR2_arc)$(BR2_ARC_ATOMIC_EXT),yy) TARGET_ABI += -matomic endif +ifeq ($(BR2_GCC_TARGET_ABI), "ilp32") +ifeq ($(BR2_aarch64)$(BR2_aarch64_be),y) +ifeq ($(BR2_ENDIAN), "BIG") +TARGET_ABI_LDFLAGS += -Xlinker -EB -Xlinker -maarch64linux32b +else +TARGET_ABI_LDFLAGS += -Xlinker -maarch64linux32 +endif +TARGET_ABI += -mabi=ilp32 $(TARGET_ABI_LDFLAGS) +endif +endif + STAGING_SUBDIR = usr/$(GNU_TARGET_NAME)/sysroot STAGING_DIR = $(HOST_DIR)/$(STAGING_SUBDIR) @@ -140,7 +151,7 @@ endif TARGET_CPPFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 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_LDFLAGS) ifeq ($(BR2_BINFMT_FLAT),y) TARGET_CFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),\