This is an archive of the discontinued LLVM Phabricator instance.

[Driver] move Haiku header search path management to the driver
ClosedPublic

Authored by brad on Aug 11 2023, 6:34 PM.

Details

Summary

Here is a first cut at moving the Haiku header search path management to the driver as has been done for many other OS's to date.

InitHeaderSearch::AddDefaultCIncludePaths() currently does not skip adding /usr/local/include as well as /usr/include on Haiku. I installed
Haiku in a VM and see that neither path exists on an initial install. The other header paths and contents do exist out of the box. I have
not included those paths when moving the header path management to the driver so far.

I have not built this on Haiku. I am looking for an actual Haiku user to test this.

Diff Detail

Event Timeline

brad created this revision.Aug 11 2023, 6:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 11 2023, 6:34 PM
brad requested review of this revision.Aug 11 2023, 6:34 PM

I will test the patch and see if it works as expected. Note that we currently have the following preset header paths in our GCC port.

clang/lib/Driver/ToolChains/Haiku.cpp
58

Not (or no longer) in GCC default sys path, so can be removed.

86

Missing: /boot/system/develop/headers/gnu

brad updated this revision to Diff 549757.EditedAug 13 2023, 2:17 PM

Removed:
/boot/system/develop/headers/os/arch

Added:
/boot/system/develop/headers/gnu

I looked back as far as the package recipes and patches go back to 2015, but I don't see where the respective paths were added or removed. The original set of paths were added to Clang in 2010. I'll go with what's in the Haiku GCC patches.

nielx accepted this revision.Aug 15 2023, 9:52 AM

I have applied the patch to a recent checkout of the llvm repository, and I then built clang. With this clang build I have built various source files that depend on headers that are in the system search paths. I can confirm that the compiler was able to find all the referenced headers.

This change looks good to me.

This revision is now accepted and ready to land.Aug 15 2023, 9:52 AM
This revision was landed with ongoing or failed builds.Aug 15 2023, 4:59 PM
This revision was automatically updated to reflect the committed changes.