Daniel Richard G. skunk at iSKUNK.ORG
Mon Apr 20 07:19:45 UTC 2015

On Sat, 2015 Apr 18 09:37+0200, Marc Glisse wrote:
> autoconf seems to pass -o first in linking tests (not in compile tests
> though, you might want to discuss that with them), so I believe that
> changing the order would be fine.

I haven't seen any trouble with Autoconf's compile tests. The -o option
doesn't necessarily have to be first, in any event; it just has to
precede anything that isn't an option (source files, object files, etc.)

> > although I wonder, doesn't Autoconf already have logic to determine
> > EXEEXT even in cross-compiling situations?
> I am not familiar with this part of the build system, but if I
> understand correctly, GMP needs 2 toolchains, one targetting the build
> system (to generate some tables for instance) and one targetting the
> host system. Using some parts of autoconf may require splitting things
> into 2 separate configure.

I'd be surprised if Autoconf didn't already address this use case, given
how much work they've put into cross-compilation support. No big deal
either way, however.

> > One other note: The compiler invocation in this macro needs to be
> > passed $CFLAGS and $CPPFLAGS (or possibly $CFLAGS_FOR_BUILD and
> > $CPPFLAGS_FOR_BUILD). Unless you're running something like "$CC --
> > help", it's generally bad form to run the compiler without the user
> > flags, as those flags may contain something necessary for it to work
> > correctly.
> When the compiler needs some flags to run at all, it is generally
> recommended to add them to $CC directly instead of $CFLAGS. Adding the
> flags probably makes sense, but I'll leave that to someone who
> understands it better than me.

The recommendation of putting "important" flags into $CC instead of
$CFLAGS et al. came about precisely because of instances like this
where a build system invokes $CC without the associated flags. It's
a workaround, which is fine if you need to get something up and
running quickly, but it doesn't relate to the point of actually
fixing the issue.

In this case, the compiler is compiling and linking source, therefore it
needs the flags that relate to those operations. (I forgot to mention


Daniel Richard G. || skunk at iSKUNK.ORG
My ASCII-art .sig got a bad case of Times New Roman.

More information about the gmp-bugs mailing list