This is an archive of the discontinued LLVM Phabricator instance.

[LinkModules] Intelligently merge triples that differ only in the minimum version number if the vendor is apple
ClosedPublic

Authored by ahatanak on Feb 12 2015, 8:22 AM.

Details

Summary

Currently, when we merge two triples that differ only in the minimum version number, we give a warning such as:

WARNING: Linking two modules of different target triples: 'thumbv7-apple-ios8.0.0' and 'thumbv7-apple-ios3.0.0'

This patch fixes LinkModules to stop warning and pick the triple with the larger version number in such case.

rdar://problem/16743513

Diff Detail

Repository
rL LLVM

Event Timeline

ahatanak updated this revision to Diff 19834.Feb 12 2015, 8:22 AM
ahatanak retitled this revision from to [LinkModules] Intelligently merge triples that differ only in the minimum version number if the vendor is apple.
ahatanak updated this object.
ahatanak edited the test plan for this revision. (Show Details)
ahatanak added a reviewer: dexonsmith.
ahatanak added a subscriber: Unknown Object (MLST).
lib/Linker/LinkModules.cpp
1501–1505 ↗(On Diff #19834)

I've run into this problem too when trying to link amdgcn triples with differing operating systems (e.g. amgcn-- and amdgcn--amdhsa).

Would it be possible to move this part into a separate function like you've done for triplesMatch(), so that it could be more easily updated for other targets.

Thanks,
Tom

ahatanak updated this revision to Diff 19858.Feb 12 2015, 2:23 PM

Address review comments.

In summary, this patch makes the following changes:

  • Change ModuleLinker to stop issuing a warning when the Triple objects compare equal even when the triple strings differ.
  • On Apple platforms, choose the triple that has the larger version number.
This revision was automatically updated to reflect the committed changes.