Summary: | invalid comparison in glibc-2.3.2 (glibc_setup) to determine 'old' gcc version | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Christopher Friedt <chrisfriedt> |
Component: | New packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | VERIFIED WONTFIX | ||
Severity: | minor | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Christopher Friedt
2006-12-13 00:45:14 UTC
hmm... i suppose instead of [ x -lt y -o x -eq y -a z -lt w ] it could be done with [ x -le y -a z -lt w ] but [ x -ne y ] is definitely incorrect you cant use glibc-2.3.2 for cross-compiling ... in fact, trying to do so will destroy your system really? why then is my binary arm toolchain built with glibc-2.3.2 ? http://www.seiner.com/ts7000/index.php/CrossCompileTools The glibc version that is being used on the workstation is glibc-2.4, the glibc on the board is version 2.3.2, with a 2.4.26 kernel and gcc-3.4.4 . Maybe that wasn't clear before. In any event, I've fixed the problem myself. If you'd like to apply the change, feel free. our ebuilds do not support cross-compiling in those old versions and they probably wont ever Correct Comparison: glibc_setup () { if [ "`gcc-major-version`" -lt "3" -o "`gcc-major-version`" -eq "3" -a "`gcc-minor-version`" -le "2" ]; then echo; eerror "As of glibc-2.3, gcc-3.2 or later is needed"; eerror "for the build to succeed."; diefunc "$FUNCNAME" "$LINENO" "$?" "GCC too old"; fi; Even though the ebuilds will not build with this verion, it still isn't good practice to sacrifice correctness. (In reply to comment #0) > when compiling glibc-2.3.2-r12 (i need this for cross compiling), the build > dies complainging that the version of gcc being used is too old when using > GCC-4.1.1. This is because the comparison statement is logically not correct. > > The file causing the problem is > > /var/tmp/cross/arm-9tdmi-linux-gnu/portage/glibc-2.3.2-r12/temp/environment > > An excerpt looks like: > > glibc_setup () > { > if [ "`gcc-major-version`" -ne "3" -o "`gcc-minor-version`" -lt "2" ]; then > echo; > eerror "As of glibc-2.3, gcc-3.2 or later is needed"; > eerror "for the build to succeed."; > diefunc "$FUNCNAME" "$LINENO" "$?" "GCC too old"; > fi; > ... > > The correct comparison should be: > > glibc_setup () > { > if [ "`gcc-major-version`" -lt "3" -o > "`gcc-major-version`" -eq "3" -a "`gcc-minor-version`" -lt "2" ]; then > echo; > eerror "As of glibc-2.3, gcc-3.2 or later is needed"; > eerror "for the build to succeed."; > diefunc "$FUNCNAME" "$LINENO" "$?" "GCC too old"; > fi; > ... > > I'd fix the file / ebuild itself, but I have no idea to which file it belongs > in /usr/portage/distfiles. ... also, it's probably a good idea to put braces > around the sencond conditional term (they aren't _really_ needed) but I don't > know the proper bash syntax for that. > > Note, if gcc-3.4.6 for example is installed, the user can simply gcc-config [x] > to 3.4.6 and then build with that compiler. I had to completely emerge 3.4.6 to > do that though, so this simple fix (in some mystery ebuild) probably could have > saved me some time. > > Thanks for looking after things > it's dead code ... it's going to get punted ... no point in wasting time on it if you need old glibc versions, the crosstool package should work for you |