ndk icon indicating copy to clipboard operation
ndk copied to clipboard

[Bug]: gnu::warning output is not demangled when used with LTO

Open psiha opened this issue 2 years ago • 3 comments

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

psiha avatar Nov 12 '22 08:11 psiha

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?

DanAlbert avatar Nov 14 '22 22:11 DanAlbert

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

psiha avatar Nov 30 '22 14:11 psiha

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?

DanAlbert avatar Dec 08 '22 19:12 DanAlbert

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.

DanAlbert avatar Aug 21 '24 20:08 DanAlbert