From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::443; helo=mail-wr1-x443.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (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 83FA5211A2D8E for ; Sat, 22 Dec 2018 04:03:09 -0800 (PST) Received: by mail-wr1-x443.google.com with SMTP id q18so7697134wrx.9 for ; Sat, 22 Dec 2018 04:03:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4z+XcEojC4oe0TwYD5kkwYpM6FaGoL0ycSWNNWJCDyE=; b=UnB+RDs+Gxb60XUgXsDatI6VDezWb3J+ft0GlhZb+SehITS7YxcU7/51yUcmab3zwl M1zh0ufVjTQk0lsgxdq76bCrNvamo2itUzEV4JhACezZe4ioGFWHn9qhPJS63Y0J70BY UD3JqjJGzz+bxspdcG652Zi17KSyZ2dUBmg0s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=4z+XcEojC4oe0TwYD5kkwYpM6FaGoL0ycSWNNWJCDyE=; b=Afpo73hMZR/Im9mZ/T4qTVSRBs0/RYzOH4BAqJRDUm5kqQm8xKH61cg0Qf9LMjBN9G RH44F9OKYIKnu3aQbDR9Py0rMsmOs0mto/NUfoQN5K1mv214+0KH2w+sF+R7Yy1hXh/z b0zcb1VcxUCKdWnFCxjRMRb1wYJGfDsdu2bYz8fGU6BrN78w+Z4cmST8sXrUIxMXVkkc chmrSn62US7LH3c2cqwrnwPoBP5JjXr5h8BnX5uskm9MDKkpm9NuGxB4CHC4zA7K45v6 Wp78KpBsUMxYTxGP4ZXfgrNSmJEaI5Cy71+XM75rV2ZJ5bNamD+uSgez572bYPYHQUOQ Fz1g== X-Gm-Message-State: AJcUukfeM6fG1/rVLxfMAZOd3m+zufe7DKJ2GJUdWIT2WOBd5qCISLvQ G2a7yYiCTGDVUL5adVFhQFK+Qw== X-Google-Smtp-Source: ALg8bN7K0UJzennXthoBE4AmrgfZuIzJA4sMo5Q9LMAag9TxtuYkl52fYt7mNF9PbpMRFQhpXC8Izw== X-Received: by 2002:adf:a50c:: with SMTP id i12mr5748692wrb.220.1545480187625; Sat, 22 Dec 2018 04:03:07 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id j24sm15584767wrd.86.2018.12.22.04.03.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 Dec 2018 04:03:06 -0800 (PST) Date: Sat, 22 Dec 2018 12:03:04 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, liming.gao@intel.com Message-ID: <20181222120304.6gan6eh7voc554h5@bivouac.eciton.net> References: <20181220110332.30145-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20181220110332.30145-1-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) 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: Sat, 22 Dec 2018 12:03:09 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Dec 20, 2018 at 12:03:32PM +0100, 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 Reviewed-by: Leif Lindholm > --- > v2: improve commit log > > 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 >