Bug #983
closedStatic build: build tests is broken
100%
Description
In case of static build, building test_session fails with the following error:
make[4]: Entering directory '/media/data/data/src/tmp/br/abo/lttng-tools-popt-gettext-static/build/lttng-tools-2.6.0/tests/unit' [...] /home/sam/data/src/tmp/br/abo/lttng-tools-popt-gettext-static/host/usr/bin/arm-linux-gcc -DHAVE_CONFIG_H -I../.. -I../.. -I../../src -I../../include -include config.h -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I../../include -I../../src -I../../tests/utils/ -I. -Wall -I/home/sam/data/src/tmp/br/abo/lttng-tools-popt-gettext-static/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -static -g -fno-strict-aliasing -c -o test_session.o test_session.c make[4]: *** No rule to make target '../../src/common/.libs/uri.o', needed by 'test_session'. Stop. make[4]: Leaving directory '/media/data/data/src/tmp/br/abo/lttng-tools-popt-gettext-static/build/lttng-tools-2.6.0/tests/unit'
This is caused by wrong paths in the Makefile.am
that points to the location of the PIC object files generated by libtool.
--- /home/sam/data/src/tmp/br/abo/lttng-tools-popt-gettext-static/build/lttng-tools-2.6.0/src/common/uri.lo 2015-12-02 00:05:13.846206276 +0100 +++ /home/sam/data/src/tmp/br/abo/lttng-tools-popt-gettext-shared/build/lttng-tools-2.6.0/src/common/uri.lo 2015-11-29 18:33:57.811665239 +0100 @@ -5,8 +5,8 @@ # It is necessary for linking the library. # Name of the PIC object. -pic_object=none +pic_object='.libs/uri.o' # Name of the non-PIC object -non_pic_object='uri.o' +non_pic_object=none
After checking on #autotools, it seems that the .libs/
directory is a libtool's implementation detail which should not be used in Makefile.am files.
This issue has been triggered while investigating Buildroot build failure [1,2], after #979 was fixed.
This issue has been observed on version v2.6 and git master, so it certainly affected version v2.7 as well.
[1] http://autobuild.buildroot.net/results/0f1/0f1e015a0c5a5ac2beeb5011d31a1e0058a32a0d/build-end.log
[2] http://autobuild.buildroot.net/results/0f1/0f1e015a0c5a5ac2beeb5011d31a1e0058a32a0d/lttng-tools-2.6.0/config.log