This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Add multiarch path for RISC-V
ClosedPublic

Authored by Hahnfeld on May 30 2022, 12:04 PM.

Details

Summary

This is required to find headers on the Debian port for RISC-V.

Diff Detail

Event Timeline

Hahnfeld created this revision.May 30 2022, 12:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 30 2022, 12:04 PM
Hahnfeld requested review of this revision.May 30 2022, 12:04 PM
This revision is now accepted and ready to land.May 30 2022, 11:30 PM

This needs a test.

Can Debian's riscv GCC be fixed to use a normalized triple for library and include paths?

This needs a test.

There are no tests for any of the other architectures.

Can Debian's riscv GCC be fixed to use a normalized triple for library and include paths?

This is not specific to RISC-V. As you can see by all the other cases, Clang's target triple is actually not normalized wrt to distro layout.

This needs a test.

There are no tests for any of the other architectures.

@MaskRay is this ok to land without the test? IMHO, if this part of the driver is to be tested, it should happen for all architectures and requires mock directories because the paths are only added to the list of include / library directories if they exist. This goes far beyond this patch, only adding a case to the existing method.

This revision was automatically updated to reflect the committed changes.
MaskRay added a comment.EditedJun 3 2022, 12:41 AM

This needs a test.

There are no tests for any of the other architectures.

Can Debian's riscv GCC be fixed to use a normalized triple for library and include paths?

This is not specific to RISC-V. As you can see by all the other cases, Clang's target triple is actually not normalized wrt to distro layout.

Clang's target triple is normalized, as you can see from its clang -dumpmachine output.
However, Debian chose to have a different opinion and omit unknown/pc from -dumpmachine output.
This added significant overhead to the maintenance of clang driver.
Last year we have this problem that D107799 has been reverted and nobody gives insight whether relanding it will break things, so it just gets stuck.

For Debian, it'd be entirely fine to keep the target triple normalized (therefore paths like -L/usr/lib/gcc-cross/powerpc64le-unknown-linux-gnu/11) while providing executable symlinks without known, e.g. /usr/bin/powerpc64le-linux-gnu-gcc