[lttng-dev] Making 32-bit user-space events on a 64-bit Linux system

Thibault, Daniel Daniel.Thibault at drdc-rddc.gc.ca
Fri Sep 27 15:48:39 EDT 2013

   I wanted to test the 32-bit UST event stream (to see if one can indeed have two consumer daemons serving the session, one for 64-bit user-space events, another for 32-bit user-space events), so I adapted the lttng-ust/doc/examples/easy-ust Makefile by making a new target:

static32: static32.o tp32.o
	@echo "~~~~~~Linking sample_$@:"
	$(CC) -m32 -o sample_$@ $^ $(LDFLAGS) $(LIBDL) $(LIBUST)
	@echo "   Use './sample_$@' to run sample_$@"

static32.o: sample.c tp.h
	@echo "~~~~~~Compiling $@:"
	$(CC) -m32 $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(TP_DEFINE) -c -o $@ $<

tp32.o: tp.c tp.h
	@echo "~~~~~~Compiling $@:"
	$(CC) -m32 $(CPPFLAGS) $(LOCAL_CPPFLAGS) -c -o $@ $<

   Simply put, the .c files are compiled and linked with an additional -m32 gcc option.  The gcc-multilib package is installed.

   However, I get:

$ make static32
~~~~~~Compiling static32.o:
gcc -m32  -I. -D TRACEPOINT_DEFINE -c -o static32.o sample.c
~~~~~~Compiling tp32.o:
gcc -m32  -I. -c -o tp32.o tp.c
~~~~~~Linking sample_static32:
gcc -m32 -o sample_static32 static32.o tp32.o -L/usr/local/lib -ldl  -llttng-ust
/usr/bin/ld: warning: skipping incompatible /usr/local/lib/liblttng-ust.so while searching for lttng-ust
/usr/bin/ld: error: cannot find -llttng-ust
tp32.o:tp.c:function __lttng_events_init__sample_component: error: undefined reference to 'lttng_probe_register'
tp32.o:tp.c:function __lttng_events_exit__sample_component: error: undefined reference to 'lttng_probe_unregister'
collect2: ld a retourné 1 code d'état d'exécution
make: *** [static32] Erreur 1

   The problem is the "incompatible /usr/local/lib/liblttng-ust.so".  I even tried rebuilding the entire lttng suite (originally built *before* gcc-multilib was added), but that changed nothing.  How do I do this?  More generally, how does one add tracepoints to a 32-bit application running on a 64-bit system?

Daniel U. Thibault
Protection des systèmes et contremesures (PSC) | Systems Protection & Countermeasures (SPC)
Cyber sécurité pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS)
R & D pour la défense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier)
2459 route de la Bravoure
Québec QC  G3J 1X5
Vox : (418) 844-4000 x4245
Fax : (418) 844-4538
NAC : 918V QSDJ <http://www.travelgis.com/map.asp?addr=918V%20QSDJ>
Gouvernement du Canada | Government of Canada

More information about the lttng-dev mailing list