[PATCH] Fix detecting ld version with crosstool-NG (to fix symbol exporting)

Olivier Blin olivier.blin@softathome.com
Tue Jul 3 15:42:00 GMT 2012


ld from crosstool-NG reports a version string with an extra version:
GNU ld (crosstool-NG 1.13.0) 2.21.1

This made libtool assume that the ld version was the crosstool-NG
version (1.13.0) instead of the real ld version (2.21.1).

To fix the ld version string, this patch filters out any string
between parentheses that is followed by a space.

Because of this bug, filtering of exported symbols was not taking
place with crosstool-NG toolchains.

This issue has bee noticed when building pango, which exported
harfbuzz symbols that should have remained hidden.
---
 m4/libtool.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/m4/libtool.m4 b/m4/libtool.m4
index a8ecbc3..61ea4cc 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -4690,7 +4690,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
       _LT_TAGVAR(whole_archive_flag_spec, $1)=
     fi
     supports_anon_versioning=no
-    case `$LD -v 2>&1` in
+    case `$LD -v 2>&1 | $SED -e 's/([[^)]]\+)\s\+//'` in
       *GNU\ gold*) supports_anon_versioning=yes ;;
       *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-- 
1.7.11

This message and any attachments herein are confidential, intended solely for the addressees and are SoftAtHome's ownership. Any unauthorized use or dissemination is prohibited. If you are not the intended addressee of this message, please cancel it immediately and inform the sender.

--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list