All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit] package/lttng-tools: fix static build
@ 2015-12-09 22:39 Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2015-12-09 22:39 UTC (permalink / raw)
  To: buildroot

commit: http://git.buildroot.net/buildroot/commit/?id=e85a0bb03face4963b1e93b83cdb01066d68b79b
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Some unit tests depend on objects from src/common/.
This patch makes sure to points to the location of the non-PIC object files.
Otherwise, in case of static only build, the PIC object are not built, so
the link will fail.

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 ...0003-tests-unit-fix-object-files-location.patch | 94 ++++++++++++++++++++++
 1 file changed, 94 insertions(+)

diff --git a/package/lttng-tools/0003-tests-unit-fix-object-files-location.patch b/package/lttng-tools/0003-tests-unit-fix-object-files-location.patch
new file mode 100644
index 0000000..9bfee4b
--- /dev/null
+++ b/package/lttng-tools/0003-tests-unit-fix-object-files-location.patch
@@ -0,0 +1,94 @@
+Upstream status: Merged
+Fetched from: https://git.lttng.org/?p=lttng-tools.git;a=commit;h=3622d7c3931685fab8d1b2e5585a369b78cefd12
+From 3622d7c3931685fab8d1b2e5585a369b78cefd12 Mon Sep 17 00:00:00 2001
+From: Samuel Martin <s.martin49@gmail.com>
+Date: Wed, 2 Dec 2015 00:36:45 +0100
+Subject: [PATCH] tests/unit: fix object files' location
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+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 | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am
+index c0c9c45..7bfe65a 100644
+--- a/tests/unit/Makefile.am
++++ b/tests/unit/Makefile.am
+@@ -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
+-- 
+2.6.3
+

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [git commit] package/lttng-tools: fix static build
@ 2015-12-09 22:38 Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2015-12-09 22:38 UTC (permalink / raw)
  To: buildroot

commit: http://git.buildroot.net/buildroot/commit/?id=12fb1149eeaee4cc2e3f683192c4959b5ce73f38
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Add patch fixing configure.ac for library detection on static build.

Fixes:
  http://autobuild.buildroot.net/results/0f1/0f1e015a0c5a5ac2beeb5011d31a1e0058a32a0d/

Upstream status: Merged

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 .../0001-configure.ac-fix-static-build.patch       | 55 ++++++++++++++++++++++
 package/lttng-tools/lttng-tools.mk                 |  2 +
 2 files changed, 57 insertions(+)

diff --git a/package/lttng-tools/0001-configure.ac-fix-static-build.patch b/package/lttng-tools/0001-configure.ac-fix-static-build.patch
new file mode 100644
index 0000000..ebff592
--- /dev/null
+++ b/package/lttng-tools/0001-configure.ac-fix-static-build.patch
@@ -0,0 +1,55 @@
+Upstream status: Merged
+Fetched from: https://git.lttng.org/?p=lttng-tools.git;a=commit;h=e9cee23a2e92694ba1347fd1242026d4c19413a8
+From e9cee23a2e92694ba1347fd1242026d4c19413a8 Mon Sep 17 00:00:00 2001
+From: Samuel Martin <s.martin49@gmail.com>
+Date: Sun, 22 Nov 2015 23:38:00 +0100
+Subject: [PATCH] configure.ac: fix static build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+For static build, some extra LDFLAGS may be needed.
+
+Using PKG_CHECK_MODULES instead of AC_CHECK_LIB for librairy detection
+allows to get all these flags. Then, the LIBS variable can be extended
+with everything that is needed.
+
+So, use PKG_CHECK_MODULES for popt and uuid detection; which both depend
+on libintl.
+
+This changes fixes build failures triggered with Buildroot, e.g.:
+  http://autobuild.buildroot.net/results/0f1/0f1e015a0c5a5ac2beeb5011d31a1e0058a32a0d/build-end.log
+
+Signed-off-by: Samuel Martin <s.martin49@gmail.com>
+Signed-off-by: J??r??mie Galarneau <jeremie.galarneau@efficios.com>
+---
+ configure.ac | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2c451e9..978e3bc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -218,15 +218,17 @@ AC_CHECK_LIB([pthread], [pthread_create], [],
+ )
+ 
+ # Check libpopt
+-AC_CHECK_LIB([popt], [poptGetContext], [],
++PKG_CHECK_MODULES([POPT], [popt],
++	[LIBS="$LIBS $POPT_LIBS"],
+ 	[AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
+ )
+ 
+ AM_PATH_XML2(2.7.6, true, AC_MSG_ERROR(No supported version of libxml2 found.))
+ 
+ # Check for libuuid
+-AC_CHECK_LIB([uuid], [uuid_generate],
++PKG_CHECK_MODULES([UUID], [uuid],
+ [
++	LIBS="$LIBS $UUID_LIBS"
+ 	AC_DEFINE_UNQUOTED([LTTNG_HAVE_LIBUUID], 1, [Has libuuid support.])
+ 	have_libuuid=yes
+ ],
+-- 
+2.6.3
+
diff --git a/package/lttng-tools/lttng-tools.mk b/package/lttng-tools/lttng-tools.mk
index efca6d7..b14b7e7 100644
--- a/package/lttng-tools/lttng-tools.mk
+++ b/package/lttng-tools/lttng-tools.mk
@@ -10,6 +10,8 @@ LTTNG_TOOLS_SOURCE = lttng-tools-$(LTTNG_TOOLS_VERSION).tar.bz2
 LTTNG_TOOLS_LICENSE = GPLv2+; LGPLv2.1+ for include/lttng/* and src/lib/lttng-ctl/*
 LTTNG_TOOLS_LICENSE_FILES = gpl-2.0.txt lgpl-2.1.txt LICENSE
 LTTNG_TOOLS_CONF_OPTS += --with-xml-prefix=$(STAGING_DIR)/usr
+# Need autoreconf because of a patch touching configure.ac
+LTTNG_TOOLS_AUTORECONF = YES
 
 # The host-lttng-babeltrace technically isn't a required build
 # dependency. However, having the babeltrace utilities built for the

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-09 22:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-09 22:39 [Buildroot] [git commit] package/lttng-tools: fix static build Thomas Petazzoni
  -- strict thread matches above, loose matches on Subject: below --
2015-12-09 22:38 Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.