This is an archive of the discontinued LLVM Phabricator instance.

[clang] [MinGW] Pass --no-demangle through to the mingw linker
ClosedPublic

Authored by mstorsjo on Nov 16 2021, 11:57 PM.

Details

Summary

Clang has custom handling of --no-demangle, where it is removed
from the input -Wl and -Xlinker options, and readded specifically
by the drivers where it's known to be supported.

Both ld.bfd and lld support the --no-demangle option.

Diff Detail

Event Timeline

mstorsjo requested review of this revision.Nov 16 2021, 11:57 PM
mstorsjo created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptNov 16 2021, 11:57 PM

Adding more potential reviewers. For context, see https://github.com/llvm/llvm-project/blob/llvmorg-14-init/clang/lib/Driver/Driver.cpp#L335-L353 where the original option is filtered out.

Ericson2314 accepted this revision.Jan 1 2022, 11:36 PM
Ericson2314 added a subscriber: Ericson2314.

Not sure what the exact division of labor is between the GNU and MinGW backends, but assuming there is no way to share this between them the patch looks good.

This revision is now accepted and ready to land.Jan 1 2022, 11:36 PM

Not sure what the exact division of labor is between the GNU and MinGW backends, but assuming there is no way to share this between them the patch looks good.

Yeah. Also at this point, this option should probably rather be handled as opt-out for targets that don’t support it, instead of having every single target do manual work to pass it through.

Additionally, this probably doesn’t handle sequences of --no-demangle --demangle correctly, but this just gets this target to the same level as e.g. GNU.

mati865 accepted this revision.Jan 2 2022, 4:59 AM
MaskRay accepted this revision.Jan 2 2022, 11:00 AM

LGTM.

This revision was landed with ongoing or failed builds.Jan 2 2022, 2:22 PM
This revision was automatically updated to reflect the committed changes.