Fix multiple define error 79/267079/4
authorSeungha Son <seungha.son@samsung.com>
Thu, 25 Nov 2021 05:38:27 +0000 (14:38 +0900)
committerSeungha Son <seungha.son@samsung.com>
Thu, 25 Nov 2021 06:08:50 +0000 (15:08 +0900)
 This problem is met during build as ASAN.
 Add global variable '_rdp_log_dom' to extern keyword.
 The global variable in a header file, then this definition
 will go to every c file that includes this header, and
 will get multiple define error.

 Error log :
 [   79s] /usr/lib/gcc/armv7l-tizen-linux-gnueabi/9.2.0/../../../../armv7l-tizen-linux-gnueabi/bin/ld: .libs/module_la-e_mod_rdp.o:/home/abuild/rpmbuild/BUILD/e-mod-tizen-rdp-0.1.2/src/e_mod_rdp.h:26: multiple definition of `_rdp_log_dom'; .libs/module_la-e_mod_main.o:/home/abuild/rpmbuild/BUILD/e-mod-tizen-rdp-0.1.2/src/e_mod_rdp.h:26: first defined here
[   79s] /usr/lib/gcc/armv7l-tizen-linux-gnueabi/9.2.0/../../../../armv7l-tizen-linux-gnueabi/bin/ld: .libs/module_la-e_mod_rdp_conf.o:(.bss.__odr_asan._rdp_log_dom+0x0): multiple definition of `__odr_asan._rdp_log_dom'; .libs/module_la-e_mod_main.o:(.bss.__odr_asan._rdp_log_dom+0x0): first defined here

Change-Id: Iee56a971302625818745e390e4235f12f80cb5b6
Signed-off-by: Seungha Son <seungha.son@samsung.com>
src/e_mod_main.c
src/e_mod_rdp.h

index 123a744..e9b00ff 100644 (file)
@@ -10,6 +10,7 @@
  * safely) */
 EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "RDP-Module" };
 
+int _rdp_log_dom = -1;
 const static char *_rdp_log_dom_name = "e-rdp";
 
 EAPI void *
index 8c2633b..6b8f386 100644 (file)
@@ -23,7 +23,7 @@
 # undef CRI
 #endif
 
-int _rdp_log_dom;
+extern int _rdp_log_dom;
 #define DBG(...)  EINA_LOG_DOM_DBG(_rdp_log_dom, __VA_ARGS__)
 #define INF(...)  EINA_LOG_DOM_INFO(_rdp_log_dom, __VA_ARGS__)
 #define WRN(...)  EINA_LOG_DOM_WARN(_rdp_log_dom, __VA_ARGS__)