Commit
6bdb1d31afd6d67460ae1fdc105122dba1042d20 introduced changes
in the structure gcov_info, that were incompatible with mainline gcc.
This patch #ifdefs the changes with ANDROID_GCOV, that is defined by
android toolchain only.
Source of this structure is ${GCC}/gcc/coverage.c, function
build_info_type
Bug
200251313
Bug
200166422
Bug
200264826
Change-Id: Id4052679c0bee7d9ea406ffc6e4ae64fe84c06cb
Signed-off-by: dmitry pervushin <dpervushin@nvidia.com>
Reviewed-on: http://git-master/r/
1259013
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
endchoice
+config GCOV_ANDROID_TOOLCHAIN
+ bool "Android toolchain is used to build the kernel"
+ default y if ANDROID
+ ---help---
+ Android toolchain defines extra fields in gcov_info structure.
+ If you compile the kernel for Android, say Y here
+ If your gcc is without android patches, say N
+ We default it to Y in case of CONFIG_ANDROID is defined, but please
+ verify which toolchain is in use (gcc/coverage.c, build_info)
+
endmenu
#include <linux/vmalloc.h>
#include "gcov.h"
+/*
+ * define ANDROID_GCOV if:
+ * gcc version >= 4.8 and CONFIG_GCOV_ANDROID_TOOLCHAIN is defined
+ * Once android toolchain evolves, more cases to define ANDROID_GCOV
+ * should be added
+ */
+#ifdef CONFIG_GCOV_ANDROID_TOOLCHAIN
+# if __GNUC__ == 4 && __GNUC_MINOR__ >= 8
+# define ANDROID_GCOV
+# endif
+#endif
+
#if __GNUC__ == 5 && __GNUC_MINOR__ >= 1
#define GCOV_COUNTERS 10
#elif __GNUC__ == 4 && __GNUC_MINOR__ >= 9
+#ifdef ANDROID_GCOV
#define GCOV_COUNTERS 11
#else
+#define GCOV_COUNTERS 9
+#endif
+#else
#define GCOV_COUNTERS 8
#endif
*/
struct gcov_info {
unsigned int version;
+#ifdef ANDROID_GCOV
void *mod_info;
+#endif
struct gcov_info *next;
unsigned int stamp;
const char *filename;
+#ifdef ANDROID_GCOV
unsigned int eof_pos;
+#endif
void (*merge[GCOV_COUNTERS])(gcov_type *, unsigned int);
unsigned int n_functions;
struct gcov_fn_info **functions;
+#ifdef ANDROID_GCOV
char **build_info;
+#endif
};
/**