Skip to content
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

Use multiarch layout with multilibs for libc++ headers #70172

Open
petrhosek opened this issue Oct 25, 2023 · 1 comment
Open

Use multiarch layout with multilibs for libc++ headers #70172

petrhosek opened this issue Oct 25, 2023 · 1 comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl'

Comments

@petrhosek
Copy link
Member

petrhosek commented Oct 25, 2023

For the following multilib.yaml file:

MultilibVersion: 1.0

Variants:
- Dir: testdir1
  Flags: [--target=thumbv7m-none-unknown-eabi]

- Dir: testdir2
  Flags: [--target=thumbv7em-none-unknown-eabi]

Mappings:
- Match: --target=thumbv7em-none-unknown-eabi
  Flags: [--target=thumbv7m-none-unknown-eabi]

We'll end up with the following include directories:

-internal-isystem [[SYSROOT]]/bin/../lib/clang-runtimes/testdir1/include/c++/v1"
-internal-isystem [[SYSROOT]]/bin/../lib/clang-runtimes/testdir2/include/c++/v1"

This is suboptimal. libc++ headers are designed to be target agnostic with the exception of __config_site to avoid having to distribute multiple copies of headers, one for each target or multilib.

Ideally, what we should end up with is something like this:

-internal-isystem [[SYSROOT]]/bin/../include/thumbv7m-none-unknown-eabi/testdir1/include/c++/v1
-internal-isystem [[SYSROOT]]/bin/../include/thumbv7m-none-unknown-eabi/testdir2/include/c++/v1
-internal-isystem [[SYSROOT]]/bin/../include/c++/v1

Where [[SYSROOT]]/bin/../include/thumbv7m-none-unknown-eabi/testdir1/include/c++/v1 and [[SYSROOT]]/bin/../include/thumbv7m-none-unknown-eabi/testdir2/include/c++/v1 should only contain __config_site.

@petrhosek petrhosek added the clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' label Oct 25, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 25, 2023

@llvm/issue-subscribers-clang-driver

Author: Petr Hosek (petrhosek)

For the following `multilib.yaml` file: ``` --- MultilibVersion: 1.0

Variants:

  • Dir: testdir1
    Flags: [--target=thumbv7m-none-unknown-eabi]

  • Dir: testdir2
    Flags: [--target=thumbv7em-none-unknown-eabi]

Mappings:

  • Match: --target=thumbv7em-none-unknown-eabi
    Flags: [--target=thumbv7m-none-unknown-eabi]

We'll end up with the following include directories:

-internal-isystem [[SYSROOT]]/bin/../lib/clang-runtimes/testdir1/include/c++/v1"
-internal-isystem [[SYSROOT]]/bin/../lib/clang-runtimes/testdir2/include/c++/v1"


This is suboptimal. libc++ headers are designed to be target agnostic with the exception of `__config_site` to avoid having to distribute multiple copies of headers, one for each target or multilib.

Ideally, what we should end up with is something like this:

-internal-isystem [[SYSROOT]]/bin/../include/thumbv7m-none-unknown-eabi/testdir1/include/c++/v1
-internal-isystem [[SYSROOT]]/bin/../include/thumbv7m-none-unknown-eabi/testdir2/include/c++/v1
-internal-isystem [[SYSROOT]]/bin/../include/c++/v1


Where `[[SYSROOT]]/bin/../include/thumbv7m-none-unknown-eabi/testdir1/include/c++/v1` and `[[SYSROOT]]/bin/../include/thumbv7m-none-unknown-eabi/testdir2/include/c++/v1` should only contain `__config_site`.
</details>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl'
Projects
None yet
Development

No branches or pull requests

2 participants