Mailing List Archive

autotools: stage1 cross C compiler cannot create executables
Here's another random question from me, for all of the experts on the list ;-)

This one is related to Makefile.am configure.ac - autotools.

I've produced a stage1 cross compiler. I do not yet have a full libc -
just headers - crt files do not exist, so I can't create an
executable. But I would like to compile my libc, and I've decided to
use autotools for some crazy reason. This is a small C library that
I've written (including all the necessary crt files) so the problem
isn't specific to glibc, although I do recall having run into this one
before.

The only problem with autotools and using a stage1 compiler, is that
the macro AC_PROG_CC in configure.ac always dies because the compiler
tries to link main to a fully-fledged executable can't find the crt
files yet.

Is there some kind of auto-magical autoconf incantation that only
checks to see if the compiler can simply compile (and not necessarily
link)?

For some reason, AC_<blank>_<blank>_CHECK comes to mind, but I could
just be senile.

PS: the only justification I have for inquiring on #gentoo-embedded is
because I'm building my package with emerge and it happens to be for a
cross-toolchain built with crossdev :)
Re: autotools: stage1 cross C compiler cannot create executables [ In reply to ]
On Thursday 18 October 2012 18:56:20 Christopher Friedt wrote:
> The only problem with autotools and using a stage1 compiler, is that
> the macro AC_PROG_CC in configure.ac always dies because the compiler
> tries to link main to a fully-fledged executable can't find the crt
> files yet.
>
> Is there some kind of auto-magical autoconf incantation that only
> checks to see if the compiler can simply compile (and not necessarily
> link)?

glibc puts into its aclocal.m4:
dnl These modifications are to allow for an empty cross compiler tree.
define([_AC_COMPILER_EXEEXT], [EXEEXT=
])
-mike
Re: autotools: stage1 cross C compiler cannot create executables [ In reply to ]
awesome - thanks.

I'll give this a shot tomorrow.

On Sat, Oct 20, 2012 at 1:01 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Thursday 18 October 2012 18:56:20 Christopher Friedt wrote:
>> The only problem with autotools and using a stage1 compiler, is that
>> the macro AC_PROG_CC in configure.ac always dies because the compiler
>> tries to link main to a fully-fledged executable can't find the crt
>> files yet.
>>
>> Is there some kind of auto-magical autoconf incantation that only
>> checks to see if the compiler can simply compile (and not necessarily
>> link)?
>
> glibc puts into its aclocal.m4:
> dnl These modifications are to allow for an empty cross compiler tree.
> define([_AC_COMPILER_EXEEXT], [EXEEXT=
> ])
> -mike