Require at least gcc 4.2
It looks like grub2's codebase triggers bugs in old compiler. I don't feel like we should support these compilers at all. Hence this patch. If someone wants to use older compiler he's free to patch this check out but this way he's aware that we don't support gcc prior to 4.2
Signature · 4 lines
Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
ChangeLog +6 -0
@@ -1,3 +1,9 @@ +2009-09-01 Vladimir Serbinenko <[email protected]> + + Remove gcc < 4.2 support. + + * configure.ac (grub_cv_cc_recent): New check. + 2009-08-30 Vladimir Serbinenko <[email protected]> * kern/file.c (grub_file_read): Spelling fix
configure.ac +9 -0
@@ -213,6 +213,15 @@ CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" LIBS="" +AC_CACHE_CHECK([whether gcc is recent enough], grub_cv_cc_recent, [ + CFLAGS= + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#if defined (__GNUC__) && (__GNUC__ < 4 || __GNUC_MINOR__ < 2) +#error Use at least GCC 4.2 +#endif +]], [[]])],[grub_cv_cc_recent=yes],[grub_cv_cc_recent=no]) ]) +test "x$grub_cv_cc_recent" = xyes || AC_MSG_ERROR([GCC >= 4.2 is required]) + if test "x$TARGET_CFLAGS" = x; then # debug flags. TARGET_CFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \
Quoted 4 lines · Vladimir 'phcoder' Serbinenko
It looks like grub2's codebase triggers bugs in old compiler. I don't feel like we should support these compilers at all. Hence this patch. If someone wants to use older compiler he's free to patch this check out but this way he's aware that we don't support gcc prior to 4.2
Hi,
I don't think it's gcc's version that's causing the problem, it's the bug of some local port like apple's gcc. In fact, I've been using mingw gcc 3.4.5 for a long time and doesn't seem to have issue. It'd be nice to locate the specific bug and write a small test problem to check for it (something like NESTED_FUNC_ATTR), instead of reply blindly on gcc version. (what if apple's gcc-4.2 also contain some bug ?)
Signature · 4 lines
Bean gitgrub home: http://github.com/grub/grub/ my fork page: http://github.com/bean123/grub/
Quoted 9 lines · Bean
Quoted 4 lines · Vladimir 'phcoder' Serbinenko
It looks like grub2's codebase triggers bugs in old compiler. I don't feel like we should support these compilers at all. Hence this patch. If someone wants to use older compiler he's free to patch this check out but this way he's aware that we don't support gcc prior to 4.2
Hi,
Quoted 7 lines
I don't think it's gcc's version that's causing the problem, it's the bug of some local port like apple's gcc. In fact, I've been using mingw gcc 3.4.5 for a long time and doesn't seem to have issue. It'd be nice to locate the specific bug and write a small test problem to check for it (something like
NESTED_FUNC_ATTR), instead of reply blindly on gcc version. (what if apple's gcc-4.2 also contain some bug ?)
There was a test to check for it but it was removed because there is no way to do such check in cross-compiler environment.
Even if gcc<4.2 seem to work ok I think we shouldn't waste resources on it and officially declare a minimal requirement ("you're free to go under requirement but don't post bugreports if you do")
Quoted 13 lines
--
Beangitgrub home: http://github.com/grub/grub/
my fork page: http://github.com/bean123/grub/_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 4 lines
Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
Quoted 17 lines · Vladimir 'phcoder' Serbinenko
Quoted 9 lines · Bean
Quoted 4 lines · Vladimir 'phcoder' Serbinenko
It looks like grub2's codebase triggers bugs in old compiler. I don't feel like we should support these compilers at all. Hence this patch. If someone wants to use older compiler he's free to patch this check out but this way he's aware that we don't support gcc prior to 4.2
Hi,
Quoted 7 lines
I don't think it's gcc's version that's causing the problem, it's the bug of some local port like apple's gcc. In fact, I've been using mingw gcc 3.4.5 for a long time and doesn't seem to have issue. It'd be nice to locate the specific bug and write a small test problem to check for it (something like
NESTED_FUNC_ATTR), instead of reply blindly on gcc version. (what if apple's gcc-4.2 also contain some bug ?)
Quoted 5 lines
There was a test to check for it but it was removed because there is no way to do such check in cross-compiler environment.
Even if gcc<4.2 seem to work ok I think we shouldn't waste resources on it and officially declare a minimal requirement ("you're free to go under requirement but don't post bugreports if you do")
Hi,
Could you post a small test problem that illustrate the bug ?
Signature · 4 lines
Bean gitgrub home: http://github.com/grub/grub/ my fork page: http://github.com/bean123/grub/
Quoted 25 lines · Bean
Quoted 17 lines · Vladimir 'phcoder' Serbinenko
Quoted 9 lines · Bean
Quoted 4 lines · Vladimir 'phcoder' Serbinenko
It looks like grub2's codebase triggers bugs in old compiler. I don't feel like we should support these compilers at all. Hence this patch. If someone wants to use older compiler he's free to patch this check out but this way he's aware that we don't support gcc prior to 4.2
Hi,
Quoted 7 lines
I don't think it's gcc's version that's causing the problem, it's the bug of some local port like apple's gcc. In fact, I've been using mingw gcc 3.4.5 for a long time and doesn't seem to have issue. It'd be nice to locate the specific bug and write a small test problem to check for it (something like
NESTED_FUNC_ATTR), instead of reply blindly on gcc version. (what if apple's gcc-4.2 also contain some bug ?)Quoted 5 lines
There was a test to check for it but it was removed because there is no way to do such check in cross-compiler environment.
Even if gcc<4.2 seem to work ok I think we shouldn't waste resources on it and officially declare a minimal requirement ("you're free to go under requirement but don't post bugreports if you do")
Quoted 3 lines
Hi,
Could you post a small test problem that illustrate the bug ?
Yves Blusseau reported to me that modules compiled with gcc-4.0 based Apple's CC failed whereas the ones compiled with gcc-4.2 worked well. As MacOSX is the only OS I'm aware of which ships pre-4.2 gcc by default (the actually ship both 4.0 and 4.2) I thought it may be just a gcc 4.0 bug. Even if it's not so I still think dropping support for old building environments is a good thing since it decreases bug possibilities and so maintainance work too. If you want to add --disable-gcc-check it's ok with me. Just take my patch as base, replace the check line with
#if defined (__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2))
add --disable-gcc-check and commit (since it's approved by Robert Millan in another mail)
Quoted 13 lines
--
Beangitgrub home: http://github.com/grub/grub/
my fork page: http://github.com/bean123/grub/_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 4 lines
Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
Quoted 5 lines
Quoted 4 lines
Hi,
Could you post a small test problem that illustrate the bug ?
Yves Blusseau reported to me that modules compiled with gcc-4.0 based Apple's CC failed whereas the ones compiled with gcc-4.2 worked well. As MacOSX is the only OS I'm aware of which ships pre-4.2 gcc by default (the
Unfortunately, Solaris currently ships with
% /usr/sfw/bin/gcc -v
gcc version 3.4.3 (csl-sol210-3_4-20050802)
I'm not sure when we're updating to 4.x (hopefully soon, for many reasons,
but I just don't know).
--S
From: "Vladimir 'phcoder' Serbinenko" <[email protected]>
Date: Tue, 1 Sep 2009 19:02:39 +0200
Quoted 3 lines
Even if it's not so I still think dropping support for old building environments is a good thing since it decreases bug possibilities and so maintainance work too.
It also decreases your testing base.
I think this change is short-sighted.
If anything, only make this restriction on x86 platforms, which is the only place where this issue even happens.
From: "Vladimir 'phcoder' Serbinenko" <[email protected]>
Date: Tue, 1 Sep 2009 16:12:20 +0200
Quoted 3 lines
Even if gcc<4.2 seem to work ok I think we shouldn't waste resources on it and officially declare a minimal requirement ("you're free to go under requirement but don't post bugreports if you do")
You're making it such that I won't be able to do development on my main sparc development machine, which is using gcc-4.1.3
In my view, this is going a bit overboard as a method to address this problem.
Quoted 7 lines · David Miller
From: "Vladimir 'phcoder' Serbinenko" <[email protected]>
Date: Tue, 1 Sep 2009 16:12:20 +0200Quoted 3 lines
Even if gcc<4.2 seem to work ok I think we shouldn't waste resources on it and officially declare a minimal requirement ("you're free to go under requirement but don't post bugreports if you do")
Quoted 5 lines
You're making it such that I won't be able to do development on my main sparc development machine, which is using gcc-4.1.3
In my view, this is going a bit overboard as a method to address this problem.
Why not just skip the check? (e.g. --disable-gcc-check)
Signature · 5 lines
Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
Quoted 8 lines · Robert Millan
Quoted 7 lines · David Miller
From: "Vladimir 'phcoder' Serbinenko" <[email protected]>
Date: Tue, 1 Sep 2009 16:12:20 +0200Quoted 3 lines
Even if gcc<4.2 seem to work ok I think we shouldn't waste resources on it and officially declare a minimal requirement ("you're free to go under requirement but don't post bugreports if you do")
Quoted 7 lines
Quoted 5 lines
You're making it such that I won't be able to do development on my main sparc development machine, which is using gcc-4.1.3
In my view, this is going a bit overboard as a method to address this problem.
Why not just skip the check? (e.g. --disable-gcc-check)
The central issue IMO isn't whether this is enforced by configure, but whether it's legitimate to report failure to build with older compilers as a bug.
No offence, but this proposal strikes me as slightly lazy. In other words, I think these bugs should be identified instead of being "fixed" by declaring "your compiler is too old".
FWIW, I still use i386-elf-gcc 3.4.3 under Mac OS X, because (last time I checked) it's the most recent version available from macports. The fact is that a lot of people outside those who install a new version of Linux every six months or so are still using these old compilers.
Regards,
Neil
Quoted 4 lines · Neil Cafferkey
No offence, but this proposal strikes me as slightly lazy. In other words, I think these bugs should be identified instead of being "fixed" by declaring "your compiler is too old".
In this case, we weren't speaking about bugs we had, which would need to be fixed, but about bugs in GCC, which had been presumably fixed in GCC, and for which we were being dragged into keeping workarounds.
It turns out the problem in GCC is not really considered to be "fixable", and therefore might not be seen as a bug. So this discussion is now moot, but the general principle stands.
Quoted 2 lines
FWIW, I still use i386-elf-gcc 3.4.3 under Mac OS X, because (last time I checked) it's the most recent version available from macports.
I just checked. There's now GCC 4.4, and even 4.5 snapshots.
Quoted 3 lines
The fact is
that a lot of people outside those who install a new version of Linux every six months or so are still using these old compilers.
Debian etch was released more than 2 years ago, and it already had GCC 4.1.
Signature · 5 lines
Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
configure.ac CPPFLAGS="$TARGET_CPPFLAGS" · line 221
Quoted 7 lines · Vladimir 'phcoder' Serbinenko
configure.ac +6
-0+AC_CACHE_CHECK([whether gcc is recent enough], grub_cv_cc_recent, [ + CFLAGS= + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#if defined (__GNUC__) && (__GNUC__ < 4 || __GNUC_MINOR__ < 2) +#error Use at least GCC 4.2 +#endif
This would fail with e.g. GCC 5.0. Other than this, the patch is fine.
If Bean wants to add a configure option (e.g. like QEMU's --disable-gcc-check) so that this requirement can be overriden, that's ok too.
Signature · 5 lines
Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
Quoted 11 lines · Robert Millan
configure.ac CPPFLAGS="$TARGET_CPPFLAGS" · line 221
Quoted 7 lines · Vladimir 'phcoder' Serbinenko
configure.ac +6
-0+AC_CACHE_CHECK([whether gcc is recent enough], grub_cv_cc_recent, [ + CFLAGS= + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#if defined (__GNUC__) && (__GNUC__ < 4 || __GNUC_MINOR__ < 2) +#error Use at least GCC 4.2 +#endifThis would fail with e.g. GCC 5.0. Other than this, the patch is fine.
Quoted 2 lines
If Bean wants to add a configure option (e.g. like QEMU's --disable-gcc-check) so that this requirement can be overriden, that's ok too.
Btw, INSTALL file still says 2.95. If we do this, it should be adjusted as well.
Signature · 5 lines
Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
Quoted 12 lines · Robert Millan
Quoted 11 lines · Robert Millan
configure.ac CPPFLAGS="$TARGET_CPPFLAGS" · line 221
Quoted 7 lines · Vladimir 'phcoder' Serbinenko
configure.ac +6
-0+AC_CACHE_CHECK([whether gcc is recent enough], grub_cv_cc_recent, [ + CFLAGS= + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#if defined (__GNUC__) && (__GNUC__ < 4 || __GNUC_MINOR__ < 2) +#error Use at least GCC 4.2 +#endifThis would fail with e.g. GCC 5.0. Other than this, the patch is fine.
Quoted 6 lines
Quoted 2 lines
If Bean wants to add a configure option (e.g. like QEMU's --disable-gcc-check) so that this requirement can be overriden, that's ok too.
Btw, INSTALL file still says 2.95. If we do this, it should be adjusted as well.
Cosidering recent gcc's still have nested function bug I consider forcing 4.2 is absolutely unnecessary.
However INSTALL needs to be upgraded and mention a newer GCC since grub2 isn't compileable with gcc 2.95
Quoted 13 lines
--
Robert MillanThe DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 4 lines
Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
Quoted 16 lines · Vladimir 'phcoder' Serbinenko
Quoted 15 lines · Robert Millan
Quoted 13 lines · Robert Millan
configure.ac CPPFLAGS="$TARGET_CPPFLAGS" · line 221
Quoted 7 lines · Vladimir 'phcoder' Serbinenko
configure.ac +6
-0+AC_CACHE_CHECK([whether gcc is recent enough], grub_cv_cc_recent, [ + CFLAGS= + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#if defined (__GNUC__) && (__GNUC__ < 4 || __GNUC_MINOR__ < 2) +#error Use at least GCC 4.2 +#endifThis would fail with e.g. GCC 5.0. Other than this, the patch is fine.
If Bean wants to add a configure option (e.g. like QEMU's --disable-gcc-check) so that this requirement can be overriden, that's ok too.
Quoted 7 lines
Quoted 3 lines
Btw, INSTALL file still says 2.95. If we do this, it should be adjusted as well.
Cosidering recent gcc's still have nested function bug I consider forcing 4.2 is absolutely unnecessary.
However INSTALL needs to be upgraded and mention a newer GCC since grub2 isn't compileable with gcc 2.95
David et al, can we agree on a minimal version of GCC that we should recommend?
For mentioning in the INSTALL file only. I assume nobody's interested in gcc 2.95.
Signature · 5 lines
Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
From: Robert Millan <[email protected]>
Date: Sat, 5 Sep 2009 23:26:11 +0200
Quoted 5 lines
David et al, can we agree on a minimal version of GCC that we should recommend?
For mentioning in the INSTALL file only. I assume nobody's interested in gcc 2.95.
I think gcc-4.1.x, maybe specifically gcc-4.1.3 is a reasonable base point.
If we want to go back as far as gcc-3.4.x, probably gcc-3.4.6
Quoted 11 lines · David Miller
From: Robert Millan <[email protected]>
Date: Sat, 5 Sep 2009 23:26:11 +0200Quoted 5 lines
David et al, can we agree on a minimal version of GCC that we should recommend?
For mentioning in the INSTALL file only. I assume nobody's interested in gcc 2.95.
I think gcc-4.1.x, maybe specifically gcc-4.1.3 is a reasonable base point.
Ok. For the time being it'll list GCC 4.1.3.
Signature · 5 lines
Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."