-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[Multilib] Extend the Multilib system to support an IncludeDirs field. #146651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
simpal01
wants to merge
7
commits into
llvm:main
Choose a base branch
from
simpal01:sysroot-based-include-paths
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+104
−7
Open
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
30c3530
[Multilib] Extend the Multilib system to support an IncludepPath field.
simpal01 5095244
fixup! [Multilib] Add basic tests for new 'IncludePath' field in mult…
simpal01 fe8fcbf
fixup! fixup! [Multilib] Add basic tests for new 'IncludePath' field …
simpal01 61ca60b
fixup! Remove `-###` and add missing `not` .
simpal01 40398fd
fixup! Using IncludeDirs instead of IncludePath.
simpal01 dce6fed
fixup! Apply clang format.
simpal01 5934caf
fixup! Rename the test files
simpal01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
clang/test/Driver/baremetal-multilib-includepath-error.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
|
|
||
| # REQUIRES: shell | ||
| # UNSUPPORTED: system-windows | ||
|
|
||
| # This test demonstrates the new "IncludePath" field. | ||
| # This field allows specifying include paths through | ||
| # multilib.yaml configuration using relative paths. | ||
| # Absolute paths should be rejected by the driver | ||
| # with an appropriate diagnostic message. | ||
| # | ||
| # This test verifies that passing an absolute path | ||
| # (/include) to IncludePath triggers the expected | ||
| # error. | ||
|
|
||
| # # RUN: %clang --target=aarch64-none-elf --multi-lib-config=%s %s -### -o /dev/null 2>&1 \ | ||
| # RUN: | FileCheck %s --check-prefix=CHECK-ERROR | ||
| # CHECK-ERROR: error: paths must be relative but "/include" starts with "/" | ||
|
|
||
|
|
||
| MultilibVersion: 1.0 | ||
| Variants: | ||
| - Dir: aarch64-none-elf/aarch64a_exn_rtti_unaligned | ||
| Flags: | ||
| - --target=aarch64-unknown-none-elf | ||
| - -munaligned-access | ||
| IncludePath: | ||
| - /include | ||
| - aarch64-none-elf/include | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # REQUIRES: shell | ||
| # UNSUPPORTED: system-windows | ||
|
|
||
| # This test demonstrates the new "IncludePath" field. | ||
| # This field allows specifying include paths through | ||
| # multilib.yaml configuration. When this field is present | ||
| # it is appended to the sysroot during header path | ||
| # resolution ignoring the default bare-metal assumptions. | ||
|
|
||
| # RUN: %clang --multi-lib-config=%s -no-canonical-prefixes -x c++ %s -### -o %t.out 2>&1 \ | ||
| # RUN: --target=thumbv7m-none-eabi -mfloat-abi=soft --sysroot= \ | ||
| # RUN: | FileCheck %s | ||
| # CHECK: "-cc1" "-triple" "thumbv7m-unknown-none-eabi" | ||
| # CHECK-SAME: "-internal-isystem" "[[SYSROOT:[^"]*]]/bin/../lib/clang-runtimes/include/c++/v1" | ||
| # CHECK-SAME: "-internal-isystem" "[[SYSROOT]]/bin/../lib/clang-runtimes/include-libunwind/c++/v1" | ||
| # CHECK-SAME: "-internal-isystem" "[[SYSROOT]]/bin/../lib/clang-runtimes/soft/include/c++/v1" | ||
| # CHECK-SAME: "-internal-isystem" "[[SYSROOT]]/bin/../lib/clang-runtimes/include" | ||
| # CHECK-SAME: "-internal-isystem" "[[SYSROOT]]/bin/../lib/clang-runtimes/include-libunwind" | ||
| # CHECK-SAME: "-internal-isystem" "[[SYSROOT]]/bin/../lib/clang-runtimes/soft/include" | ||
|
|
||
| --- | ||
| MultilibVersion: 1.0 | ||
| Variants: | ||
| - Dir: soft | ||
| Flags: | ||
| - -mfloat-abi=soft | ||
| IncludePath: | ||
| - include | ||
| - include-libunwind | ||
| - soft/include | ||
| ... |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit surprised that this double
#doesn't stop the run from happening!Also slightly surprised that you didn't need a
noton the command line. Does the clang driver not return a failure status when it finds an error inmultilib.yaml?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. It did not give me any failure
When running the command manually:
ah! This might be because I unintentionally included -###, which only prints the driver’s command sequence without actually performing compilation.
After removing -###, it became necessary to include not to ensure the llvm-lit test passed.
Good catch Simon!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will update the test accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see! Well found.