Bug #979
closedStatic build: broken popt and uuid detection leading to wrong LDFLAGS
0%
Description
For static build, lttng-tool fails at configure time [1] because it misses private ldflags for popt and uuid [2].
It only checks for these libraries presence using AC_CHECK_LIB [3].
Note that, the configure script fails on the first error, the popt one; but once fixed, it fails in a similar way for uuid.
This bug has been triggered by Buildroot autobuilders, using lttng-tools-2.6.0; it can be reproduce with the current master.
A patch has been submitted [4].
[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
[3] https://git.lttng.org/?p=lttng-tools.git;a=blob;f=configure.ac;hb=HEAD#l221
[4] https://lists.lttng.org/pipermail/lttng-dev/2015-November/025293.html
Updated by Jonathan Rajotte Julien almost 9 years ago
- Status changed from New to In Progress
Hi,
Not sure if this a a lttng problem since AC_CHECK_LIB seems to be the preferred way to check for a lib12.
Looks like the LDFLAGS_FOR_BUILD is defined but never passed to the configure script. I'm not familiar with the buildroot way of doing things could you explain a little more
why the folder is not specified via the conventional LDFLAGS="-Ldir"?
[1]http://stackoverflow.com/questions/29506539/pkg-check-modules-vs-ac-check-lib-for-checking-availability-of-libraries
[2]http://stackoverflow.com/questions/10220946/pkg-check-modules-considered-harmful
Thanks
Updated by Samuel Martin almost 9 years ago
Jonathan Rajotte Julien wrote:
Hi,
Not sure if this a a lttng problem since AC_CHECK_LIB seems to be the preferred way to check for a lib12.
Looks like the LDFLAGS_FOR_BUILD is defined but never passed to the configure script. I'm not familiar with the buildroot way of doing things could you explain a little more
In this build, Buildroot is cross-compiling lttng-tools.
LDFLAGS_FOR_BUILD (so, CFLAGS_FOR_BUILD and CXXFLAGS_FOR_BUILD) are used by autotools when building for the host/build machine, not the target.
LDFLAGS (so, CFLAGS and CXXFLAGS) are used by autotools when building for the target machine.
why the folder is not specified via the conventional LDFLAGS="-Ldir"?
In this case of static build, the problem is the LDFLAGS misses -lintl
(which provides libintl_textdomain
and other functions).
This flag is correctly set when using pkg-config --static --libs popt
because popt.pc
contains:
Libs.private: -lintl
[1]http://stackoverflow.com/questions/29506539/pkg-check-modules-vs-ac-check-lib-for-checking-availability-of-libraries
[2]http://stackoverflow.com/questions/10220946/pkg-check-modules-considered-harmful
Are you suggesting I should follow [2], i.e. use AC_CHECK_LIBS to detect the library presence, then PKG_CHECK_MODULE to get the flags, and AC_CHECK_LIBS again to check these flags? I can do that.
Thanks
Thanks
Updated by Jonathan Rajotte Julien almost 9 years ago
- Status changed from In Progress to Confirmed
So I had some discussion with people on #autotools and also with Thomas Petazzoni and your patch seems like the way to go.
Thanks for the patch!
Updated by Jonathan Rajotte Julien almost 9 years ago
- Status changed from Confirmed to Resolved
Patch was merged:
e9cee23 configure.ac: fix static build
See also:
a9caac6 Build: fallback to AC_CHECK_LIBS when looking for popt and uuid