This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Fixes for header / library paths on Haiku
ClosedPublic

Authored by brad on Sep 4 2023, 1:08 AM.

Details

Summary

Some fixes for the header / library paths..

  • Use concat macro for all paths
  • Correct the C++ header paths
  • Add library path

Diff Detail

Event Timeline

brad created this revision.Sep 4 2023, 1:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 4 2023, 1:08 AM
brad requested review of this revision.Sep 4 2023, 1:08 AM
brad updated this revision to Diff 555689.Sep 4 2023, 2:04 AM
brad updated this revision to Diff 555783.Sep 4 2023, 6:05 PM
brad updated this revision to Diff 555785.Sep 4 2023, 6:33 PM

Add some C++ header path tests.

brad updated this revision to Diff 555794.Sep 4 2023, 8:07 PM
brad edited the summary of this revision. (Show Details)

Separate out the GCC path handling.

I'm not the Haiku toolchain expert here 😅, all I can do is comparing this with what the GCC toolchain for Haiku does.

clang/lib/Driver/ToolChains/Haiku.cpp
24–25

Should we also add the corresponding non-packaged paths, like /boot/system/non-packaged/lib and /boot/system/non-packaged/develop/lib?

The latest GCC toolchain on Haiku does not do it, but neither does it recognize non-packaged files for the headers.

85–86

Not included by GCC, and not found in my Haiku installation.

I don't know what this is for though, so probably just keep it until someone else says otherwise.

105–106

This seems to have been removed from Haiku, see: https://github.com/haiku/haiku/commit/a3e794ae459fec76826407f8ba8c94cd3535f128

The latest Haiku GCC toolchain does not include it.

clang/test/Driver/haiku.c
29

Should also remove this if the corresponding line in Haiku.cpp is removed.

brad added inline comments.Sep 5 2023, 12:48 AM
clang/lib/Driver/ToolChains/Haiku.cpp
85–86

Not included by GCC, and not found in my Haiku installation.

I don't know what this is for though, so probably just keep it until someone else says otherwise.

This is referring to the os/opengl directory?

105–106

This seems to have been removed from Haiku, see: https://github.com/haiku/haiku/commit/a3e794ae459fec76826407f8ba8c94cd3535f128

The latest Haiku GCC toolchain does not include it.

https://github.com/haikuports/haikuports/blob/master/sys-devel/gcc/patches/gcc-13.2.0_2023_08_10.patchset

I still see the path listed in the GCC configs.

But I see in the Haiku I have installed in my VM that the path indeed is gone.

trungnt2910 added inline comments.Sep 5 2023, 1:52 AM
clang/lib/Driver/ToolChains/Haiku.cpp
85–86

Yes, I was trying to select lines 85-86.

105–106

I was comparing to the output of gcc -v, now I see what's happening:

ignoring nonexistent directory "/boot/system/non-packaged/develop/headers"
ignoring nonexistent directory "/boot/system/develop/headers/os/opengl"
ignoring nonexistent directory "/boot/system/develop/headers/os/be_apps/Deskbar"
ignoring nonexistent directory "/boot/system/develop/headers/3rdparty"

If GCC is doing that, I think we should keep things as they are.

brad added inline comments.Sep 5 2023, 5:03 AM
clang/lib/Driver/ToolChains/Haiku.cpp
24–25

Should we also add the corresponding non-packaged paths, like /boot/system/non-packaged/lib and /boot/system/non-packaged/develop/lib?

The latest GCC toolchain on Haiku does not do it, but neither does it recognize non-packaged files for the headers.

The second path does not exist and the first path has some sub-dirs (Perl / Python) but does not have any libraries.

I'm using what the LLVM patches had. I think we're good as is as a start.

24–25

Should we also add the corresponding non-packaged paths, like /boot/system/non-packaged/lib and /boot/system/non-packaged/develop/lib?

The latest GCC toolchain on Haiku does not do it, but neither does it recognize non-packaged files for the headers.

brad retitled this revision from Haiku: Fixes for header / library paths to [Driver] Fixes for header / library paths on Haiku.Sep 8 2023, 6:05 PM
This revision was not accepted when it landed; it landed in state Needs Review.Sep 8 2023, 6:35 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
brad marked 2 inline comments as not done.
abrachet added inline comments.
clang/test/Driver/haiku.cpp
2

This test is broken for people who configure with a different default CLANG_DEFAULT_CXX_STDLIB. I think this test should add --stdlib=libstdc++

brad added inline comments.Sep 9 2023, 8:28 PM
clang/test/Driver/haiku.cpp
2

This test is broken for people who configure with a different default CLANG_DEFAULT_CXX_STDLIB. I think this test should add --stdlib=libstdc++

Ah, I wasn't aware of that. I made the test such assuming the driver uses a default of libstdc++ on Haiku. I can add the flag.

abrachet added inline comments.Sep 9 2023, 8:30 PM
clang/test/Driver/haiku.cpp
2

I just made https://github.com/llvm/llvm-project/pull/65871, testing it now. But I think it should fix it