Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffi/oprofile checked for even when explicitly disabled #5390

Closed
edwintorok opened this issue Sep 21, 2009 · 8 comments
Closed

ffi/oprofile checked for even when explicitly disabled #5390

edwintorok opened this issue Sep 21, 2009 · 8 comments
Labels
bugzilla Issues migrated from bugzilla

Comments

@edwintorok
Copy link
Contributor

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
Copy link
Contributor Author

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)

@llvmbot
Copy link
Member

llvmbot commented Oct 6, 2009

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
Copy link
Member

llvmbot commented Oct 6, 2009

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

@llvmbot
Copy link
Member

llvmbot commented Oct 8, 2009

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

@lattner
Copy link
Collaborator

lattner commented Feb 9, 2010

anyone willing to finish this off?

@llvmbot
Copy link
Member

llvmbot commented Feb 10, 2010

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.

@echristo
Copy link
Contributor

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

@llvmbot
Copy link
Member

llvmbot commented Feb 10, 2010

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 llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

4 participants