From: Shinwoo Kim Date: Mon, 18 Mar 2019 04:05:53 +0000 (+0900) Subject: Fix ASAN build error X-Git-Tag: submit/tizen/20190327.041330^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bab3d151b74cf649fcba20c525a3ea972d70dd5f;p=platform%2Fupstream%2Fat-spi2-atk.git Fix ASAN build error There is a build error with following build option for ASAN. $ gbs build -A armv7l --include-all --extra-packs asan-force-options,asan-build-env --define 'asan 1' [Build Error] multiple definition of `child_pid' [How to Fix] This occurs when –fno-common flag is added to compiler (which is default in asan-force-options) some linking may fail with error like above. The reason of the bug is that global is defined in more than one compilation unit without extern or static. When using default –fcommon option global variables with the same name are merged into the same variable without signaling errors. When -fno-common option is enabled all global variables are treated separately as they supposed to be. It means that each global variable should be defined only once. Otherwise means an error in source code and is reported at linking stage. It must be fixed by modifying each declaration as static or merging into an extern declaration and a definition in a single .c file. Change-Id: If913d75c4b212f129e5535eb4f332e7721611215 --- diff --git a/tests/atk_test_util.h b/tests/atk_test_util.h index b2376d5..26462ed 100644 --- a/tests/atk_test_util.h +++ b/tests/atk_test_util.h @@ -36,7 +36,7 @@ #include #include "atk_suite.h" -pid_t child_pid; +static pid_t child_pid; void run_app (const char *file_name); AtspiAccessible *get_root_obj (const char *file_name);