On Fri, 6 Jul 2018, Segher Boessenkool wrote: > Version checks are terrible. This is nothing new.
The key principle behind --with-glibc-version is that you can pass that option *when building the static-only inhibit_libc bootstrap compiler without having built glibc yet* and it will result in the compiler being correctly configured for the specified glibc version, and thus able to build glibc binaries identical to those you get from a longer alternating sequence of compiler and glibc (headers) builds. At that point in a bootstrap of a cross toolchain you don't have any target glibc headers available (you might have target kernel headers) and so have no other way in which the compiler can possibly tell what glibc version is in use. > For cross builds you can just assume it works. That should work fine here. We definitely support building a new GCC using a sysroot of an old glibc (so that the new GCC can then be used to build binaries that will run on old distributions, for example). (This certainly works and is useful for x86_64; I don't assert whether or not it works, or makes sense, for powerpc64le.) Of course in that case the build can examine target headers to determine versions and features, but a new GCC release is still likely to be able to build a few past glibc release branches if anyone backported the required build fixes to those branches, and so the bootstrap case is still useful with somewhat older glibc versions. -- Joseph S. Myers jos...@codesourcery.com