This is the mail archive of the
mailing list for the glibc project.
Re: compiler standards (and/or min gcc version) supported with installedheaders ?
- From: Carlos O'Donell <carlos at systemhalted dot org>
- To: Andreas Jaeger <aj at suse dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 03 Jan 2013 09:41:31 -0500
- Subject: Re: compiler standards (and/or min gcc version) supported with installedheaders ?
- References: <email@example.com> <50E53F6C.firstname.lastname@example.org>
On 01/03/2013 03:21 AM, Andreas Jaeger wrote:
> On 12/29/2012 05:57 AM, Mike Frysinger wrote:
>> seems like something we should have spelled out in the manual and/or faq.
>> what standards do we want to support with installed headers ? and similarly,
>> what min gcc version ?
>> going by features.h, it seems like we support very old standards, which means
>> it should be easy to support old gcc versions too. a quick grep on my system
>> shows we have __GNUC_PREREQ(2,0).
> based on the comments in this thread, I wrote the following proposal.
> I've tried to separate the proposal into two discussion points:
> First, what are the requirements. Second which compiler versions to
> * glibc needs a recent GCC compiler version to build itself (right now
> at least 4.3 required, 4.6 or newer recommended)
> * Userland applications and libraries that use glibc's headers and
> libraries can be build by a variety of compilers with the following
> - The compiler needs to support at least ISO C 90 (or C++98)
> - The compiler needs to support the type "long long"
> - GCC version X  is the oldest compiler supported in general (for some
> more recent hardware architectures a more recent compiler will be
> - The glibc header files might include special optimizations for
> newer compiler versions which might not be available for older
> - The header files for glibc use GCC Y  as baseline for such
> - Support for other compilers besides GCC might need extra patches
> which are welcome to be submitted for inclusion glibc
> - 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.
> , :
> I propose to use GCC 2.95.3 as baseline and GCC 4.3 - the same one we
> use for building of glibc - for the optimization part.
> Would this work?
Yes, this sounds good to me. I was just thinking about the supported
vs. optimized issue and it really conflates two problems. We can
support GCC 2.95.3 but not optimize for it. We can optimize for GCC 4.3
and still support GCC 2.95.3.
Thus for example we could get rid of the GCC 2.91 check for __builtin_memset
in sysdeps/unix/sysv/linux/bits/sched.h and clean that up.
We don't win much because choosing to support GCC 2.95.3 isn't a very big
bump, but we're a conservative project and we established guidelines here.
I'd be really afraid to move to anything beyond GCC 3.x as a supported
compiler that could be used with our headers.