ffi/oprofile checked for even when explicitly disabled
| Bugzilla Link | 5018 |
| Resolution | FIXED |
| Resolved on | Feb 09, 2010 17:05 |
| Version | trunk |
| OS | Linux |
| CC | @echristo,@nlewycky |
Extended Description
./configure --enable-ffi=no --enable-oprofile=no still checks for ffi and oprofile and adds it to LIBS.
The problem is here in configure.ac: dnl --enable-libffi : check whether the user wants to turn off libffi: AC_ARG_ENABLE(libffi,AS_HELP_STRING( --enable-libffi,[Check for the presence of libffi (default is YES)]),, enableval=yes) case "$enableval" in yes) llvm_cv_enable_libffi="yes" ;; no) llvm_cv_enable_libffi="no" ;; *) AC_MSG_ERROR([Invalid setting for --enable-libffi. Use "yes" or "no"]) ;; esac
enableval should be tested inside AC_ARG_ENABLE, otherwise it contains something else:
- eval 'enable_ffi=$ac_optarg' ++ enable_ffi=no ...
- case "$withval" in
- with_ocaml_libdir=auto
- test '' = set
- withval=default
- case "$withval" in
- WITH_BINUTILS_INCDIR=default
- test xdefault '!=' xdefault
- test '' = set
- enableval=yes
- case "$enableval" in
- llvm_cv_enable_libffi=yes
Fixed in r95712. I'm happy to change the defaults to pay attention to what's installed if Nick convinces people that's the right behavior.
Yeah, that's fine. Go ahead and commit.
Patch to make --disable-libffi work and adjust the default Here's a patch that makes --disable-libffi work. It also changes the default to not using libffi to match libopagent. I remember Duncan wanting that change, but Nick suggests defaulting to "'on if detected'. that's pretty standard for most software". So I'm waiting for them to agree before committing.
anyone willing to finish this off?
I've committed the OProfile part in r83503. Edwin, do you want to get the ffi part?
Fix for oprofile part, now checking bfd in the right order Here's a new patch for testing.
Possible fix for the oprofile part of this bug This patch makes --without-oprofile work, makes that the default instead of searching for oprofile, and tries to work around http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=537744 by searching for libbfd after pulling in libopagent. Edwin, could you check that this fixes things on your system?
Also since Debian's libopagent.so doesn't link against bfd it fails to be found:
configure:28860: gcc -o conftest -g -O2 conftest.c -lopagent -lpthread -lffi -ldl -lm -L/usr/lib/oprofile -Wl,-rpath,/usr/lib/oprofile
&5 /usr/lib/oprofile/libopagent.so: undefined reference to
bfd_check_format' /usr/lib/oprofile/libopagent.so: undefined reference tobfd_init' /usr/lib/oprofile/libopagent.so: undefined reference tobfd_openr' /usr/lib/oprofile/libopagent.so: undefined reference tobfd_perror' /usr/lib/oprofile/libopagent.so: undefined reference tobfd_get_mach' /usr/lib/oprofile/libopagent.so: undefined reference tobfd_get_arch'
If I configure --with-oprofile I get an error that libopagent needs to be around.
Here is relevant part from /usr/lib/oprofile/libopagent.la:
Libraries that this one depends upon.
dependency_libs=' -liberty -ldl'
And dependencies: ldd /usr/lib/oprofile/libopagent.so linux-vdso.so.1 => (0x00007fff00767000) libdl.so.2 => /lib/libdl.so.2 (0x00007f83f4a9f000) libc.so.6 => /lib/libc.so.6 (0x00007f83f474e000) /lib64/ld-linux-x86-64.so.2 (0x0000003410e00000)