Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48CB2C433DB for ; Mon, 22 Mar 2021 12:05:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0FFF46198D for ; Mon, 22 Mar 2021 12:05:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230354AbhCVMFD (ORCPT ); Mon, 22 Mar 2021 08:05:03 -0400 Received: from mail2.protonmail.ch ([185.70.40.22]:31664 "EHLO mail2.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230366AbhCVMEx (ORCPT ); Mon, 22 Mar 2021 08:04:53 -0400 Date: Mon, 22 Mar 2021 12:04:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1616414690; bh=AFgCbLguriV3CwFF1nhSPTfmyyoAQpRcEnd0zBssKuA=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=R2bsUqhAg7Fb96oKF1Og1ulpJbeTnxg9Y4uLtwnit83vvh+9uG8Nj3KGjQyjUaZLT ikLY5u/4aOVlDvfJARcJxogpArdlynErRRX8V5/fp561LEUK8LeB2dn8E7MAR0hxsS xBwLtBEqYJ508r6yD5t1DYRVXjGprSBF/Yqt/KZ7zEywTVG/GMbC9+ATTmQ7/uNtHA eFC7xLk5UUIO/0GHIFgmbR8smuGILktzsL545NR2h+78m1pQfSabQ1CF/oWLuDRP2K ETKrOCCrmL8qkf/qeRziA0e8cL0VbN1Da+8EyJpoGAglypHPZAjhog9mXW+FumsQDE k+5sAKgbGuR4w== To: Paul Cercueil From: Alexander Lobakin Cc: Alexander Lobakin , Paul Burton , Thomas Bogendoerfer , Nathan Chancellor , Nick Desaulniers , od@zcrc.me, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Reply-To: Alexander Lobakin Subject: [PATCH] MIPS: generic: Support linking with LLVM ld.lld Message-ID: <20210322120429.3706-1-alobakin@pm.me> In-Reply-To: <20210321131805.98422-1-paul@crapouillou.net> References: <20210321131805.98422-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org From: Paul Cercueil Date: Sun, 21 Mar 2021 13:18:05 +0000 > LLVM's ld.lld chokes on the 64-bit sign-extended load addresses. Use > 32-bit addresses if the linker is LLVM's ld.lld. > > Signed-off-by: Paul Cercueil > --- > arch/mips/generic/Platform | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/mips/generic/Platform b/arch/mips/generic/Platform > index b871af16b5b6..19b7d92a4ca7 100644 > --- a/arch/mips/generic/Platform > +++ b/arch/mips/generic/Platform > @@ -12,8 +12,8 @@ > cflags-$(CONFIG_MACH_INGENIC_SOC)=09+=3D -I$(srctree)/arch/mips/include/= asm/mach-ingenic > cflags-$(CONFIG_MIPS_GENERIC)=09+=3D -I$(srctree)/arch/mips/include/asm/= mach-generic > > -load-$(CONFIG_MIPS_GENERIC)=09+=3D 0xffffffff80100000 > -zload-$(CONFIG_MIPS_GENERIC)=09+=3D 0xffffffff81000000 > +load-$(CONFIG_MIPS_GENERIC)=09=09+=3D $(if $(CONFIG_LD_IS_LLD),0x8010000= 0,0xffffffff80100000) > +zload-$(CONFIG_MIPS_GENERIC)=09+=3D $(if $(CONFIG_LD_IS_LLD),0x81000000,= 0xffffffff81000000) > all-$(CONFIG_MIPS_GENERIC)=09:=3D vmlinux.gz.itb For load-y, it's handled in arch/mips/Makefile:289 arch-wide. For zload-y, it's not handled at all, but the proper way to do this is to add a similar to load-ld logics in arch/mips/boot/compressed/Makefile. > its-y=09=09=09=09=09:=3D vmlinux.its.S > -- > 2.30.2 Thanks, Al