This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Fix finding multilib gcc install on Gentoo (with gcc-config)
ClosedPublic

Authored by mgorny on Nov 19 2016, 12:39 AM.

Details

Summary

Fix the gcc-config code to support multilib gcc installs properly. This
solves two problems: -mx32 using the 64-bit gcc directory (due to matching
installation triple), and -m32 not respecting gcc-config at all (due to
mismatched installation triple).

In order to fix the former issue, split the multilib scan out of
Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple() (the code
is otherwise unchanged), and call it for each installation found via
gcc-config.

In order to fix the latter issue, split the gcc-config processing out of
Generic_GCC::GCCInstallationDetector::init() and repeat it for all
triples, including extra and biarch triples. The only change
in the gcc-config code itself is adding the call to multilib scan.

Convert the gentoo_linux_gcc_multi_version_tree test input to multilib
x86_64+32+x32 install, and add appropriate tests to linux-header-search
and linux-ld.

Diff Detail

Repository
rL LLVM

Event Timeline

mgorny updated this revision to Diff 78623.Nov 19 2016, 12:39 AM
mgorny retitled this revision from to [Driver] Fix finding multilib gcc install on Gentoo (with gcc-config).
mgorny updated this object.
mgorny added reviewers: chandlerc, bruno, bkramer.
mgorny added a subscriber: cfe-commits.
rengolin resigned from this revision.Dec 12 2016, 1:33 AM
rengolin removed a reviewer: rengolin.

I don't know enough about x86_64's ABI to have a solid opinion.

bkramer accepted this revision.Dec 12 2016, 6:55 AM
bkramer edited edge metadata.

I believe this is fine.

This revision is now accepted and ready to land.Dec 12 2016, 6:55 AM

Thanks for the review. Committed now.

This revision was automatically updated to reflect the committed changes.