<h3 dir="auto">Steps to reproduce:</h3>
<p dir="auto">Numpy compiled with GCC on same system works fine (no error in Inkscape).<br>
Steps to reproduce:</p>
<ul dir="auto">
<li>additional flags: <code class="notranslate">-O3 -pipe -march=skylake -mtune=skylake -D_FORTIFY_SOURCE=3 -gsplit-dwarf -flto=thin</code></li>
<li>LDFLAGS: <code class="notranslate">-fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed -Wl,--compress-debug-sections=zlib -Wl,-z,relro,-z,now -Wl,--undefined-version -Wl,--plugin-opt=dwo_dir= -Wl,--threads=4</code></li>
<li>Compile numpy-<a href="https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-python/numpy/numpy-1.24.2.ebuild" rel="nofollow">1.24.2</a> with clang-<a href="https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-devel/clang/clang-16.0.2.ebuild" rel="nofollow">16.0.2</a>/<a href="https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-devel/clang/clang-17.0.0_pre20230421.ebuild" rel="nofollow">17.0.0_pre20230421</a> and <code class="notranslate">-stdlib=libc++</code>.</li>
<li>When trying to save an optimized svg with media-gfx/inkscape-<a href="https://gitweb.gentoo.org/repo/gentoo.git/tree/media-gfx/inkscape/inkscape-1.2.2.ebuild" rel="nofollow">1.2.2</a>, I get the following error message:</li>
</ul>
<h3 dir="auto">Error message:</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;/usr/lib/python3.11/site-packages/numpy/core/__init__.py&quot;, line 23, in &lt;module&gt;
    from . import multiarray
  File &quot;/usr/lib/python3.11/site-packages/numpy/core/multiarray.py&quot;, line 10, in &lt;module&gt;
    from . import overrides
  File &quot;/usr/lib/python3.11/site-packages/numpy/core/overrides.py&quot;, line 6, in &lt;module&gt;
    from numpy.core._multiarray_umath import (
ImportError: Error relocating /usr/lib/python3.11/site-packages/numpy/core/_multiarray_umath.cpython-311-x86_64-linux-musl.so: _ZNSt3__122__libcpp_verbose_abortEPKcz: symbol not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/usr/share/inkscape/extensions/output_scour.py&quot;, line 7, in &lt;module&gt;
    import inkex
  File &quot;/usr/share/inkscape/extensions/inkex/__init__.py&quot;, line 11, in &lt;module&gt;
    from .extensions import *
  File &quot;/usr/share/inkscape/extensions/inkex/extensions.py&quot;, line 34, in &lt;module&gt;
    from .elements import (
  File &quot;/usr/share/inkscape/extensions/inkex/elements/__init__.py&quot;, line 13, in &lt;module&gt;
    from ._polygons import PathElement, Polyline, Polygon, Line, Rectangle, Circle, Ellipse
  File &quot;/usr/share/inkscape/extensions/inkex/elements/_polygons.py&quot;, line 31, in &lt;module&gt;
    from ..bezier import pointdistance
  File &quot;/usr/share/inkscape/extensions/inkex/bezier.py&quot;, line 29, in &lt;module&gt;
    import numpy
  File &quot;/usr/lib/python3.11/site-packages/numpy/__init__.py&quot;, line 141, in &lt;module&gt;
    from . import core
  File &quot;/usr/lib/python3.11/site-packages/numpy/core/__init__.py&quot;, line 49, in &lt;module&gt;
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.11 from &quot;/usr/lib/python-exec/python3.11/python3&quot;
  * The NumPy version is: &quot;1.24.2&quot;

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: Error relocating /usr/lib/python3.11/site-packages/numpy/core/_multiarray_umath.cpython-311-x86_64-linux-musl.so: _ZNSt3__122__libcpp_verbose_abortEPKcz: symbol not found"><pre class="notranslate">Traceback (most recent call last):
  File <span class="pl-s"><span class="pl-pds">"</span>/usr/lib/python3.11/site-packages/numpy/core/__init__.py<span class="pl-pds">"</span></span>, line 23, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from <span class="pl-c1">.</span> import multiarray
  File <span class="pl-s"><span class="pl-pds">"</span>/usr/lib/python3.11/site-packages/numpy/core/multiarray.py<span class="pl-pds">"</span></span>, line 10, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from <span class="pl-c1">.</span> import overrides
  File <span class="pl-s"><span class="pl-pds">"</span>/usr/lib/python3.11/site-packages/numpy/core/overrides.py<span class="pl-pds">"</span></span>, line 6, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from numpy.core._multiarray_umath import (
ImportError: Error relocating /usr/lib/python3.11/site-packages/numpy/core/_multiarray_umath.cpython-311-x86_64-linux-musl.so: _ZNSt3__122__libcpp_verbose_abortEPKcz: symbol not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File <span class="pl-s"><span class="pl-pds">"</span>/usr/share/inkscape/extensions/output_scour.py<span class="pl-pds">"</span></span>, line 7, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    import inkex
  File <span class="pl-s"><span class="pl-pds">"</span>/usr/share/inkscape/extensions/inkex/__init__.py<span class="pl-pds">"</span></span>, line 11, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from .extensions import <span class="pl-k">*</span>
  File <span class="pl-s"><span class="pl-pds">"</span>/usr/share/inkscape/extensions/inkex/extensions.py<span class="pl-pds">"</span></span>, line 34, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from .elements import (
  File <span class="pl-s"><span class="pl-pds">"</span>/usr/share/inkscape/extensions/inkex/elements/__init__.py<span class="pl-pds">"</span></span>, line 13, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from ._polygons import PathElement, Polyline, Polygon, Line, Rectangle, Circle, Ellipse
  File <span class="pl-s"><span class="pl-pds">"</span>/usr/share/inkscape/extensions/inkex/elements/_polygons.py<span class="pl-pds">"</span></span>, line 31, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from ..bezier import pointdistance
  File <span class="pl-s"><span class="pl-pds">"</span>/usr/share/inkscape/extensions/inkex/bezier.py<span class="pl-pds">"</span></span>, line 29, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    import numpy
  File <span class="pl-s"><span class="pl-pds">"</span>/usr/lib/python3.11/site-packages/numpy/__init__.py<span class="pl-pds">"</span></span>, line 141, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from <span class="pl-c1">.</span> import core
  File <span class="pl-s"><span class="pl-pds">"</span>/usr/lib/python3.11/site-packages/numpy/core/__init__.py<span class="pl-pds">"</span></span>, line 49, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE<span class="pl-k">!</span>

Importing the numpy C-extensions failed. This error can happen <span class="pl-k">for</span>
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  <span class="pl-k">*</span> The Python version is: Python3.11 from <span class="pl-s"><span class="pl-pds">"</span>/usr/lib/python-exec/python3.11/python3<span class="pl-pds">"</span></span>
  <span class="pl-k">*</span> The NumPy version is: <span class="pl-s"><span class="pl-pds">"</span>1.24.2<span class="pl-pds">"</span></span>

and make sure that they are the versions you expect.
Please carefully study the documentation linked above <span class="pl-k">for</span> further help.

Original error was: Error relocating /usr/lib/python3.11/site-packages/numpy/core/_multiarray_umath.cpython-311-x86_64-linux-musl.so: _ZNSt3__122__libcpp_verbose_abortEPKcz: symbol not found</pre></div>
<h3 dir="auto">Additional information:</h3>
<p dir="auto">OS: <code class="notranslate">Gentoo Linux amd64 musl/clang</code><br>
Numpy version: numpy-<a href="https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-python/numpy/numpy-1.24.2.ebuild" rel="nofollow">1.24.2</a><br>
Python version: python-<a href="https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-lang/python/python-3.11.3.ebuild" rel="nofollow">3.11.3</a><br>
Not sure if it's related to Numpy or a Clang compiler bug.</p>
<h3 dir="auto">Describe the issue:</h3>
<p dir="auto">When build numpy with LLVM 15 clang/clang++ and libcxx, it somehow include a symbol from libcxx in the file <a href="https://github.com/numpy/numpy/blob/main/numpy/core/src/npysort/binsearch.cpp">https://github.com/numpy/numpy/blob/main/numpy/core/src/npysort/binsearch.cpp</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="readelf -s --wide work/numpy-1.24.0-python3_10/temp.linux-x86_64-3.10/numpy/core/src/npysort/binsearch.o
94: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND _ZNSt3__122__libcpp_verbose_abortEPKcz"><pre class="notranslate"><code class="notranslate">readelf -s --wide work/numpy-1.24.0-python3_10/temp.linux-x86_64-3.10/numpy/core/src/npysort/binsearch.o
94: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND _ZNSt3__122__libcpp_verbose_abortEPKcz
</code></pre></div>
<p dir="auto">The symbol <code class="notranslate">_ZNSt3__122__libcpp_verbose_abortEPKcz</code> is used for abort a program with a special verbose information.<br>
<a href="https://libcxx.llvm.org/UsingLibcxx.html#id7" rel="nofollow">https://libcxx.llvm.org/UsingLibcxx.html#id7</a><br>
<a href="https://reviews.llvm.org/D130562" rel="nofollow">https://reviews.llvm.org/D130562</a></p>
<p dir="auto">I don't know why this symbol was added, the code of that cpp don't seem to be relevant.</p>
<p dir="auto">The numpy can be loaded if using <code class="notranslate">LD_PRELOAD=/usr/lib/libc++.so.1 python</code></p>
<h3 dir="auto">Reproduce the code example:</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span></pre></div>
<h3 dir="auto">Error message:</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;/usr/lib/python3.10/site-packages/numpy/core/__init__.py&quot;, line 23, in &lt;module&gt;
    from . import multiarray
  File &quot;/usr/lib/python3.10/site-packages/numpy/core/multiarray.py&quot;, line 10, in &lt;module&gt;
    from . import overrides
  File &quot;/usr/lib/python3.10/site-packages/numpy/core/overrides.py&quot;, line 6, in &lt;module&gt;
    from numpy.core._multiarray_umath import (
ImportError: Error relocating /usr/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-x86_64-linux-gnu.so: _ZNSt3__122__libcpp_verbose_abortEPKcz: symbol not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;/usr/lib/python3.10/site-packages/numpy/__init__.py&quot;, line 141, in &lt;module&gt;
    from . import core
  File &quot;/usr/lib/python3.10/site-packages/numpy/core/__init__.py&quot;, line 49, in &lt;module&gt;
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.10 from &quot;/usr/lib/python-exec/python3.10/python&quot;
  * The NumPy version is: &quot;1.24.0&quot;

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: Error relocating /usr/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-x86_64-linux-gnu.so: _ZNSt3__122__libcpp_verbose_abortEPKcz: symbol not found"><pre class="notranslate">Traceback (most recent call last):
  File <span class="pl-s"><span class="pl-pds">"</span>/usr/lib/python3.10/site-packages/numpy/core/__init__.py<span class="pl-pds">"</span></span>, line 23, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from <span class="pl-c1">.</span> import multiarray
  File <span class="pl-s"><span class="pl-pds">"</span>/usr/lib/python3.10/site-packages/numpy/core/multiarray.py<span class="pl-pds">"</span></span>, line 10, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from <span class="pl-c1">.</span> import overrides
  File <span class="pl-s"><span class="pl-pds">"</span>/usr/lib/python3.10/site-packages/numpy/core/overrides.py<span class="pl-pds">"</span></span>, line 6, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from numpy.core._multiarray_umath import (
ImportError: Error relocating /usr/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-x86_64-linux-gnu.so: _ZNSt3__122__libcpp_verbose_abortEPKcz: symbol not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File <span class="pl-s"><span class="pl-pds">"</span>&lt;stdin&gt;<span class="pl-pds">"</span></span>, line 1, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
  File <span class="pl-s"><span class="pl-pds">"</span>/usr/lib/python3.10/site-packages/numpy/__init__.py<span class="pl-pds">"</span></span>, line 141, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from <span class="pl-c1">.</span> import core
  File <span class="pl-s"><span class="pl-pds">"</span>/usr/lib/python3.10/site-packages/numpy/core/__init__.py<span class="pl-pds">"</span></span>, line 49, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE<span class="pl-k">!</span>

Importing the numpy C-extensions failed. This error can happen <span class="pl-k">for</span>
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  <span class="pl-k">*</span> The Python version is: Python3.10 from <span class="pl-s"><span class="pl-pds">"</span>/usr/lib/python-exec/python3.10/python<span class="pl-pds">"</span></span>
  <span class="pl-k">*</span> The NumPy version is: <span class="pl-s"><span class="pl-pds">"</span>1.24.0<span class="pl-pds">"</span></span>

and make sure that they are the versions you expect.
Please carefully study the documentation linked above <span class="pl-k">for</span> further help.

Original error was: Error relocating /usr/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-x86_64-linux-gnu.so: _ZNSt3__122__libcpp_verbose_abortEPKcz: symbol not found</pre></div>
<h3 dir="auto">Runtime information:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="1.24.0
3.10.9 (main, Jan 28 2023, 16:07:29) [Clang 15.0.7 ]"><pre class="notranslate"><code class="notranslate">1.24.0
3.10.9 (main, Jan 28 2023, 16:07:29) [Clang 15.0.7 ]
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="WARNING: `threadpoolctl` not found in system! Install it by `pip install threadpoolctl`. Once installed, try `np.show_runtime` again for more detailed build information
[{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
                      'found': ['SSSE3',
                                'SSE41',
                                'POPCNT',
                                'SSE42',
                                'AVX',
                                'F16C',
                                'FMA3',
                                'AVX2'],
                      'not_found': ['AVX512F',
                                    'AVX512CD',
                                    'AVX512_KNL',
                                    'AVX512_SKX',
                                    'AVX512_CLX',
                                    'AVX512_CNL',
                                    'AVX512_ICL']}}]
None"><pre class="notranslate"><code class="notranslate">WARNING: `threadpoolctl` not found in system! Install it by `pip install threadpoolctl`. Once installed, try `np.show_runtime` again for more detailed build information
[{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
                      'found': ['SSSE3',
                                'SSE41',
                                'POPCNT',
                                'SSE42',
                                'AVX',
                                'F16C',
                                'FMA3',
                                'AVX2'],
                      'not_found': ['AVX512F',
                                    'AVX512CD',
                                    'AVX512_KNL',
                                    'AVX512_SKX',
                                    'AVX512_CLX',
                                    'AVX512_CNL',
                                    'AVX512_ICL']}}]
None
</code></pre></div>
<h3 dir="auto">Context for the issue:</h3>
<p dir="auto"><em>No response</em></p>