This is an archive of the discontinued LLVM Phabricator instance.

Add back --sysroot support for darwin header search.
ClosedPublic

Authored by jyknight on May 22 2019, 1:17 PM.

Details

Summary

Before e97b5f5cf37e ([clang][Darwin] Refactor header search path logic
into the driver), both --sysroot and -isysroot worked to specify where
to look for system and C++ headers on Darwin. However, that change
caused clang to start ignoring --sysroot.

This fixes the regression, and adds tests.

(I also note that on all other platforms, clang seems to almost
completely ignore -isysroot, but that's another issue...)

Diff Detail

Repository
rC Clang

Event Timeline

jyknight created this revision.May 22 2019, 1:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2019, 1:17 PM
ldionne accepted this revision.May 22 2019, 1:32 PM

This LGTM.

When I did the refactor, all the code was only using -isysroot (and never accessing --sysroot), so I thought only -isysroot was relevant on Darwin. Seems like I was wrong.

This revision is now accepted and ready to land.May 22 2019, 1:32 PM

This LGTM.

When I did the refactor, all the code was only using -isysroot (and never accessing --sysroot), so I thought only -isysroot was relevant on Darwin. Seems like I was wrong.

The isysroot argument to the cc1 compiler invocation got populated from both isysroot and --sysroot in the driver, so that's why the behavior changed here.

This revision was automatically updated to reflect the committed changes.