This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Give devtoolset path precedence over InstalledDir
Needs ReviewPublic

Authored by nikic on May 23 2023, 5:02 AM.

Details

Reviewers
tstellar
Summary

This is a followup to the change from c5fe10f365247c3dd9416b7ec8bad73a60b5946e. While that commit correctly adds the bindir from devtoolset to the path, the driver dir / install dir still comes first. This means we'll still end up picking /usr/bin/ld rather than the one from devtoolset.

Unfortunately, I don't see any way to test this. In the environment the tests are run, this would only result in a behavior difference if there is an ld binary present in the LLVM build directory, which isn't the case.

Diff Detail

Event Timeline

nikic created this revision.May 23 2023, 5:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2023, 5:02 AM
Herald added a subscriber: StephenFan. · View Herald Transcript
nikic requested review of this revision.May 23 2023, 5:02 AM

Unfortunately, I don't see any way to test this. In the environment the tests are run, this would only result in a behavior difference if there is an ld binary present in the LLVM build directory, which isn't the case.

You can use clang/unittests/Driver/DistroTest.cpp

nikic added a comment.May 24 2023, 6:15 AM

Unfortunately, I don't see any way to test this. In the environment the tests are run, this would only result in a behavior difference if there is an ld binary present in the LLVM build directory, which isn't the case.

You can use clang/unittests/Driver/DistroTest.cpp

Thanks for the pointer! I gave it a try and it does work, but requires switching some code to VFS first. I've put up https://reviews.llvm.org/D151327 to do that independently of this patch.

Unfortunately, I don't see any way to test this. In the environment the tests are run, this would only result in a behavior difference if there is an ld binary present in the LLVM build directory, which isn't the case.

You can use clang/unittests/Driver/DistroTest.cpp

Thanks for the pointer! I gave it a try and it does work, but requires switching some code to VFS first. I've put up https://reviews.llvm.org/D151327 to do that independently of this patch.

Unfortunately this didn't work out, because the code relies on platform-specific behavior that's not straightforward to migrate to VFS.