This is an archive of the discontinued LLVM Phabricator instance.

[COFF] Use comdat shared constants for MinGW as well
ClosedPublic

Authored by mstorsjo on Jul 21 2018, 10:44 PM.

Details

Summary

GNU binutils tools have no problems with this kind of shared constants, provided that we actually hook it up completely in AsmPrinter and
produce a global symbol.

This effectively reverts SVN r335918 by hooking the rest of it up properly.

This feature was implemented originally in SVN r213006, with no reason for why it can't be used for MinGW other than the fact that GCC doesn't
do it while MSVC does.

This goes on top of D49645 (which clarifies the current code). If both go in at once, they can be squashed, avoiding adding the flag that is removed directly afterwards again.

@majnemer Or was there any specific reason not to do this for all windows targets?

Diff Detail

Repository
rL LLVM

Event Timeline

mstorsjo created this revision.Jul 21 2018, 10:44 PM
rnk accepted this revision.Jul 23 2018, 10:51 AM

Great, that makes sense now. These constants are regular old comdat constants. This makes us use the MSVC constant name mangling for now, but that's fine. The linker won't deduplicate constants between Clang and GCC, but that's not an ABI compatibility problem.

This revision is now accepted and ready to land.Jul 23 2018, 10:51 AM
This revision was automatically updated to reflect the committed changes.