<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/65135>65135</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            libc++-dev cross-compilation packages have conflicting files
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          glebm
      </td>
    </tr>
</table>

<pre>
    I am on amd64 Ubuntu Lunar, using the apt packages from https://apt.llvm.org/:

First, installing `libc++-18-dev:arm64` for cross compilation works:

```bash
sudo apt install libc++-18-dev:arm64
```

Then, let's install the native libc++18-dev for host compilation:

```bash
sudo apt install libc++-18-dev:amd64
```

This fails with:

```
dpkg: error processing archive /var/cache/apt/archives/libc++-18-dev_1%3a18~++20230831053821+b86d3cbc1288-1~exp1~20230831053939.292_amd64.deb (--unpack):
 trying to overwrite shared '/usr/lib/llvm-18/lib/libc++.a'
```

This is reproducible with various versions of clang and host OS.

It appears that all variants of `libc++-<version>-dev` install an architecture-specific library at a non-architecture-specific path.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVE2PpDYQ_TXmUgIZm6bhwGFmNy2tFCmHJOdVYarBGWMj2zCZy_z2yDDb25NkkstKyJI_eH5V7_lhCHq0RB07PbLT5wzXODnfjYb6Oevd8NJ9AZzBWcB5qCv4vV9tXOHn1aJn4hOsQdsR4kSAS4QF1ROOFODq3QxTjEtg8oGJCxMXXGJhzDYXzo9pRT4w_pnxt_GifYgJUNsQ0ZiEympudK-YeGTiMS-bfKCNyQf0c12xmsPVeVDehQDKzYs2GLWz8Oz8U_gbOqv58fUYpmMprIPbOb9dCB9f9R7iHve3iWwibSgycQ43rNQPi1FvdAd7oO6sJxfiPekfRTdJ9J90dYArahPgWcfpo1uP6bA8jUw-AHnvPCzeKQq72OjVlCpj4rIlE1wUqokOhdN4bAcmLv_g-LVk4iSxbF6PZcGF5I0s-Uk2omTisW_qQapelaJp8vKV_lzK17tDrWwL0Yqve6HFQD0w0eT5apPxmGhvFUH0L7sxHbiN_LPXkSBM6GkAJs5MXNbgD4ZpNNucl833-Y13gen0_3RUB_C0eDesSveG9t7Chl67NcBGPmhnA7grKIOpf3Y4DPDLr8U91pcIuCyEPkCcMEJSOaGgjfvf758Dk5_eoJn8ade_5jdzoD1UiqTi6ikPCyl91Sq5xqN_gQQP1tn8348tGKciGzo5tLLFjLqybmV1rquSZ1N3wloSx0aem7asm0qppkbRC07iXFVDlenum2Yl5_WJF22NPW9UdR5qeVWyZBWnGbW5BUKmQ1ipq0-lPGUGezJhTyQhLD3DvsmESAHlu12tfh0Dq7jRIYbvKFFHQ91dl9KD2yMiv4-IW0xNuBEoZ69Gq5j8ctWGQrZ6070Pr1HHae0L5eY3u3xzzeLdH6SS73eSyfV7EX8FAAD__xylo5s">