From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 98442210F93DF for ; Wed, 22 Aug 2018 09:35:12 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2018 09:35:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,274,1531810800"; d="scan'208";a="84026057" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga001.jf.intel.com with ESMTP; 22 Aug 2018 09:34:58 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 22 Aug 2018 09:34:58 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.143]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.150]) with mapi id 14.03.0319.002; Thu, 23 Aug 2018 00:34:56 +0800 From: "Gao, Liming" To: Laszlo Ersek , edk2-devel-01 Thread-Topic: [PATCH] BaseTools/VfrCompile: honor EXTRA_LDFLAGS Thread-Index: AQHUNdNbWxSx6x5/ZUW0QrvCb1TCmqTMAFJA Date: Wed, 22 Aug 2018 16:34:54 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E2E7773@SHSMSX104.ccr.corp.intel.com> References: <20180817023802.7474-1-lersek@redhat.com> In-Reply-To: <20180817023802.7474-1-lersek@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZmNhOTM4M2MtZjg4Ni00YmExLTk5ODgtMmYwMTBhNTM5OGIxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZVBzc05NeUR2d3lzVlc2N1NyNE9iMHE4QzZHeWJrbW1FSEtaeWNieFBzeGhKeGg5ZjFUaitUNHBUWUJtbkNheCJ9 dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] BaseTools/VfrCompile: honor EXTRA_LDFLAGS 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: Wed, 22 Aug 2018 16:35:12 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao And, push at aa4e0df1f0c7ffdff07d7e382c9da89cbe207cdb Thanks Liming > -----Original Message----- > From: Laszlo Ersek [mailto:lersek@redhat.com] > Sent: Thursday, August 16, 2018 7:38 PM > To: edk2-devel-01 > Cc: Gao, Liming ; Zhu, Yonghong > Subject: [PATCH] BaseTools/VfrCompile: honor EXTRA_LDFLAGS >=20 > In commit 81502cee20ac ("BaseTools/Source/C: take EXTRA_LDFLAGS from the > caller", 2018-08-16), I missed that "VfrCompile/GNUmakefile" does not use > BUILD_LFLAGS in the APPLICATION linking rule, unlike "app.makefile" does. > Instead, "VfrCompile/GNUmakefile" uses the (undefined) LFLAGS macro. > Therefore commit 81502cee20ac did not cover the linking step of > VfrCompile. >=20 > Thankfully, the structure of the linking rules is the same, between > "app.makefile" and "VfrCompile/GNUmakefile". Rename the undefined LFLAGS > macro in "VfrCompile/GNUmakefile" to VFR_LFLAGS (for consistency with > VFR_CXXFLAGS), and set it to EXTRA_LDFLAGS. >=20 > As a result, we have: >=20 > | compilation | linking > -----------+--------------------------------+---------------------- > VfrCompile | VFR_CXXFLAGS =3D | VFR_LFLAGS =3D > | BUILD_OPTFLAGS =3D | EXTRA_LDFLAGS > | '-O2' + EXTRA_OPTFLAGS | > -----------+--------------------------------+---------------------- > other apps | BUILD_CFLAGS/BUILD_CXXFLAGS =3D | BUILD_LFLAGS =3D > | [...] + BUILD_OPTFLAGS =3D | [...] + EXTRA_LDFLAGS > | [...] + '-O2' + EXTRA_OPTFLAGS | >=20 > This table shows > - that the VfrCompile compilation and linking flags are always a subset o= f > the corresponding flags used by the other apps, > - and that the EXTRA flags are always at the end. >=20 > Cc: Liming Gao > Cc: Yonghong Zhu > Ref: https://bugzilla.redhat.com/show_bug.cgi?id=3D1540244 > Fixes: 81502cee20ac4046f08bb4aec754c7091c8808dc > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Laszlo Ersek > --- >=20 > Notes: > Repo: https://github.com/lersek/edk2.git > Branch: extra_flags_rhbz1540244_round2 >=20 > BaseTools/Source/C/VfrCompile/GNUmakefile | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/BaseTools/Source/C/VfrCompile/GNUmakefile b/BaseTools/Source= /C/VfrCompile/GNUmakefile > index bbe562cbc54f..9273589ff805 100644 > --- a/BaseTools/Source/C/VfrCompile/GNUmakefile > +++ b/BaseTools/Source/C/VfrCompile/GNUmakefile > @@ -28,6 +28,9 @@ VFR_CPPFLAGS =3D -DPCCTS_USE_NAMESPACE_STD $(BUILD_CPPF= LAGS) > # keep BUILD_OPTFLAGS last > VFR_CXXFLAGS =3D $(BUILD_OPTFLAGS) >=20 > +# keep EXTRA_LDFLAGS last > +VFR_LFLAGS =3D $(EXTRA_LDFLAGS) > + > LINKER =3D $(BUILD_CXX) >=20 > EXTRA_CLEAN_OBJECTS =3D EfiVfrParser.cpp EfiVfrParser.h VfrParser.dlg Vf= rTokens.h VfrLexer.cpp VfrLexer.h VfrSyntax.cpp tokens.h > @@ -42,7 +45,7 @@ APPLICATION =3D $(MAKEROOT)/bin/$(APPNAME) > all: $(MAKEROOT)/bin $(APPLICATION) >=20 > $(APPLICATION): $(OBJECTS) > - $(LINKER) -o $(APPLICATION) $(LFLAGS) $(OBJECTS) -L$(MAKEROOT)/libs $(L= IBS) > + $(LINKER) -o $(APPLICATION) $(VFR_LFLAGS) $(OBJECTS) -L$(MAKEROOT)/libs= $(LIBS) >=20 > VfrCompiler.o: ../Include/Common/BuildVersion.h >=20 > -- > 2.14.1.3.gb7cf6e02401b