[ltt-dev] Problem when compiling UST from git
Pierre-Marc Fournier
pierre-marc.fournier at polymtl.ca
Tue Dec 8 14:24:32 EST 2009
christian.charreyre at free.fr wrote:
>
> If I comment the 2 lines of _DEFINE_MARKER() as suggested by Pierre-Marc, marker.c compiles well on x86 arch.
>
> Nevertheless, there is 2 additional problems on such environment :
>
> 1/ in libust/buffers.c, there is a struct ltt_channel_buf_struct in save_last_tsc (line 253) and last_tsc_overflow (line 258) that generates an error because this type is not defined.
>
> I've replaced them by struct ust_buffer as in the other case of the #if (BITS_PER_LONG == 32) test, and it seems to compile well.
>
> Is it ok ?
I had this fix queued. It is now pushed. You don't even need conditional
compilation.
>
>
> 2/ at the final link of the library, there is an undefined reference :
>
> libtool: link: gcc -shared .libs/libust_la-marker.o .libs/libust_la-tracepoint.o .libs/libust_la-channels.o .libs/libust_la-marker-control.o .libs/libust_la-buffers.o .libs/libust_la-tracer.o .libs/libust_la-tracercore.o .libs/libust_la-serialize.o .libs/libust_la-tracectl.o .libs/libust_la-ustcomm.o -lpthread -lurcu-bp -Wl,-soname -Wl,libust.so.0 -o .libs/libust.so.0.0.0
> .libs/libust_la-marker.o: In function `init_markers':
> /media/cio-linux/LTTng/ust/libust/marker.c:1548: undefined reference to `__start___marker_addr'
> /usr/bin/ld: .libs/libust_la-marker.o: relocation R_386_GOTOFF against undefined hidden symbol `__start___marker_addr' can not be used when making a shared object
> /usr/bin/ld: final link failed: Bad value
> collect2: ld returned 1 exit status
> make[2]: *** [libust.la] Erreur 1
> make[2]: quittant le répertoire « /media/cio-linux/LTTng/ust/libust »
> make[1]: *** [all-recursive] Erreur 1
> make[1]: quittant le répertoire « /media/cio-linux/LTTng/ust »
> make: *** [all] Erreur 2
>
> I've tried to understand but didn't : __start___marker_addr is defined the same way than __start___markers in the following code :
>
> extern struct marker __start___markers[] __attribute__((visibility("hidden")));
> extern struct marker __stop___markers[] __attribute__((visibility("hidden")));
> extern struct marker_addr __start___marker_addr[] __attribute__((visibility("hidden")));
> extern struct marker_addr __stop___marker_addr[] __attribute__((visibility("hidden")));
>
> but it seems that __start___markers doesn't cause problems as __start___marker_addr does.
>
> Any hint on this last point ?
Right. This is a consequence of the asm not working. Now I fixed this
completely by adding conditional compilation for gdb integration. You
should be able to compile now. I made this fix a bit quickly because I
have other commits queued to really fix gdb integration for x86-32.
BTW, you need to use lttv commit
d081dd5e8ed6055ba524e663c9976fda51147399 because ust has not yet been
ported to trace format 2.5 yet. (And the lttv head requires it.)
More information about the lttng-dev
mailing list