|
From: Vineet G. <Vin...@sy...> - 2012-11-23 11:09:57
|
Hi,
I'm building the current tip of OProfile (from git) against uClibc
0.9.30.3 - I know it's a dated a version, but the issue will happen on
any recent uClibc.
Build seems to be failing for not availability of query_module.
-------------->8-------------------
liblegacy/liblegacy.a(opd_kernel.o): In function `opd_drop_module_sample':
/home/vineetg/arc/github/oprofile/daemon/liblegacy/opd_kernel.c:283:
undefined reference to `query_module'
/home/vineetg/arc/github/oprofile/daemon/liblegacy/opd_kernel.c:297:
undefined reference to `query_module'
-------------->8-------------------
uClibc only provides this symbol if UCLIBC_LINUX_MODULE_24, but obvious
that can't be enabled in my setup we are actually using a 3.2 kernel.
The correct fix would be to have a configure option to disable
any 2.4 isms at oprofile build time - which I presume doesn't already
exist - from the looks of configure script. So in the short term will an
equivalent of following be sufficient.
diff --git a/daemon/liblegacy/p_module.h b/daemon/liblegacy/p_module.h
index 9367508..06f1bad 100644
--- a/daemon/liblegacy/p_module.h
+++ b/daemon/liblegacy/p_module.h
@@ -182,7 +182,8 @@ struct module_info
#define NEW_MOD_INITIALIZING 64
int sys_init_module(char const * name, const struct module *);
-int query_module(char const * name, int which, void *buf, size_t bufsize,
+int __attribute__((weak))
+query_module(char const * name, int which, void *buf, size_t bufsize,
size_t *ret);
I can cook a formal patch if people agree or a completely different one.
Note that others have ran into this issue in the past as well. .e.g.
http://lists.uclibc.org/pipermail/uclibc/2009-February/042054.html
Other projects have to add their own workarounds. It would be nice if
Oprofile fixes this once-n-for-all.
FWIW this is for ARC architecture currently discussed on lkml for inclusion
Thx,
-Vineet
|