Linking error and memory bloating for .so file creation

220 views
Skip to first unread message

Ankush Sharma

unread,
Mar 21, 2019, 2:37:35 PM3/21/19
to android-ndk

Hi Team,


We are generating an ".so" file for the Android ARM 64 flavor on Windows platform.

We are using android ndk 16.1.9


During the linking stage for the “.so” file creation, an error message is being flagged:

ld: error: dummy.so: write: Function not implemented

 

It is different from an "undefined reference" error. There are multiple occurrence of this message during the linking process.

Also the linking doesn’t complete and the output “.so” keeps on bloating reaching size upto 1TB or 100s of GB. Manual termination

is required to stop this process.

No I/O error is getting reported during the link run. Also we are witnessing this issue when moving

from "gnustl" to "LibC++" support for standard C++ library.

Following is the version info for the "clang++.exe\androidndk" used for generating the .so file.
F:\Debug>"F:\androidndk.16.1.9\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe" -v
- Android clang version 5.0.300080  (based on LLVM 5.0.300080)
- Target: x86_64-unknown-linux
- Thread model: posix

Any leads would be appreciated to further converge on the issue.

Dan Albert

unread,
Mar 22, 2019, 12:38:25 PM3/22/19
to android-ndk
There's no such thing as NDK 16.1.9. You should probably start by downloading an up a to date NDK since it isn't clear what you're actually using.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/ead12ffa-b4d2-4dd7-932e-65859ecc2d53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Dallman

unread,
Mar 22, 2019, 1:51:28 PM3/22/19
to andro...@googlegroups.com
Some idea of how you are doing your link - which build environment, what flags are being passed, and so on - might make it possible to diagnose your difficulty, but we can't do anything with what you've posted so far. 

John

--

Vyacheslav Lanovets

unread,
Nov 29, 2019, 8:48:55 AM11/29/19
to android-ndk

I encountered this issue when linking arm 32-bit debug .so binary on Windows using ld from NDK 19c. And all was good when linking 64-bit binaries.

The reason was that resulting .so not-stripped file size was going above 2GB.

When this happens, ld included with NDK r19c starts writing to disk endlessly, fills the whole free disk space on the disk, and then hangs forever. Along the way it generates this "write: Function not implemented" error over and over again.
Proper error message is in order here, in my opinion.

Building Release build helps because it is smaller.
Building with lld helps because it generates smaller binaries.

In fact, after NDK 10e support of huge files is totally broken. objcopy and gdb just show Memory Exhausted, so we use gdb from 10e.

(Totally unrelated, but for our .so files, even small ones, lld in NDK 19c hangs randomly unless I add -no-threads).



 

John Dallman

unread,
Dec 13, 2019, 12:33:21 PM12/13/19
to andro...@googlegroups.com
> The reason was that resulting .so not-stripped file size was going above 2GB.  

Wow. What needs a single .so that big? 

John


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages