Static storage duration objects that are internal to a library instance
should:
- either have internal linkage (i.e., be declared STATIC),
- or, if they are referenced in multiple files of the library instance,
  prefixed with a word that is specific to the library instance, and
  minimizes namespace collisions.

In this case, the "gHiiDriverList" variable (with static storage duration
and external linkage) is defined in both BootMaintenanceManagerUiLib and
UiApp. When these are linked together, GCC catches the multiple external
definitions and aborts the build. (GCC notices this due to commit
214a3b79417f.) Fix the error by applying the first rule above.

Cc: Ard Biesheuvel <ard.biesheu...@linaro.org>
Cc: Eric Dong <eric.d...@intel.com>
Cc: Liming Gao <liming....@intel.com>
Fixes: a85be3ae48a8aaa40b755cd0ff7270c67cfed585
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <ler...@redhat.com>
---
 
MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c
 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c
 
b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c
index 177b2498d3ec..fefb714b9166 100644
--- 
a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c
+++ 
b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c
@@ -26,7 +26,7 @@ typedef struct {
   BOOLEAN         EmptyLineAfter;
 } UI_HII_DRIVER_INSTANCE;
 
-UI_HII_DRIVER_INSTANCE       *gHiiDriverList;
+STATIC UI_HII_DRIVER_INSTANCE       *gHiiDriverList;
 
 
 /**
-- 
1.8.3.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to