From patchwork Tue Oct 3 20:58:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9983545 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7401660365 for ; Tue, 3 Oct 2017 20:58:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BC32285B6 for ; Tue, 3 Oct 2017 20:58:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 609D628A2A; Tue, 3 Oct 2017 20:58:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E1691285B6 for ; Tue, 3 Oct 2017 20:58:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=gOjMRvs6ef7n+febaes/DWqvsCrZI5CNwiCzzEraS9w=; b=la6 hkxDFRcmQVNRZuGw0lMTAb/J3FlgJqeaVsP2WyQwg2Vp3xm3m3hwQCZhIzO85RK0RfeDkLjVIu7Qz zuD/vRy7tOQf5uAEGzhQBSxSelYYq4MTQyd9li2FIsNOD6FIcqDwBO7w1LmL6VFibcl+RbugmJP7M Ekp5IVT+shpsxrqLRgScNYXjQGLo/RH5vhn+R+5U4ETdrxSMN2oNaLblJ9kKSEvEbkeIIDWd0R0VA 0Gw7VU4xQi1EPmVmaPBvHVIdDFC3ys7RilNs/JgSGLajz3zCTO0HLVij9mqww8JfueBWhcN9I1IJS h5+L01MWYKgwZXGBy7KQywb3baqUmqw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dzUHB-000334-H8; Tue, 03 Oct 2017 20:58:49 +0000 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dzUH8-00030P-5Y for linux-arm-kernel@lists.infradead.org; Tue, 03 Oct 2017 20:58:47 +0000 Received: by mail-pf0-x241.google.com with SMTP id m28so10163390pfi.0 for ; Tue, 03 Oct 2017 13:58:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=e0ppQSRi5HaStG5ZN+LvKVYEkgPVauzO6wejS2XPn1U=; b=os+J1TTEHotk+0Vl1ZxbivVmR1AZe5DZ+LeXXP1vSKkHu+ikbw03GAZLtRef+fTaWH xU36Mbx2zZydeoAXlkxWSVCkcAMRWeBCf20LzxODOSZ7w+igIzUAkwEcvgTmSuSIwvW+ G3ct2Y1lRIuPcWOuXqTkDBtouxzdHJIAzR2KQ4dAyRcN51MgcIkqVM55Eb0elFIRmQC4 gkdC0as8MjnORfZo6nxtvo5P2HoLMvMF5GoklXmqTryfFwhoO4ap0TGhRyvyRjCgN5Ij at3wzMGcNXoGcxcs8Z661VBGWlxJ+XA+/1ry8ifd9U1JvYQzwMKS6C07lJwYo3/NgoFZ /Oog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=e0ppQSRi5HaStG5ZN+LvKVYEkgPVauzO6wejS2XPn1U=; b=oVgXqbFfktYJUfqBO3OBzvYK2akprPoOfpttaSSswFV27gKRmGfiltrJ4wT9HrjKNv C++Y/yIyn9VYKFqEjoyXo+vyXvT19+SlnqGDZqK7ZjI9np9lvEgDPMypiA/GPxerYskJ H8+tKpqip6fAIkGa6lPPz+fTvNerW4mwRDZ14jh897pSWhK3rI9FKFwc2PqYJgvnnMbl H91jyRcu7Zprge8CFiDhEtglf1vAfRfOsAqHoG5VEAwWUnfIAf2lM1ZyCKdJwqMNwkj4 Wbn4uzfCGJYaaBRuDUmFTFTJuBqvaLPtZh2ADfL4OmHGM/OPohms0rNliqD1FCsD2zsA 86+g== X-Gm-Message-State: AHPjjUg6X5yElAqVco1t4H/6d+bBDNjNUXvV1Nk0GDx58uYrjvWoLSX2 sM/dkzMsVQ47AhOrd+jjB80= X-Google-Smtp-Source: AOwi7QBSEPMZJTQRZMji18/Y+o4k9gYwKvdijuUgmbeH8xDTFt7mJ/+09MR++u2C03CnNXFK/oSaxw== X-Received: by 10.159.204.147 with SMTP id t19mr18061892plo.242.1507064305284; Tue, 03 Oct 2017 13:58:25 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id s4sm19586144pgr.32.2017.10.03.13.58.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Oct 2017 13:58:24 -0700 (PDT) From: Guenter Roeck To: Catalin Marinas Subject: [PATCH] arm64: Enforce endianness build flags for LD and AS Date: Tue, 3 Oct 2017 13:58:22 -0700 Message-Id: <1507064302-3972-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171003_135846_249757_DF44AC59 X-CRM114-Status: GOOD ( 10.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Guenter Roeck , Will Deacon , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Douglas Anderson MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP If LD or AS is specified on the command line using "make LD=", the endianness flag will not be added. Depending on the toolchain used, this can result in endianness mismatch errors, such as aarch64-cros-linux-gnu/binutils-bin/2.27.0/ld.bfd.real: arch/arm64/crypto/.tmp_aes-ce-cipher.o: compiled for a big endian system and target is little endian The problem was observed when using the Chrome OS build system (which sets LD on the command line) for an arm64:allmodconfig build. Use the override flag for both LD and AS to ensure that the endianness flag is always set. Cc: Douglas Anderson Signed-off-by: Guenter Roeck Reviewed-by: Douglas Anderson --- arch/arm64/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 939b310913cf..d780d00bea9c 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -56,15 +56,15 @@ KBUILD_AFLAGS += $(call cc-option,-mabi=lp64) ifeq ($(CONFIG_CPU_BIG_ENDIAN), y) KBUILD_CPPFLAGS += -mbig-endian CHECKFLAGS += -D__AARCH64EB__ -AS += -EB -LD += -EB +override AS += -EB +override LD += -EB LDFLAGS += -maarch64linuxb UTS_MACHINE := aarch64_be else KBUILD_CPPFLAGS += -mlittle-endian CHECKFLAGS += -D__AARCH64EL__ -AS += -EL -LD += -EL +override AS += -EL +override LD += -EL LDFLAGS += -maarch64linux UTS_MACHINE := aarch64 endif