From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::143; helo=mail-it1-x143.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it1-x143.google.com (mail-it1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3080E211A6D2F for ; Fri, 21 Dec 2018 03:02:26 -0800 (PST) Received: by mail-it1-x143.google.com with SMTP id h193so5992419ita.5 for ; Fri, 21 Dec 2018 03:02:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ra2B59eD/mzlJvtYHrnLMaIQwJP78F0AGSU2JtFwOBI=; b=KbjBUP3xV0twWRdjJnFR9oqvGMoGYnKnWPXtbyh1wQ5FvuFFCIqzscXhKjVdtSo4+f Ben2pUJFIfjxvEBho/lFfMRZk6Gz28W31eKroTc9G4T34EqQ8HsxNPQ51vDhuEQ2lqtI lYZ+JQFW9ollgE8el5ij3Ut/E5OzKj8LbHqhk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ra2B59eD/mzlJvtYHrnLMaIQwJP78F0AGSU2JtFwOBI=; b=FLDDd6jPJPVZ3dVZZnhwIVJg6G5/GzaXJB7qcSdYgUAa2cihpEX2VMJ7eu8mQ9IGfw XMg4Mge4mkFe7G9vgL5il9XI5MOVSjkbtdbLV9tPHFUFMfUZ0GzZW7kjwd4ksj4lJPhQ xPf4twug54EQhcFhya56L/kCvZInOALHwidak6JCUys7Xwh65ju9u19ZqW06sNrHPtUs MTRbiTFFZFblxP8yLhSYr55scDzlGi0Roo5WVDdrz816Iey5AiWr1k9Bodjualf2P81F RGBJiiIjwv0GpQGI5X+OSYo0MHM9QD7ZyH82a4UbS+JfRxii0JX1VpU7zYFNTQbYjPQ2 IZBw== X-Gm-Message-State: AA+aEWYWPCyjGc7rHpOs9sUEYWET5bbnBADRSncywBf2LixJoqZKCmZl Zg5OTnCKPTXEaCUkoeQXVKvBQvPrI5mfe0rGRBBXWGX0ri0= X-Google-Smtp-Source: AFSGD/VBYLJ3UraNq/2PA9/96e8uQeIUM2giPzABuSJsP9cB419cpDnOXLx+QphxYetOdXV8yB3nfan6B+NlJ69eGF0= X-Received: by 2002:a02:183:: with SMTP id 3mr1210462jak.130.1545390145723; Fri, 21 Dec 2018 03:02:25 -0800 (PST) MIME-Version: 1.0 References: <20181220110332.30145-1-ard.biesheuvel@linaro.org> In-Reply-To: <20181220110332.30145-1-ard.biesheuvel@linaro.org> From: Ard Biesheuvel Date: Fri, 21 Dec 2018 12:02:12 +0100 Message-ID: To: "edk2-devel@lists.01.org" Cc: Leif Lindholm , "Gao, Liming" Subject: Re: [PATCH v2] BaseTools/tools_def ARM: use softfloat target for CLANG3x X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 11:02:27 -0000 Content-Type: text/plain; charset="UTF-8" On Thu, 20 Dec 2018 at 12:03, Ard Biesheuvel wrote: > > The 'arm-linux-gnueabihf' target triplet we use for CLANG35 and > CLANG38 specifies a hardfloat target, and so the binaries that are > emitted are annotated as using VFP registers for passing floating > point arguments, even though no VFP is used anywhere in the code. > > This works fine as long as we don't try to link against code > that uses software floating point, but combining object files > with different floating point calling conventions is not permitted. > > So switch to the softfloat arm-linux-gnueabi triplet instead. > This affects both the name Clang uses when invoking the linker, > and the arguments it passes to it, and we are mostly interested > in the latter (since any version of GNU ld.bfd will do the right > thing as long as it targets EABI ARM) > > For native builds, this change has no effect, since the unprefixed > system linker will take priority, and so Clang will pass the right > arguments to whichever linker happens to be the system linker. > > For cross builds, the fact that Clang composes the name of the > linker by prefixing '-ld' with the target triplet implies that > users will have to switch to a version of binutils that targets > arm-linux-gnueabi rather than arm-linux-gnueabihf. Note that the > GCCx toolchain targets can use either when building for ARM so this > does not create a need to install two versions of the ARM cross > toolchain. Also, note that all ARM toolchains in the GCC family > are already documented as requiring a toolchain that targets > arm-linux-gnueabi and not arm-linux-gnueabihf. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard Biesheuvel > --- > v2: improve commit log > Liming, Leif: are there any remaining concerns with this patch? > BaseTools/Conf/tools_def.template | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template > index 902680c24c85..f7eb87af14c2 100755 > --- a/BaseTools/Conf/tools_def.template > +++ b/BaseTools/Conf/tools_def.template > @@ -5231,7 +5231,7 @@ RELEASE_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 > *_CLANG35_*_DLINK_PATH = ENV(CLANG35_BIN)clang > *_CLANG35_*_ASLDLINK_PATH = ENV(CLANG35_BIN)clang > > -DEFINE CLANG35_ARM_TARGET = -target arm-linux-gnueabihf > +DEFINE CLANG35_ARM_TARGET = -target arm-linux-gnueabi > DEFINE CLANG35_AARCH64_TARGET = -target aarch64-linux-gnu > > DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -Wno-unknown-warning-option > @@ -5384,7 +5384,7 @@ NOOPT_CLANG38_X64_DLINK2_FLAGS = DEF(GCC5_X64_DLINK2_FLAGS) -O0 > ################## > # CLANG38 ARM definitions > ################## > -DEFINE CLANG38_ARM_TARGET = -target arm-linux-gnueabihf > +DEFINE CLANG38_ARM_TARGET = -target arm-linux-gnueabi > DEFINE CLANG38_ARM_CC_FLAGS = DEF(GCC_ARM_CC_FLAGS) DEF(CLANG38_ARM_TARGET) DEF(CLANG38_WARNING_OVERRIDES) -mno-movt > DEFINE CLANG38_ARM_DLINK_FLAGS = DEF(CLANG38_ARM_TARGET) DEF(GCC_ARM_DLINK_FLAGS) > > -- > 2.19.2 >