From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-03.1984.is (mail-03.1984.is [93.95.224.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2A47A21D1825C for ; Sat, 19 Aug 2017 06:47:04 -0700 (PDT) Received: from localhost by mail-03.1984.is with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.84_2) (envelope-from ) id 1dj480-0008IB-6G; Sat, 19 Aug 2017 13:49:28 +0000 To: Leif Lindholm References: <20170818232959.10578-1-alan@softiron.com> <20170819103722.m3cx2mnaj7idfd64@bivouac.eciton.net> Cc: edk2-devel@lists.01.org, linaro-uefi@lists.01.org From: Alan Ott Message-ID: Date: Sat, 19 Aug 2017 09:49:25 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20170819103722.m3cx2mnaj7idfd64@bivouac.eciton.net> Subject: Re: [PATCH] edk2-build.sh: Use CROSS_COMPILE if it's set externally X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Aug 2017 13:47:04 -0000 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 08/19/2017 06:37 AM, Leif Lindholm wrote: > (Adding linaro-uefi, since this is not official tooling.) Ok, no problem. > On Fri, Aug 18, 2017 at 07:29:59PM -0400, Alan Ott wrote: >> --- >> edk2-build.sh | 8 +++++--- >> 1 file changed, 5 insertions(+), 3 deletions(-) >> >> diff --git a/edk2-build.sh b/edk2-build.sh >> index 60da4df..fb0cb84 100755 >> --- a/edk2-build.sh >> +++ b/edk2-build.sh >> @@ -73,11 +73,13 @@ function do_build >> import_openssl >> fi >> >> - set_cross_compile >> - CROSS_COMPILE="$TEMP_CROSS_COMPILE" >> + if [ -z $CROSS_COMPILE ]; then >> + set_cross_compile >> + CROSS_COMPILE="$TEMP_CROSS_COMPILE" >> + fi >> >> echo "Building $PLATFORM_NAME - $PLATFORM_ARCH" >> - echo "CROSS_COMPILE=\"$TEMP_CROSS_COMPILE\"" >> + echo "CROSS_COMPILE=\"$CROSS_COMPILE\"" >> echo "$board"_BUILDFLAGS="'$PLATFORM_BUILDFLAGS'" >> >> if [ "$TARGETS" == "" ]; then > Sorry, can't accept this one. > > I use this script to build multiple platforms across multiple > architectures in one go, and this change breaks that. I see now that it's in do_build() which is called for each platform built, so yes, my patch won't work. Sorry :( > But also, do you really need it? Cross compilers accessible on the > PATH should be automatically detected. Yes, I can do this.[1] > If you do need it, because you're using some non-standard toolchain > (such as aarch64-none-eabi), I would like to see something like what > exists (in semi-broken form) in uefi-build.sh: CROSS_COMPILE_32 vs > CROSS_COMPILE_64. However, in order to be useful, that would need to > be extended to do a per-architecture override: > CROSS_COMPILE_AARCH64 > CROSS_COMPILE_ARM > CROSS_COMPILE_IA32 > CROSS_COMPILE_X64 Yes, I was incorrectly thinking it was intended to be similar to uefi-build.sh and didn't look closely enough. Sorry for the extra noise, Alan. [1] For what it's worth I've gotten into the habit of specifying the full path in CROSS_COMPILE when cross compiling things which build this way (kernels, u-boots, etc). It makes typos fail early and operates independently of my actual PATH, preventing a mistyped or missing path entry from causing it to use a compiler down the list in the system or user path.