bug-autoconf
[Top][All Lists]
Advanced

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

Using autoconf on bear metal


From: Daniel Santos
Subject: Using autoconf on bear metal
Date: Thu, 5 Sep 2019 01:39:43 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

Hello all,

When using a toolchain w/o a libc, AC_PROG_CC fails with "cannot compile
executables" because the link fails with an unresolved reference to
"_exit".  While these types of embedded projects don't have much to
really configure, the rest of autotools can be very helpful.

So for "bear metal" (and I'm imagining a bear with an electric guitar
and head banging), I've found that this can be a work-around:

CC=${host}-gcc
m4_define([_AC_COMPILER_EXEEXT],[])
AC_PROG_CC

The first problem is that if I pass --host=arm-noen-eabi (misspeled) and
run w/o this, then configure succeeds, but only because it built my code
with the native compiler.  I would suggest this is a bug.

Redefining _AC_COMPILER_EXEEXT elides the check for building executables
(because we inherently cannot and shouldn't) and relies upon
_AC_COMPILER_OBJEXT for the actual validation.  The only side-effect is
a some-what misleading error message upon failure:

checking for suffix of object files... configure: error: in
`/home/daniel/proj/embedded/candleLight/fw/build/autotools':
configure: error: cannot compute suffix of object files: cannot compile

Sorry for all the spelling puns -- unless you were amused, in which case
well aren't I -annoying-, I mean clever?

Thanks,
Daniel



reply via email to

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