[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_CHECK_LIB Not finding Libraries that are not Compiled with PIC
From: |
Eric Blake |
Subject: |
Re: AC_CHECK_LIB Not finding Libraries that are not Compiled with PIC |
Date: |
Thu, 22 May 2014 11:09:24 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
On 05/22/2014 07:39 AM, James L. Barker wrote:
> OS: RHEL 6.5
Have you considered raising a support ticket with Red Hat?
> Autoconf: 2.63
This is not the latest version; perhaps a configure script generated by
a newer autoconf improves the behavior?
> Automake: 1.11.1
>
> I have a library compiled as a mylib.a without Position Independent Code.
>
> When I put the following line in my configure.ac file, the library is
> not found.
> LDFLAGS="-I/usr/local/packages/lib"
> AC_CHECK_LIB(mylib, function)
>
> The ./configure script can't find -lmylib.
What was the exact error message in config.log? It may be that you are
hitting a real limitation of your toolchain, where the linker refuses to
link against incompatible libraries, in which case, it is not a bug in
autoconf but in your setup.
>
> I recompiled mylib.a with the -fPIC options, and all of a sudden
> ./configure can now find it.
>
> Does the ./configure not work with libraries that haven't been compiled
> with position independent code, or is this a bug?
>
> When I do a nm on both the PIC and non-PIC library, the symbols are
> clearly listed.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature