NDK r8b debug bild does not link anymore

456 views
Skip to first unread message

pps

unread,
Aug 10, 2012, 8:06:15 PM8/10/12
to andro...@googlegroups.com
I tried to build with latest r8b and it doesn't not link my app in debug build anymore.

I've been building it since r4, currently using r7 (some r7x version had bugs that prevented my so from loading because it would import some gcc specific symbols that aren't present on devices)
r8 works fine (didn't actually try to load, but it builds everything). r8b fails to link debug builds. After trying different settings it appears that NDK_DEBUG=1 makes the problem (NDK_DEBUG=0 is fine);

I get these link errors:
SharedLibrary  : libXXX.so
`.LTHUNK6' referenced in section `.text._ZN3DeviceTupleImplD1Ev[DeviceTupleImpl::~DeviceTupleImpl()]' of ./obj
/local/armeabi/libYYY.a(DeviceTuple.o): defined in discarded section `.text._ZN3DeviceTupleImplD2Ev[_ZN3D
eviceTupleImplD5Ev]' of ./obj/local/armeabi/libYYY.a(DeviceTuple.o)
`.LTHUNK5' referenced in section `.text._ZN3ServiceTupleImplD1Ev[ServiceTupleImpl::~ServiceTupleImpl()]' of ./
obj/local/armeabi/libYYY.a(ServiceTuple.o): defined in discarded section `.text._ZN3ServiceTupleImplD2Ev[_ZN3S
IP16ServiceTupleImplD5Ev]' of ./obj/local/armeabi/libYYY.a(ServiceTuple.o)
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/libXXX.so] Error 1

Basically, the project compiles many static libs (libYYY for example), then uses all of them to create final shared libXXX.so

I'm building on windows using regular cmd.exe, I have no warnings at compile time.



Andrew Hsieh

unread,
Aug 10, 2012, 9:09:32 PM8/10/12
to andro...@googlegroups.com
It looks like mix up object from two version of compiler (in r8b there are 4.6 (default), and 4.4.3). Could you clean up ./obj and rebuild ? 





--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/EddjTzqJAkoJ.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

pps

unread,
Aug 11, 2012, 7:28:10 PM8/11/12
to andro...@googlegroups.com
I also had that suspicion, so I manually had removed obj completely to make sure that it wasn't that problem.

Andrew Hsieh

unread,
Aug 11, 2012, 9:43:50 PM8/11/12
to andro...@googlegroups.com
Please open a new issue at  http://code.google.com/p/android/issues/entry?template=Tools%20bug%20report to track it.  Also, does problem exist with ld.gold or 4.4.3 ?  In other words, please try:
1. Assuming you are targeting arm, add "LOCAL_LDLIBS += -fuse-ld=gold" in jni/Android.mk, get android-ndk-r8b-windows-update-arm-ld._ip from http://code.google.com/p/android/issues/detail?id=35209, and clean build.
2. Add NDK_TOOLCHAIN_VERSION=4.4.3 in Application.mk

Thanks,

To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/G05q8MvJTL8J.

pps

unread,
Aug 12, 2012, 5:06:28 PM8/12/12
to andro...@googlegroups.com
I created bugreport and results of what you asked to try: http://code.google.com/p/android/issues/detail?id=36275&thanks=36275&ts=1344804593
in short, now it links with lots of warnings (I didn't have any before).
NDK_TOOLCHAIN_VERSION=4.4.3 fails with this error: collect2: cannot find 'ld' Perhaps, this would work with cygwin
Reply all
Reply to author
Forward
0 new messages