This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: compiler standards (and/or min gcc version) supported with installedheaders ?
On 01/04/2013 05:12 AM, Andreas Jaeger wrote:
> Here're some minor changes. Please review whether the language itself is clear,
>
> Andreas
>
> * glibc needs a recent GCC compiler version to build itself (right now
> at least 4.3 required, 4.6 or newer recommended)
"The GNU C Library requires GCC version 4.3 or newer to build; GCC
4.6 is recommended."
> * Userland applications and libraries that use glibc's headers and
> libraries can be build by a variety of compilers with the following notes:
s/build/built/g, s/with the following notes://g
"The following community concensus applies to glibc's headers:"
>
> - The installed headers should work with any compiler that:
s/should/shall/g
> * supports at least ISO C 90 (or C++98)
> * supports the type "long long"
OK.
> - GCC version 2.95.3 is the oldest compiler supported in general
> (for some more recent hardware architectures a more recent
> compiler will be needed)
"GCC version 2.95.3 is the oldest supported compiler, with some
architectures requiring more recent versions."
I feel like we should explicitly say:
- GCC versions older than 2.95.3 may still be used, but no
optimizations or special allowances are made for them.
> - Compiler dependend code needs to be protected by proper feature
> test macros.
"Compiler dependent code shall be protected by feature test macros."
> For example the various GCC __builtin_X functions can
> be used but need to be properly guarded.
> - The glibc header files might include special optimizations for
> newer compiler versions which might not be available for older
> compilers
OK.
> - The header files for glibc use GCC 4.3 as baseline for
> optimizations
OK.
> - Support for other compilers besides GCC might need extra patches
> which are welcome to be submitted for inclusion glibc
OK.
> - For headers shared with gnulib, other conditions do apply (the
> requirements from gnulib to support even older compilers)
>
> To support different compilers, we would ideally not test - as today -
> for a specific GCC version but for a specific feature.
>
> So, instead of __GNUC_PREREQ(x,y) to check for a specific version in
> some header file, the advise is to add a macro to features.h, like
> __GLIBC_HAVE_BUILTIN_COMPLEX and use that - and that macro definition
> is dependend on compiler versions.
Agreed.
Thanks for putting this together and driving concensus here.
I assume your goal is to add this to the concensus section on the wiki
and to add it to INSTALL or some other file in the project?
Cheers,
Carlos.