-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ndk r21 strip.exe failed in windows with "File truncated" error #1176
Comments
I tried to reproduce this the obvious way with a test case with 3 functions, each with 1GiB of inline assembly padding, but that tended to break even the r20 binutils. The error message tended to be "Memory exhausted" instead of "File truncated". I suspect there are 2GiB limits even in the r20 Windows binutils. I did manage to produce a test case that worked with r20 ld.bfd but not r21 ld.bfd. I think a better test case would have gigabytes of debug info that aren't loaded onto the target. I built the r20 Windows binutils and a ToT binutils, and the newer binutils is falling back to 32-bit I/O, whereas the r20 binutils used 64-bit I/O. r20 (binutils-5139636):out/binutils/win64/arm64/build/bfd/bfd-in3.h:
out/binutils/win64/arm64/build/bfd/config.h:
ToT binutilsout/binutils/win64/arm64/build/bfd/bfd-in3.h:
out/binutils/win64/arm64/build/bfd/config.h:
Here's where autoconf goes wrong (out/binutils/win64/arm64/build/bfd/config.log):
|
It looks like autoconf bypasses the system C headers when it calls
test1.c:
The calls work if I declare them using
mingw-w64's stdio.h uses inline versions of
|
@rprichard I've uploaded https://android-review.googlesource.com/c/toolchain/mingw/+/1221662 for further testing. |
I created a test case that successfully links a 2.6GB shared object with r20 bfd and lld. On r21, it links with lld, but bfd prints the "File truncated" error. I see the same behavior targeting either arm32 or arm64. (gold seemed to hang, but maybe it would have finished if I gave it more time.) I confirmed that the patch above fixes the problem. (Rebuild mingw-w64 with the patch, rebuild binutils with the new mingw-w64.) |
@pirama-arumuga-nainar have the mingw prebuilts been updated with the merged patch, or is that still todo? |
@DanAlbert Yes, the mingw prebuilts have merged. |
Thanks @pirama-arumuga-nainar ! Do we know when we will have a new ndk build with the fix? |
Fix is in build 6352462 on https://ci.android.com/builds/branches/aosp-ndk-release-r21/grid? |
Test: ndk/checkbuild.py && ndk/run_tests.py Bug: android/ndk#1176 Change-Id: I66e19574b406437557451c55792e62c06fca8aba (cherry picked from commit 66bff30)
Test: ndk/checkbuild.py && ndk/run_tests.py Bug: android/ndk#1176 Change-Id: I66e19574b406437557451c55792e62c06fca8aba (cherry picked from commit 66bff30)
Test: ndk/checkbuild.py && ndk/run_tests.py Bug: android/ndk#1176 Change-Id: I66e19574b406437557451c55792e62c06fca8aba (cherry picked from commit 66bff30)
I'm using android-ndk-r21/toolchains/llvm/prebuilt/windows-x86_64/arm-linux-androideabi/bin/strip.exe to strip symbol for a big debug version of so file we built for android. The generated libwebcore.so is 2.5G in size, and we are getting following error.
android-ndk-r21/toolchains/llvm/prebuilt/windows-x86_64/arm-linux-androideabi/bin/strip.exe:libwebcore.so: File truncated
It's interesting that the version number for strip.exe is the same in r20 and r21, and the main difference seems to be that in r20 msvcrt.dll is used, while in r21 ucrtbase.dll is used. Are you aware of issues like this? the repro .so file is too big for normal upload. Please contact [email protected] for alternative way to unload the repro debug .so file.
Meanwhile, do you think we can just use strip.exe from r20 as a temporary work around?
Thanks!
Yong
The text was updated successfully, but these errors were encountered: