The build is broken on ppc64 functionality, doesn't seem usefull on arch != than ppc64 ?
/../../oprofile/libop/op_cpu_type.c:259:39: error: 'AT_BASE_PLATFORM' undeclared (first use in this function)
cat AT_BASE_PLATFORM.patch
--- /home/sah0027//oprofile/libop/op_cpu_type.c 2013-07-08 15:59:08.042966482 +0200
+++ /home/sah0027/ubuntu/worksets/5.1_build16_generic/sources/opensource/other/oprofile/vendor/oprofile.sourceforge.net/MAIN//oprofile/libop/op_cpu_type.c 2013-07-08 16:06:42.862973856 +0200
@@ -176,6 +176,7 @@ static char * _get_cpuinfo_cpu_type(char
return _get_cpuinfo_cpu_type_line(buf, len, prefix, 1);
}
+#ifdef PPC64
// The aux vector stuff below is currently only used by ppc64 arch
static ElfW(auxv_t) * auxv_buf = NULL;
@@ -221,7 +222,6 @@ static ElfW(auxv_t) * _auxv_fetch()
return (ElfW(auxv_t) *)auxv_temp;
}
-
static const char * fetch_at_hw_platform(ElfW(Addr) type)
{
int i = 0;
@@ -249,12 +249,14 @@ static void release_at_hw_platform(void)
auxv_buf = NULL;
}
}
+#endif
static op_cpu _try_ppc64_arch_generic_cpu(void)
{
What build problem are you having, specifically? No one else has reported problems on non-ppc64 architectures. What architecture and distro are you building on?
I am building on a cross-toolchain mipsel-uclibc-gcc 4.5.3 , and my pc is ubuntu 12.04 64bits.
Regards,
Frédéric
De : Maynard Johnson maynardj@users.sf.net
À : [oprofile:bugs] 245@bugs.oprofile.p.re.sf.net
Envoyé le : Lundi 8 juillet 2013 17h07
Objet : [oprofile:bugs] #245 git build on 'AT_BASE_PLATFORM'
What build problem are you having, specifically? No one else has reported problems on non-ppc64 architectures. What architecture and distro are you building on?
[bugs:#245] git build on 'AT_BASE_PLATFORM'
Status: open
Created: Mon Jul 08, 2013 02:14 PM UTC by FredM
Last Updated: Mon Jul 08, 2013 02:14 PM UTC
Owner: nobody
The build is broken on ppc64 functionality, doesn't seem usefull on arch != than ppc64 ?
/../../oprofile/libop/op_cpu_type.c:259:39: error: 'AT_BASE_PLATFORM' undeclared (first use in this function)
cat AT_BASE_PLATFORM.patch
--- /home/sah0027//oprofile/libop/op_cpu_type.c 2013-07-08 15:59:08.042966482 +0200
+++ /home/sah0027/ubuntu/worksets/5.1_build16_generic/sources/opensource/other/oprofile/vendor/oprofile.sourceforge.net/MAIN//oprofile/libop/op_cpu_type.c 2013-07-08 16:06:42.862973856 +0200
@@ -176,6 +176,7 @@ static char * _get_cpuinfo_cpu_type(char
return _get_cpuinfo_cpu_type_line(buf, len, prefix, 1);
}
+#ifdef PPC64
// The aux vector stuff below is currently only used by ppc64 arch
static ElfW(auxv_t) * auxv_buf = NULL;
@@ -221,7 +222,6 @@ static ElfW(auxv_t) * _auxv_fetch()
return (ElfW(auxv_t) *)auxv_temp;
}
-
static const char * fetch_at_hw_platform(ElfW(Addr) type)
{
int i = 0;
@@ -249,12 +249,14 @@ static void release_at_hw_platform(void)
auxv_buf = NULL;
}
}
+#endif
static op_cpu _try_ppc64_arch_generic_cpu(void)
{
op_cpu cpu_type = CPU_NO_GOOD;
-
+//../../oprofile/libop/op_cpu_type.c:259:39: error: 'AT_BASE_PLATFORM' undeclared (first use in this function)
+#ifdef PPC64
platform = fetch_at_hw_platform(AT_PLATFORM);
base_platform = fetch_at_hw_platform(AT_BASE_PLATFORM);
if (!platform || !base_platform) {
@@ -284,6 +286,7 @@ static op_cpu _try_ppc64_arch_generic_cp
}
}
release_at_hw_platform();
+#endif
return cpu_type;
}
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/oprofile/bugs/245/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
Related
Bugs:
#245"AT_BASE_PLATFORM" is declared in elf.h, which is typically included with glibc-headers (in every distro I'm familiar with, anyway). I don't know what package it would be located in for your distro, do you?
Are you still having a problem? Or is it OK to close this bug?
I experience this bug when compiling oprofile for OpenWrt "distribution":
As you can see (from my mipsel-openwrt-linux-uclibc-gcc command) my toolchain is located in:
/home/zajec/openwrt/openwrt.git/staging_dir/toolchain-mipsel_gcc-4.6-linaro_uClibc-0.9.33.2/
Of course in this directory there is "include/elf.h", however it doesn't contain AT_BASE_PLATFORM :(
So if you say that the valid elf.h is supposed to be part of glibc, maybe the problem is that OpenWrt uses uClibc?
Could you make oprofile compatible with uClibc?
Attaching my elf.h.
The elf.h file attached by Rafael differs from the elf.h file I see on x86 and ppc64, which both have the following:
~~~~~~~~~~~~~~
define AT_BASE_PLATFORM 24 / String identifying real platforms./
~~~~~~~~~~~~~~~
AFAICT, this marcro was defined back in 2008. If you're using a recent toolchain, you could file a bug to have AT_BASE_PLATFORM added to the distro-provided elf.h. On the other hand, since this error is occurring in code that is really intended only for the ppc64 architecture, we could wrap that code in an #ifdef, using a macro that would only be defined for ppc64. I'll put something together and attach a patch to this bug.
Last edit: Maynard Johnson 2013-08-08
Please test the attached patch with oprofile 0.9.9. Thanks.
I compared glibc to uClibc (analyzed sources):
So yeah, the problem seems to be uClibc related.
@Maynard: this patch does the trick for me, thanks!
@Maynard: do you think we could try some alternative solution like a
#ifndef AT_BASE_PLATFORM
#define AT_BASE_PLATFORM 24
#endif
?
I also reported elf.h problem to the uClibc team:
http://lists.uclibc.org/pipermail/uclibc/2013-August/047884.html
There's nothing prohibiting uClibc (or glibc, for that matter) assigning '24' to some other macro, since the values corresponding to the macros are implementation details that user code should never rely on. So, no -- I don't want to get in the middle of #define'ing ELF macros. Is there some reason you prefer such a solution over the patch I provided (other than it's simplicity)?
Absolutely not, I was just hacking around without full understanding on that, sorry.
I'm OK with your solution.
Another workaround (tested with uClibc)
FredM, as originator of this bug, it would be ideal if you could test the attached patch, too. Thanks.
Hi
If it helps... The 2 patches compile on my side.
with the second one :
opcontrol --init
oprofile: using mips/bmips5000 performance monitoring.
cpu_type 'unset' is not valid
you should upgrade oprofile or force the use of timer mode
I add oprofile.timer=1 the in the command line,
and it works...
Regards,
Frédéric
De : Maynard Johnson maynardj@users.sf.net
À : [oprofile:bugs] 245@bugs.oprofile.p.re.sf.net
Envoyé le : Mardi 13 août 2013 18h49
Objet : [oprofile:bugs] #245 git build on 'AT_BASE_PLATFORM'
FredM, as originator of this bug, it would be ideal if you could test the attached patch, too. Thanks.
[bugs:#245] git build on 'AT_BASE_PLATFORM'
Status: open
Created: Mon Jul 08, 2013 02:14 PM UTC by FredM
Last Updated: Thu Aug 08, 2013 09:21 PM UTC
Owner: nobody
The build is broken on ppc64 functionality, doesn't seem usefull on arch != than ppc64 ?
/../../oprofile/libop/op_cpu_type.c:259:39: error: 'AT_BASE_PLATFORM' undeclared (first use in this function)
cat AT_BASE_PLATFORM.patch
--- /home/sah0027//oprofile/libop/op_cpu_type.c 2013-07-08 15:59:08.042966482 +0200
+++ /home/sah0027/ubuntu/worksets/5.1_build16_generic/sources/opensource/other/oprofile/vendor/oprofile.sourceforge.net/MAIN//oprofile/libop/op_cpu_type.c 2013-07-08 16:06:42.862973856 +0200
@@ -176,6 +176,7 @@ static char * _get_cpuinfo_cpu_type(char
return _get_cpuinfo_cpu_type_line(buf, len, prefix, 1);
}
+#ifdef PPC64
// The aux vector stuff below is currently only used by ppc64 arch
static ElfW(auxv_t) * auxv_buf = NULL;
@@ -221,7 +222,6 @@ static ElfW(auxv_t) * _auxv_fetch()
return (ElfW(auxv_t) *)auxv_temp;
}
-
static const char * fetch_at_hw_platform(ElfW(Addr) type)
{
int i = 0;
@@ -249,12 +249,14 @@ static void release_at_hw_platform(void)
auxv_buf = NULL;
}
}
+#endif
static op_cpu _try_ppc64_arch_generic_cpu(void)
{
op_cpu cpu_type = CPU_NO_GOOD;
-
+//../../oprofile/libop/op_cpu_type.c:259:39: error: 'AT_BASE_PLATFORM' undeclared (first use in this function)
+#ifdef PPC64
platform = fetch_at_hw_platform(AT_PLATFORM);
base_platform = fetch_at_hw_platform(AT_BASE_PLATFORM);
if (!platform || !base_platform) {
@@ -284,6 +286,7 @@ static op_cpu _try_ppc64_arch_generic_cp
}
}
release_at_hw_platform();
+#endif
return cpu_type;
}
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/oprofile/bugs/245/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
Related
Bugs:
#245Patch committed. Thanks for reporting the bug.