Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

[droid] fix libtool system link order

Libtool runs some checks internally, then sets the link order for toolchain
libs like libc/libm/libstdc++/libdl/etc. When using libcrystax, in order to
link correctly and pick up all symbols, -lstdc++ MUST come before -lcrystax,
because libstdc++ actually depends on libcrystax for locales, rtti, wchar_t,
and a few other things.

Libtool does not know about this dependency, so we must set it explicitly.
This fixes runtime errors due to missing symbols when loading a lib linked by
libtool, most commonly missing _CurrentRuneLocale.
  • Loading branch information...
1 parent 4f6d354 commit 8f0d270ed98a8c7081216d05133b24823661b3fe Cory Fields committed
1  tools/android/depends/libtool/Makefile
@@ -24,6 +24,7 @@ $(TARBALLS_LOCATION)/$(ARCHIVE):
-rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM)
+ cd $(PLATFORM); patch -p0 < ../fix-libcrystax.patch
13 tools/android/depends/libtool/fix-libcrystax.patch
@@ -0,0 +1,13 @@
+--- libltdl/m4/libtool.m4 2008-09-05 07:54:41.000000000 -0400
++++ libltdl/m4/libtool.m4 2012-11-27 23:25:25.414701465 -0500
+@@ -6489,6 +6489,10 @@
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
++ _LT_TAGVAR(postdeps, $1)="$_LT_TAGVAR(postdeps, $1) -lcrystax"
++ ;;
+ linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)

0 comments on commit 8f0d270

Please sign in to comment.
Something went wrong with that request. Please try again.