autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Link tests when cross compiling


From: NightStrike
Subject: Re: Link tests when cross compiling
Date: Fri, 12 Apr 2013 12:02:36 -1000

On Fri, Apr 12, 2013 at 11:15 AM, Eric Blake <address@hidden> wrote:
> On 04/12/2013 02:47 PM, NightStrike wrote:
>>>>> What gave you the impression that link tests are not allowed when cross
>>>>> compiling?  We use link tests all the time.  It is run tests that
>>>>> require a fallback when cross-compiling, not link tests.
>>>>
>>>> checking for main in -lpthread... configure: error: link tests are not
>>>> allowed after AC_NO_EXECUTABLES
>
> AC_NO_EXECUTABLES is intentionally not documented in the autoconf
> manual; here are the comments at its m4 definition:
>
> # AC_NO_EXECUTABLES
> # -----------------
> # FIXME: The GCC team has specific needs which the current Autoconf
> # framework cannot solve elegantly.  This macro implements a dirty
> # hack until Autoconf is able to provide the services its users
> # need.
> #
> # Several of the support libraries that are often built with GCC can't
> # assume the tool-chain is already capable of linking a program: the
> # compiler often expects to be able to link with some of such
> # libraries.
> #
> # In several of these libraries, workarounds have been introduced to
> # avoid the AC_PROG_CC_WORKS test, that would just abort their
> # configuration.  The introduction of AC_EXEEXT, enabled either by
> # libtool or by CVS autoconf, have just made matters worse.
> #
> # Unlike an earlier version of this macro, using AC_NO_EXECUTABLES does
> # not disable link tests at autoconf time, but at configure time.
> # This allows AC_NO_EXECUTABLES to be invoked conditionally.
>
>>>>
>>>> That's me trying to use AC_CHECK_LIB when cross compiling.
>
> Why are you using AC_NO_EXECUTABLES?  Are you working on gcc?  If so,
> this question is better asked on the gcc list.  If not, then don't use it.

I swear I grepped for that and didn't see it before I ever emailed the
list..... *sigh*...

This is for a pthread replacement library that should be compilable
before we have a working compiler.  I did not make the initial build
system for this, so I have to see what problem this macro is trying to
solve.

Conceivably, though, we should be able to turn it on conditionally in
the worst case instead of all the time.  IOW, only use it if we are
bootstrapping.

What I want to ultimately do is actually test to see if we are in said
bootstrap environment.  In that case, we need to build a fake libgcc
to link in.  Any idea how to do that?

>>>
>>> please post full config.logs.  what you've shown is that your compiler has 
>>> been
>>> flagged as not being able to produce executables which is very different 
>>> from
>>> "is it a cross-compiler".
>>> -mike
>>
>> Attached.  Interesting, though, when I don't cross compile, the check
>> executes.  And, I've always seen this when I try to cross compile.
>>
>> I must have something fundamentally wrong in my understanding.
>> Hopefully, the attached log helps you to enlighten me.
>
> The reason that gcc rejects link tests is because of historical baggage
> of how the uber-tree is used to build an entire cross environment
> (libraries, gcc, gdb, and more, all in one go) - in THAT environment,
> configure can't perform link tests, because the tests would have to link
> against the cross-built libraries, but this is the configure script
> trying to set up those cross-built libraries (they don't exist yet, so
> the link test will do the wrong thing).
>
> Outside of gcc's special needs, you should generally have no problem
> pre-installing cross-built libraries, at which point, you should have no
> need for AC_NO_EXECUTABLES in your configure.ac.
>
> --
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]