Skip to contentSkip to conversation

translate-all: fix compiler warning and linked error

PATCH Applied Alexey Kardashevskiy 3 participants 6 messages Apr 22, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 translate-all: fix compiler warning and linked error

The code did use profile_getclock() but did not include include/qemu/timer.h where this function is defined. The patch fixes this.

---

The exact warning and error messages are:

/home/alexey/pcipassthru/qemu-impreza/translate-all.c:150:5: warning: implicit declaration of function 'profile_getclock' [-Wimplicit-function-declaration]

     ti = profile_getclock();
     ^

...

/home/alexey/pcipassthru/qemu-impreza/translate-all.c:150: undefined reference to `profile_getclock'

---
 translate-all.c |    1 +
 1 file changed, 1 insertion(+)
translate-all.c +1 -0
index 08dd038..d04a116 100644
@@ -58,6 +58,7 @@
 
 #include "exec/cputlb.h"
 #include "translate-all.h"
+#include "qemu/timer.h"
 
 //#define DEBUG_TB_INVALIDATE
 //#define DEBUG_FLUSH
Signature · 1 line
1.7.10.4
#2 lore raw
Quoted 10 lines · Peter Maydell
Quoted 4 lines · Alexey Kardashevskiy

The code did use profile_getclock() but did not include include/qemu/timer.h where this function is defined. The patch fixes this.

NB that this compile failure only happens if you configure with --enable-profiler.

I also thought I can enable/disable it via ./configure but in fact I cannot:

alexey@ka1:~/pcipassthru/qemu-impreza$ ./configure --help | grep prof
alexey@ka1:~/pcipassthru/qemu-impreza$
Signature · 1 line
Alexey
#3 lore raw
Quoted 9 lines · Alexey Kardashevskiy
Quoted 2 lines · Peter Maydell

NB that this compile failure only happens if you configure with --enable-profiler.

I also thought I can enable/disable it via ./configure but in fact I cannot:

alexey@ka1:~/pcipassthru/qemu-impreza$ ./configure --help | grep prof
alexey@ka1:~/pcipassthru/qemu-impreza$

--enable-profiler exists but it is undocumented (ie not mentioned in the --help text). In fact I have no idea how you tripped over this missing include if you don't know about --enable-profiler, since configure's default is to not enable this code.

thanks
-- PMM

#4 lore raw
Quoted 8 lines · Peter Maydell
Quoted 7 lines · Alexey Kardashevskiy
Quoted 2 lines · Peter Maydell

NB that this compile failure only happens if you configure with --enable-profiler.

I also thought I can enable/disable it via ./configure but in fact I cannot:

Quoted 7 lines
Quoted 2 lines
alexey@ka1:~/pcipassthru/qemu-impreza$ ./configure --help | grep prof
alexey@ka1:~/pcipassthru/qemu-impreza$

--enable-profiler exists but it is undocumented (ie not mentioned in the --help text). In fact I have no idea how you tripped over this missing include if you don't know about --enable-profiler, since configure's default is to not enable this code.

Ah. Looked closer to my scripts and found --enable-profiler (leftover from something). I was confused by the fact that there is no "--disable-profiler", the ./configure script prints an error.

Signature · 1 line
Alexey