tests/unit: fix object files' location
authorSamuel Martin <s.martin49@gmail.com>
Tue, 1 Dec 2015 23:36:45 +0000 (00:36 +0100)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 8 Dec 2015 10:26:54 +0000 (05:26 -0500)
Referring to *.o files under a .libs/ directory is not recommended
because this belongs to libtool's innards.

Indeed, libtool decides to place the *.o files in an
implementation-specific location:
- PIC *.o files go into a .libs/ directory;
- non-PIC *.o files are generated along side to their corresponding
  source files.

Using PIC objects to build executable is legit, thought it may
introduce some minor overhead at runtime.

However, hard-coding these PIC object files in the Makefile.am to build
executables breaks the build in case of static only build.

In this case, no PIC object files is generated, so the linker will not
found some of the needed objects files.

Changing these dependencies' path fixes the static build, keeping the
shared one ok, though the non-PIC object files are now always built.

Fixes #983.

Fix tested on git master and v2.6 with no change needed.

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/unit/Makefile.am

index dd3dd8c159a093d739aab0370a050f1c22a65146..668ec9ce670ccbefae95a9eca786f09d467ba9ed 100644 (file)
@@ -34,9 +34,9 @@ SESSIONS=$(top_builddir)/src/bin/lttng-sessiond/session.o     \
         $(top_builddir)/src/bin/lttng-sessiond/consumer.o \
         $(top_builddir)/src/bin/lttng-sessiond/utils.o \
         $(top_builddir)/src/bin/lttng-sessiond/snapshot.o \
-        $(top_builddir)/src/common/.libs/uri.o \
-        $(top_builddir)/src/common/.libs/utils.o \
-        $(top_builddir)/src/common/.libs/error.o \
+        $(top_builddir)/src/common/uri.o \
+        $(top_builddir)/src/common/utils.o \
+        $(top_builddir)/src/common/error.o \
         $(top_builddir)/src/common/health/libhealth.la \
         $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
 
@@ -60,8 +60,8 @@ UST_DATA_TRACE=$(top_builddir)/src/bin/lttng-sessiond/trace-ust.o \
                   $(top_builddir)/src/bin/lttng-sessiond/session.o \
                   $(top_builddir)/src/bin/lttng-sessiond/snapshot.o \
                   $(top_builddir)/src/bin/lttng-sessiond/agent.o \
-                  $(top_builddir)/src/common/.libs/uri.o \
-                  $(top_builddir)/src/common/.libs/utils.o \
+                  $(top_builddir)/src/common/uri.o \
+                  $(top_builddir)/src/common/utils.o \
                   $(top_builddir)/src/common/health/libhealth.la \
                   $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
 
@@ -75,8 +75,8 @@ endif
 KERN_DATA_TRACE=$(top_builddir)/src/bin/lttng-sessiond/trace-kernel.o  \
                $(top_builddir)/src/bin/lttng-sessiond/consumer.o       \
                $(top_builddir)/src/bin/lttng-sessiond/utils.o \
-               $(top_builddir)/src/common/.libs/uri.o \
-               $(top_builddir)/src/common/.libs/utils.o \
+               $(top_builddir)/src/common/uri.o \
+               $(top_builddir)/src/common/utils.o \
                $(top_builddir)/src/common/health/libhealth.la \
                $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
 
@@ -86,8 +86,8 @@ test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM)
 test_kernel_data_LDADD += $(KERN_DATA_TRACE)
 
 # utils suffix for unit test
-UTILS_SUFFIX=$(top_builddir)/src/common/.libs/utils.o \
-               $(top_builddir)/src/common/.libs/runas.o
+UTILS_SUFFIX=$(top_builddir)/src/common/utils.o \
+               $(top_builddir)/src/common/runas.o
 
 # parse_size_suffix unit test
 test_utils_parse_size_suffix_SOURCES = test_utils_parse_size_suffix.c
This page took 0.027207 seconds and 4 git commands to generate.