libstdc++-v3/configure contains this: ldver=`$LD --version 2>/dev/null | head -1 | \ sed -e 's/GNU \(go\)\{0,1\}ld \(version \)\{0,1\}\(([^)]*) \)\{0,1\}\([0-9.][0-9.]*\).*/\4/'` that sed script fails with /usr/bin/sed on Solaris, disabling symbol versioning. Here's an example of what I get: ++ /sbcimp/run/pd/binutils/32-bit/2.18/bin/ld --version ++ head -1 ++ sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*) \)\{0,1\}\([0-9.][0-9.]*\).*/\3/' + ldver='GNU ld (GNU Binutils) 2.18' ++ echo GNU ld '(GNU' 'Binutils)' 2.18 ++ nawk -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }' + glibcxx_gnu_ld_version=1800 This leads to: configure: WARNING: === Linker version 1800 is too old for configure: WARNING: === full symbol versioning support in this release of GCC. configure: WARNING: === You would need to upgrade your binutils to version configure: WARNING: === 21400 or later and rebuild GCC. configure: WARNING: === Symbol versioning will be disabled. configure: versioning on shared library symbols is no Could be fixed by requiring a POSIX sed, or by using awk to select the version (we already require POSIX awk)
should "head -1" also be replaced by "head -n 1" or is that less portable?
(In reply to comment #1) > should "head -1" also be replaced by "head -n 1" or is that less portable? Isn't this a very old issue? I think you will find a straightforward answer / rationale in the archive, or, in other terms, I think we don't want ot change the current practice...
then http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch02.html#manual.intro.setup.prereq should be updated to say a POSIX sed is required.
oh sorry, Paolo, did you only mean the "head" part? I'm not too concerned about that bit, it works everywhere I care about, even if POSIX says otherwise
Yes, I only meant the "head -1" vs "head -n 1" part.
This code block appears to be capable of generating no end of issues, sadly. For the record, POSIX head docs say -n is a requirement for conformance, at least p.2791 of EEE Std 1003.1-2008. Of course, who knows if all platforms support it. I don't see how s/head -1/head -n 1/ will fix the solaris symbol versioning configure error though. FYI, libgomp also does much the same thing and we're trying to keep this stuff in sync so you'll need to do the equivalent thing to libgomp/acinclude.m4's LIBGOMP_CHECK_LINKER_FEATURES.
I've just noticed that the libgomp configure says: configure: versioning on shared library symbols is gnu even though it seems to have the same sed script as libstdc++, which says: configure: WARNING: === Linker version 1800 is too old for configure: WARNING: === full symbol versioning support in this release of GCC. configure: WARNING: === You would need to upgrade your binutils to version configure: WARNING: === 21400 or later and rebuild GCC. configure: WARNING: === Symbol versioning will be disabled. configure: versioning on shared library symbols is no I can't do aanother test until tomorrow now, but I'll try to verify if libgomp really does get it right, and if so, how.
Not sure what happened yesterday, but I get the same result for both libgomp and libstdc++ today: both interpret the GNU ld version as 1800
I usually set the environment variable POSIXLY_CORRECT when I want to catch portability issues. The GNU versions of the utils are usually good about disabling extensions and griping about violations.
I've just noticed this bit of install.texi: The build process works more smoothly with the legacy Sun tools so, if you have @file{/usr/xpg4/bin} in your @env{PATH}, we recommend that you place @file{/usr/bin} before @file{/usr/xpg4/bin} for the duration of the build. That directly contradicts my experience with this bug, which is that you must have /usr/xpg4/bin/sed earlier in your path than /usr/bin/sed in order to get symbol versioning in libstdc++
patch at <http://gcc.gnu.org/ml/gcc-patches/2009-09/msg01599.html>.
Subject: Bug 38923 Author: rwild Date: Wed Sep 30 00:43:28 2009 New Revision: 152315 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152315 Log: sed and head portability fixes in ld version check. libstdc++-v3/: PR libstdc++/38923 * acinclude.m4 (GLIBCXX_CHECK_LINKER_FEATURES): Avoid 'head', use sed script portable to Solaris /bin/sed for extracting ld version. * configure: Regenerate. libgomp/: * acinclude.m4 (LIBGOMP_CHECK_LINKER_FEATURES): Avoid 'head', use sed script portable to Solaris /bin/sed for extracting ld version. * configure: Regenerate. Modified: trunk/libgomp/ChangeLog trunk/libgomp/acinclude.m4 trunk/libgomp/configure trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/acinclude.m4 trunk/libstdc++-v3/configure
Fixed on trunk.
*** Bug 41333 has been marked as a duplicate of this bug. ***
Subject: Bug 38923 Author: jakub Date: Mon Oct 26 20:28:24 2009 New Revision: 153570 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153570 Log: PR libstdc++/38923 * acinclude.m4 (GLIBCXX_CHECK_LINKER_FEATURES): Avoid using too many *s. Accept ld version without text in ()s. * configure: Regenerated. * acinclude.m4 (LIBGOMP_CHECK_LINKER_FEATURES): Avoid using too many *s. Accept ld version without text in ()s. * configure: Regenerated. Modified: trunk/libgomp/ChangeLog trunk/libgomp/acinclude.m4 trunk/libgomp/configure trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/acinclude.m4 trunk/libstdc++-v3/configure
Subject: Bug 38923 Author: law Date: Thu Oct 29 16:37:47 2009 New Revision: 153711 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153711 Log: Recorded merge of revisions 153568-153570 via svnmerge from svn+ssh://law@gcc.gnu.org/svn/gcc/trunk ........ r153568 | jakub | 2009-10-26 14:18:26 -0600 (Mon, 26 Oct 2009) | 10 lines PR debug/41828 * cp-lang.c (cxx_dwarf_name): Return NULL instead of <anonymous ...> for anonymous aggregate names. * dwarf2out.c (add_pubname, add_pubtype, generic_parameter_die, add_name_and_src_coords_attributes, gen_namespace_die, dwarf2out_set_name): Handle dwarf2_name returning NULL. * g++.dg/debug/dwarf2/anonname1.C: New test. ........ r153569 | jakub | 2009-10-26 14:21:09 -0600 (Mon, 26 Oct 2009) | 6 lines PR bootstrap/41345 * cfgcleanup.c (trivially_empty_bb_p): New function. (try_optimize_bb): Use it instead of checking BB_HEAD == BB_END. * gcc.dg/pr41345.c: New test. ........ r153570 | jakub | 2009-10-26 14:28:24 -0600 (Mon, 26 Oct 2009) | 9 lines PR libstdc++/38923 * acinclude.m4 (GLIBCXX_CHECK_LINKER_FEATURES): Avoid using too many *s. Accept ld version without text in ()s. * configure: Regenerated. * acinclude.m4 (LIBGOMP_CHECK_LINKER_FEATURES): Avoid using too many *s. Accept ld version without text in ()s. * configure: Regenerated. ........ Modified: branches/reload-v2a/ (props changed) Propchange: branches/reload-v2a/ ('svnmerge-integrated' modified)
unassigning; fixed for 4.5 by Jakub.
I'm closing this as fixed for 4.5.0.