]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Update the rule to remove .lib before link it for GCC
authorYonghong Zhu <yonghong.zhu@intel.com>
Thu, 9 Aug 2018 01:25:09 +0000 (09:25 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Thu, 16 Aug 2018 06:17:29 +0000 (14:17 +0800)
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.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Conf/build_rule.template

index b2667c2bb77ea02a370e9bffc1382ba708edd743..ed54a55842fd9d60d3f93ce05f06f7141ec15c9c 100755 (executable)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 #  Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
         "$(SLINK)" $(SLINK_FLAGS) /OUT:${dst} @$(OBJECT_FILES_LIST)\r
 \r
     <Command.GCC, Command.GCCLD>\r
+        $(RM) ${dst}\r
         "$(SLINK)" cr ${dst} $(SLINK_FLAGS) @$(OBJECT_FILES_LIST)\r
     \r
     <Command.RVCT>\r