Project

General

Profile

Bug #1165

POPT_LIBS and POPT_CFLAGS ignored by configure and the build

Added by Rolf Theunissen 10 months ago. Updated 27 days ago.

Status:
Needs feedback
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
05/24/2018
Due date:
% Done:

0%

Estimated time:

Description

With LTTng-tools 2.10.x

Setting the POPT_LIBS variable is ignored, the configure always checks for '-lpopt' instead of the value specified in POPT_LIBS.

The POPT_CFLAGS options are not added in the compiler options, resulting in '<popt.h>' file not found exceptions.

BTW: The libxml2_LIBS and libxml2_CFLAGS are handled correctly


Files

config.log (341 KB) config.log Rolf Theunissen, 02/14/2019 08:31 AM
0001-RFC-Add-POPT_CFLAGS-to-lttng_CFLAGS.patch (2.91 KB) 0001-RFC-Add-POPT_CFLAGS-to-lttng_CFLAGS.patch Yannick Lamarre, 02/14/2019 05:14 PM

History

#1

Updated by Yannick Lamarre about 1 month ago

Hi,
Do you have pkg-config on your system? Also, could you share the generated config.log
Thanks,
YL

#2

Updated by Rolf Theunissen about 1 month ago

pkg-config is installed, but pkg data is not available for popt and libxml2. Therefore the configuration is manually specified:

export POPT_CFLAGS="-I/home/user/lttng_source/include"
export POPT_LIBS="-l:libpopt.so.0"

export libxml2_CFLAGS="-I/home/user/lttng_source/include/libxml2"
export libxml2_LIBS="-l:libxml2.so.2"

make finishes with this error:

/opt/windriver/toolchain/bin/../lib/gcc/i686-wrs-linux-gnu/4.8.1/../../../../i686-wrs-linux-gnu/bin/ld: cannot find -lpopt
collect2: error: ld returned 1 exit status
make3: * [lttng] Error 1
make3: Leaving directory `/home/user/lttng_source/lttng-tools-2.10.4/src/bin/lttng'
make2:
[all-recursive] Error 1
make2: Leaving directory `/home/user/lttng_source/lttng-tools-2.10.4/src/bin'
make1:
[all-recursive] Error 1
make1: Leaving directory `/home/user/lttng_source/lttng-tools-2.10.4/src'
make: *
[all-recursive] Error 1

See also the resulting config.log attached

Specifying the following workaround before make works:
export CFLAGS="-g -02 -I/home/user/lttng_source/include"

#3

Updated by Yannick Lamarre about 1 month ago

1) Looking through the config.log, it seems that POPT_CFLAGS was not set prior running configure hence why it calls pkg-config to try to set it, fails (because of the missing .pc) and falls back on -lpopt overriding the POPT_LIBS setting. The generated Makefile will use the settings used at configure time. You'll have to rerun configure if you want to change these values and make sure POPT_CFLAGS is non-null if you don't want your settings overriden.
2) I've also investigated the missing POPT_CFLAGS and libpopt is not the only one where some of the flags are assumed and/or unused. So, I'll patch those too before sending a patch.

#4

Updated by Yannick Lamarre about 1 month ago

Here is the patch for POPT. This patch HAS TO be applied to code coming from a git-tree (pre-bootstrap code). Can you test it before it is submitted for integration?

#5

Updated by Jonathan Rajotte Julien 28 days ago

  • Status changed from New to Needs feedback
#6

Updated by Rolf Theunissen 27 days ago

To bootstrap in my environment, I had to run:

autoreconf -vi -I /usr/share/pkgconfig/ -I ./m4

After that, the build runs corretly, with the POPT_LIBS and POPT_CFLAGS varialbes taken into account.

#7

Updated by Rolf Theunissen 27 days ago

Rolf Theunissen wrote:

To bootstrap in my environment, I had to run:

autoreconf -vi -I /usr/share/pkgconfig/ -I ./m4

After that, the build runs corretly, with the POPT_LIBS and POPT_CFLAGS varialbes taken into account.

Of course with the patch applied

Also available in: Atom PDF