[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Don’t use AC_EGREP_CPP if affected by CFLAGS
From: |
Bruno Haible |
Subject: |
Re: [PATCH] Don’t use AC_EGREP_CPP if affected by CFLAGS |
Date: |
Mon, 06 Nov 2017 20:23:47 +0100 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-97-generic; KDE/5.18.0; x86_64; ; ) |
Hi Paul,
> > This configuration issue comes up occasionally
> It's more than "occasionally", I'm afraid. I just did a Google search
> for 'configure CFLAGS "-m32"' and in the first ten hits, more people got
> it wrong than right. When the error rate is this high, it's appropriate
> to change the code to make errors less likely.
I completely disagree. When the error rate is so high, we should
1) improve the documentation (this is mainly install.texi from Autoconf),
2) add a consistency check in AC_PROG_CC or AC_PROG_CPP.
Ad (1): I am frequently running configures on these kinds of systems.
Therefore I think I could come up with some practically usable text.
i386 Linux, CC="gcc -m32"
Solaris
Mac OS X
Hurd
FreeBSD
NetBSD
OpenBSD
Haiku
Cygwin
Windows
m68k Linux
mips IRIX: 32, CC="cc -32"
n32, CC="cc -n32"
CC="gcc -mabi=n32"
Linux: 32-bit
n32, CC="gcc -mabi=n32"
64-bit, CC="gcc -mabi=64"
sparc Solaris: 32-bit
64-bit
Linux: 32-bit, CC="gcc -m32"
64-bit, CC="gcc -m64"
NetBSD: 32-bit, CC="gcc -m32"
alpha Linux
hppa HP-UX
Linux
hppa64 HP-UX, CC="cc +DD64"
arm Linux
arm64 Linux: 64-bit
FreeBSD: 64-bit
powerpc AIX: 32-bit, CC="xlc", CC="gcc"
64-bit, CC="xlc -q64" AR="ar -X 64" NM="nm -X 64", CC="gcc
-maix64" AR="ar -X 64" NM="nm -X 64"
Linux: 32-bit, CC="gcc -m32"
64-bit BE
64-bit LE ELFv2
Mac OS X
ia64 Linux
HP-UX: 32-bit, CC="cc"
64-bit, CC="cc +DD64"
x86_64 Linux
Solaris
Mac OS X, CC="gcc -m64"
Linux x32, CC="gcc -mx32"
GNU/kFreeBSD
FreeBSD
NetBSD
OpenBSD
Cygwin
Windows
s390 Linux, CC="gcc -m31"
s390x Linux
Ad (2): Before AC_PROG_CC included a check whether the compiler can actually
produce executables, people were frequently reporting odd issues (ranging from
nonexistent compiler commands, to LD_LIBRARY_PATH problems of cc1) to the
mailing
lists. This check helped a lot.
> The patch does not eliminate all uses of AC_EGREP_CPP, only the uses
> where it's common for builders to use idioms like "./configure
> CFLAGS='-m32'" where CFLAGS unexpectedly affects the behavior that the
> AC_EGREP_CPP code is testing for.
It is bad to have 3 ways of using configure - with the same intended result -,
when
- 2 out of the 3 produce a 100% valid result,
- 1 out of the 3 produces a 95% valid result.
People will then waste time to squash out the remaining 5% of bugs in the 3rd
way. It is much better to make it clear that the third way is unsupported.
> Many builders don't know that -m32
> affects the preprocessor, and we can't really expect them to read some
> obscure corner of the Gnulib manual to find this stuff out.
But we can expect them to try differently when they get an error message
"You invoked configure incorrectly. Try with CC="gcc -m32" instead."
Bruno