Version: 3.7.0 OS: Linux When building valgrind within a portage environment on a gentoo system, CC="x86_64-pc-linux-gnu-gcc" on amd64. This causes the configure script to fail when parsing the compiler version using gcc_version=`${CC} --version | head -n 1 ... | $SED 's/^[^0-9]*\([0-9.]*\).*$/\1/'` The regular expression matches the first 86 rather than the version number, eg 4.5.1. This can be fixed by modifying the regular expression in configure.in to 's/.*\s\([.0-9]*\)$/\1/'. Patch attached. Reproducible: Always
Created attachment 65536 [details] Fix gcc regex to get version
Created attachment 65588 [details] Another approach I have also made a patch for this and i believe mine is a bit more fleshed out and better explained. So i figured id offer it up as an alternative.
Created attachment 65786 [details] Patch matching braces.
The patch "another approach" does not work because it maches the version number which is between braces, which is provided by --pkgversion= of GCC's configure script. The provider of GCC can choose an arbitrary string here. For instance, Code Sourcery's 2011.03 release prints: arm-none-eabi-gcc (Sourcery G++ Lite 2011.03-42) 4.5.2 And the above mentioned patch returns 2011.03-42. For GCC, the 'right' version number is the one after the string in braces. For Clang, I don't know. I propose the 3rd patch (matching braces)
Created attachment 65829 [details] Fix compiler version check Proposed patch - tested with gcc only. Should work for clang too.
Should be fixed by r12274 (trunk) - thanks for all the contributed patches.