ndk
ndk copied to clipboard
[Bug]: gnu::warning output is not demangled when used with LTO
Description
Under NDK the linked Clang issue https://github.com/llvm/llvm-project/issues/58933 is even worse - linking fails (recognizes the warning as error):
C/C++: ld: error: call to ZN2MB2NN6Namespace4ThingIfEC2ERKS3 marked "dontcall-warn": Don't call this
Upstream bug
https://github.com/llvm/llvm-project/issues/58933
Commit to cherry-pick
No response
Affected versions
r25
Canary version
No response
Host OS
Windows
Host OS version
11
Affected ABIs
armeabi-v7a, arm64-v8a
Based on the upstream bug, this is not a regression from prior releases, correct? Just a (painful) behavior mismatch between LTO and non-LTO builds?
Based on the upstream bug, this is not a regression from prior releases, correct? Just a (painful) behavior mismatch between LTO and non-LTO builds?
I would suppose so - but this is the first version I tried the attribute.
ps. your renaming of the issue is somewhat inadequate - it is not just that is not demangled it is also that the source location is missing and - specific to Android - that it is treated as an error (so linking fails).
You can disable fatal linker warnings if you like. We enable them by default in ndk-build and in our CMake toolchain file. From my read of both bugs, the linker is correct to warn, the display for that warning is just bad. Is that not the case?
Upstream bug was fixed early last year. I don't know which NDK that patch will have first shipped in, but the age means it'll be in r27 if not r26.