From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.32898.1649064768986813100 for ; Mon, 04 Apr 2022 02:32:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QAt3UJab; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649064768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gApo8eE2KrzV4BWIIC9xaS3awGcB1F22Sqwb1pFk5mA=; b=QAt3UJabWLqWB4a1Lbo5vzmGDrWD1OAqOxI8Z+Q3r+sLOKsSP2jaoNRV5sLuVdC2T1vC/X mBl+2lgIO8FPOMFQnbsPIaFnQaMXDW/AFPFnIcgFXPgMV2SsLxS5/pN0ZeRGLzWPIRf75r GtCth4reA88VrXKphZJ5U33l71FP9K0= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-582-fXUR13sYPVaoOBurlQOVTQ-1; Mon, 04 Apr 2022 05:32:44 -0400 X-MC-Unique: fXUR13sYPVaoOBurlQOVTQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AFE5B1C04B6C; Mon, 4 Apr 2022 09:32:43 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.194.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5EDBD404D91E; Mon, 4 Apr 2022 09:32:40 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 00A59180062D; Mon, 4 Apr 2022 11:32:29 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Yuwei Chen , Liming Gao , Pawel Polawski , Bob Feng , Oliver Steffen , Rebecca Cran , Gerd Hoffmann Subject: [PATCH v3 2/3] BaseTools: adapt comniler checks mmacros for edk2 Date: Mon, 4 Apr 2022 11:32:28 +0200 Message-Id: <20220404093229.1971782-3-kraxel@redhat.com> In-Reply-To: <20220404093229.1971782-1-kraxel@redhat.com> References: <20220404093229.1971782-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true edk2 BaseTools use BUILD_CC not CC. Update the check macros accordingly so they actually work with BaseTools. Signed-off-by: Gerd Hoffmann --- BaseTools/Source/C/Makefiles/compiler.makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/BaseTools/Source/C/Makefiles/compiler.makefile b/BaseTools/Source/C/Makefiles/compiler.makefile index b575391c08d6..3337857ca9c5 100644 --- a/BaseTools/Source/C/Makefiles/compiler.makefile +++ b/BaseTools/Source/C/Makefiles/compiler.makefile @@ -18,7 +18,7 @@ cc-cross-prefix = $(firstword $(foreach c, $(1), \ TMPOUT = $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_$$$$ # try-run -# Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise) +# Usage: option = $(call try-run, $(BUILD_CC)...-o "$$TMP",option-ok,otherwise) # Exit code chooses option. "$$TMP" serves as a temporary file and is # automatically cleaned up. try-run = $(shell set -e; \ @@ -34,34 +34,34 @@ try-run = $(shell set -e; \ # Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,) as-option = $(call try-run,\ - $(CC) $(KBUILD_CFLAGS) $(1) -c -x assembler /dev/null -o "$$TMP",$(1),$(2)) + $(BUILD_CC) $(KBUILD_CFLAGS) $(1) -c -x assembler /dev/null -o "$$TMP",$(1),$(2)) # as-instr # Usage: cflags-y += $(call as-instr,instr,option1,option2) as-instr = $(call try-run,\ - printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3)) + printf "%b\n" "$(1)" | $(BUILD_CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3)) # __cc-option -# Usage: MY_CFLAGS += $(call __cc-option,$(CC),$(MY_CFLAGS),-march=winchip-c6,-march=i586) +# Usage: MY_CFLAGS += $(call __cc-option,$(BUILD_CC),$(MY_CFLAGS),-march=winchip-c6,-march=i586) __cc-option = $(call try-run,\ $(1) -Werror $(2) $(3) -c -x c /dev/null -o "$$TMP",$(3),$(4)) # cc-option # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) -cc-option = $(call __cc-option, $(CC),\ +cc-option = $(call __cc-option, $(BUILD_CC),\ $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS),$(1),$(2)) # cc-option-yn # Usage: flag := $(call cc-option-yn,-march=winchip-c6) cc-option-yn = $(call try-run,\ - $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n) + $(BUILD_CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n) # cc-disable-warning # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable) cc-disable-warning = $(call try-run,\ - $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) + $(BUILD_CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) # cc-ifversion # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) @@ -69,7 +69,7 @@ cc-ifversion = $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $(3) || e # ld-option # Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y) -ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3)) +ld-option = $(call try-run, $(BUILD_LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3)) # ld-ifversion # Usage: $(call ld-ifversion, -ge, 22252, y) -- 2.35.1