llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

ffi/oprofile checked for even when explicitly disabled

Open edwintorok opened this issue 17 years ago • 8 comments

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

edwintorok avatar Sep 21 '09 15:09 edwintorok

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.

llvmbot avatar Feb 10 '10 01:02 llvmbot

Yeah, that's fine. Go ahead and commit.

echristo avatar Feb 10 '10 00:02 echristo

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.

llvmbot avatar Feb 10 '10 00:02 llvmbot

anyone willing to finish this off?

lattner avatar Feb 09 '10 08:02 lattner

I've committed the OProfile part in r83503. Edwin, do you want to get the ffi part?

llvmbot avatar Oct 08 '09 01:10 llvmbot

Fix for oprofile part, now checking bfd in the right order Here's a new patch for testing.

llvmbot avatar Oct 06 '09 23:10 llvmbot

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?

llvmbot avatar Oct 06 '09 21:10 llvmbot

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 to bfd_init' /usr/lib/oprofile/libopagent.so: undefined reference to bfd_openr' /usr/lib/oprofile/libopagent.so: undefined reference to bfd_perror' /usr/lib/oprofile/libopagent.so: undefined reference to bfd_get_mach' /usr/lib/oprofile/libopagent.so: undefined reference to bfd_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)

edwintorok avatar Oct 06 '09 18:10 edwintorok