Linking error and memory bloating for .so file creation

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Linking error and memory bloating for .so file creation

Ankush Sharma

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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Linking error and memory bloating for .so file creation

Dan Albert
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.

On Thu, Mar 21, 2019, 11:37 Ankush Sharma <[hidden email]> wrote:

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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAFVaGhv3JunVJyiYE7vOKtov9dDdhRMKBb15d%3D8Uq6ZcZGUXgg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Linking error and memory bloating for .so file creation

John Dallman
In reply to this post by Ankush Sharma
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

On Thu, Mar 21, 2019 at 6:37 PM Ankush Sharma <[hidden email]> wrote:

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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAH1xqg%3D7Y5pRYzvN2X5V2NzLN5z4kKxdh41VrNEdch7Ft2K4Sw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Linking error and memory bloating for .so file creation

Vyacheslav Lanovets

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).



 

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/6caed863-7913-411d-8f33-84a437a60f5d%40googlegroups.com.