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

    <tr>
        <th>Summary</th>
        <td>
            libcxx GCC+musl Build Failure Re: xlocale.h __LIBCXX_HIDE_FROM_ABI Usage
        </td>
    </tr>

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

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

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

<pre>
    Hello, I'm posting to report either a bug or environmental issue on my part with the generated xlocale.h file in the c++/v1/__support/musl folder when building with the following configuration:

```
cmake -DCMAKE_C_COMPILER=aarch64-unknown-linux-musl-gcc -DCMAKE_CXX_COMPILER=aarch64-unknown-linux-musl-g++ -DCMAKE_CXX_FLAGS="-nostdlib" -DLIBCXX_INCLUDE_BENCHMARKS=OFF -DLIBCXX_HAS_MUSL_LIBC=ON -Wno-dev ..
```

The build environment is binutils-2.39, gcc-12.2.0, and musl-1.2.3 up on top of a predictable Debian x86_64 system.

This header file contains the attribute __LIBCXX_HIDE_FROM_ABI which maps to abi_tag in GCC: https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Attributes.html.  This is a C++ attribute in this case, but the extern declarations in question are marked as extern "C" so this is failing to compile.  In my case, simply removing this attribute allows me to proceed.

This appears to have been added here: https://reviews.llvm.org/D124227. The summary there does mention some trepidation with, among other C libraries, musl.

What I haven't investigated myself is if __LIBCXX_HIDE_FROM_ABI would resolve to a different attribute in a different configuration scenario.  In any case, if I do find that this is solved by a predictable configuration adjustment I'll respond with the details.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVcFu2zgQ_Rr5MpAgU7bjHHyw5ag1mrSLdIv2JlDkSJqGIrUkZcd_vyCd1E27BRYQaNAckm_eezPkzlGnETfJcpcs9zM--d7YTUdqMBaH5SqfNUaeN-9RKZOwEg4JuxlgNM6T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