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.151; helo=mga17.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (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 A233A21962301 for ; Wed, 15 Aug 2018 08:54:48 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2018 08:54:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,243,1531810800"; d="scan'208";a="66404347" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga006.jf.intel.com with ESMTP; 15 Aug 2018 08:54:47 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 15 Aug 2018 08:54:46 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 15 Aug 2018 08:54:46 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.143]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.240]) with mapi id 14.03.0319.002; Wed, 15 Aug 2018 23:54:44 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [Patch] BaseTools: Update the rule to remove .lib before link it for GCC Thread-Index: AQHUL4AMjJztai3wSEWDR0v6zi3UnaTBAYlA Date: Wed, 15 Aug 2018 15:54:43 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E2E3936@SHSMSX104.ccr.corp.intel.com> References: <1533777981-492-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1533777981-492-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTc0YmIzYjQtZTVmYy00ZGI4LWFhYzMtYTU0Y2I0ZmRkZWE0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWnhCVitSdTNzV09IWTVIMG56TmpXWHNOZHp6cmdWcm5nSnc4MWlRTXNIMlVzRFpCbklaeW4wZUhXekJvZldZYiJ9 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: Update the rule to remove .lib before link it for GCC X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Aug 2018 15:54:48 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zh= u, Yonghong > Sent: Wednesday, August 8, 2018 6:26 PM > To: edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: [edk2] [Patch] BaseTools: Update the rule to remove .lib before = link it for GCC >=20 > We met a case on GCC toolchain for increment build. the case is user > build Helloworld first, then rename the source file Helloworld.c to > Helloworld_new.c and also update the file name to Helloworld_new.c in > .inf file's [sources] section. finally, he rebuild it again. > It cause build failure due to multiple definition of `UefiMain' because > in the .lib file it both have Helloworld.obj and Helloworld_new.obj. > current we use the option 'cr' to create the .lib file while the 'r' > cmd means replace existing or insert new files into the archive. so > in this patch before we create the .lib file, we delete it first. >=20 > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Yonghong Zhu > --- > BaseTools/Conf/build_rule.template | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/BaseTools/Conf/build_rule.template b/BaseTools/Conf/build_ru= le.template > index b2667c2..ed54a55 100755 > --- a/BaseTools/Conf/build_rule.template > +++ b/BaseTools/Conf/build_rule.template > @@ -1,7 +1,7 @@ > # > -# Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved. > +# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved. > # Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved. > # This program and the accompanying materials > # are licensed and made available under the terms and conditions of the= BSD License > # which accompanies this distribution. The full text of the license ma= y be found at > # http://opensource.org/licenses/bsd-license.php > @@ -267,10 +267,11 @@ >=20 > > "$(SLINK)" $(SLINK_FLAGS) /OUT:${dst} @$(OBJECT_FILES_LIST) >=20 > > + $(RM) ${dst} > "$(SLINK)" cr ${dst} $(SLINK_FLAGS) @$(OBJECT_FILES_LIST) >=20 > > "$(SLINK)" $(SLINK_FLAGS) ${dst} --via $(OBJECT_FILES_LIST) >=20 > -- > 2.6.1.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel