[lttng-dev] [PATCH lttng-ust] Fix linking failure when cross-compiling

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Sat Apr 26 17:54:14 EDT 2014


Merged, thanks!

Mathieu

----- Original Message -----
> From: "Adrien Vergé" <adrienverge at gmail.com>
> To: lttng-dev at lists.lttng.org
> Cc: "Adrien Vergé" <adrienverge at gmail.com>
> Sent: Friday, April 25, 2014 6:12:24 PM
> Subject: [lttng-dev] [PATCH lttng-ust] Fix linking failure when	cross-compiling
> 
> Examples binaries in doc/examples require libs in liblttng-ust/.libs/,
> and those libs require other libs in the same directory.  For instance
> liblttng-ust.so uses liblttng-ust-tracepoint.so symbols, so the latter
> is needed to properly link example programs.  Currently, ld is given
> the lib dir only via -rpath (used for linking executables dependencies)
> but not via -rpath-link (used for linking libs dependencies).
> 
> When compiling regularly, this does not seem to be a problem (maybe ld
> is smart enough).  However when cross-compiling with the
> arm-linux-gnueabihf toolchain, -rpath-link is needed otherwise linking
> fails with:
> 
> arm-linux-gnueabihf/bin/ld: warning: liblttng-ust-tracepoint.so.0, needed by
> ../../../liblttng-ust/.libs//liblttng-ust.so, not found (try using -rpath or
> -rpath-link)
> 
> This patch adds -rpath-link to doc/examples/Makefile.am.
> 
> Signed-off-by: Adrien Vergé <adrienverge at gmail.com>
> ---
>  doc/examples/Makefile.am | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
> index 1fd0084..0690597 100644
> --- a/doc/examples/Makefile.am
> +++ b/doc/examples/Makefile.am
> @@ -75,7 +75,7 @@ all-local:
>  		rel_build_subdir="../"; \
>  	fi; \
>  	for subdir in $(SUBDIRS_PROXY); do \
> -		(cd $$subdir && $(MAKE) AM_CC="$(CC)" AM_CPPFLAGS="$(CPPFLAGS)
> -I$$rel_src_subdir$(top_srcdir)/include/
> -I$$rel_build_subdir$(top_builddir)/include/" AM_CFLAGS='$(CFLAGS)'
> AM_LDFLAGS='$(LDFLAGS) -L../../../liblttng-ust/.libs/
> -Wl,-rpath="$(PWD)/../../liblttng-ust/.libs/"'
> LTTNG_GEN_TP_PATH="../../../tools/" $(AM_MAKEFLAGS) all && cd ..) || exit 1;
> \
> +		(cd $$subdir && $(MAKE) AM_CC="$(CC)" AM_CPPFLAGS="$(CPPFLAGS)
> -I$$rel_src_subdir$(top_srcdir)/include/
> -I$$rel_build_subdir$(top_builddir)/include/" AM_CFLAGS='$(CFLAGS)'
> AM_LDFLAGS='$(LDFLAGS) -L../../../liblttng-ust/.libs
> -Wl,-rpath="$(PWD)/../../liblttng-ust/.libs/"
> -Wl,-rpath-link="$(PWD)/../../liblttng-ust/.libs/"'
> LTTNG_GEN_TP_PATH="../../../tools/" $(AM_MAKEFLAGS) all && cd ..) || exit 1;
> \
>  	done; \
>  	if [ x"$(SUBDIRS_JUL)" != x"" ]; then \
>  		for subdir in $(SUBDIRS_JUL); do \
> --
> 1.9.1
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list