Issue 1:
Steps to reproduce:

Numpy compiled with GCC on same system works fine (no error in Inkscape).

Steps to reproduce:

additional flags: -O3 -pipe -march=skylake -mtune=skylake -D_FORTIFY_SOURCE=3 -gsplit-dwarf -flto=thin

LDFLAGS: -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

Compile numpy-1.24.2 with clang-16.0.2/17.0.0_pre20230421 and -stdlib=libc++.

When trying to save an optimized svg with media-gfx/inkscape-1.2.2, I get the following error message:

Error message:

Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/numpy/core/__init__.py", line 23, in <module>
from . import multiarray
File "/usr/lib/python3.11/site-packages/numpy/core/multiarray.py", line 10, in <module>
from . import overrides
File "/usr/lib/python3.11/site-packages/numpy/core/overrides.py", line 6, in <module>
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 "/usr/share/inkscape/extensions/output_scour.py", line 7, in <module>
import inkex
File "/usr/share/inkscape/extensions/inkex/__init__.py", line 11, in <module>
from .extensions import *
File "/usr/share/inkscape/extensions/inkex/extensions.py", line 34, in <module>
from .elements import (
File "/usr/share/inkscape/extensions/inkex/elements/__init__.py", line 13, in <module>
from ._polygons import PathElement, Polyline, Polygon, Line, Rectangle, Circle, Ellipse
File "/usr/share/inkscape/extensions/inkex/elements/_polygons.py", line 31, in <module>
from ..bezier import pointdistance
File "/usr/share/inkscape/extensions/inkex/bezier.py", line 29, in <module>
import numpy
File "/usr/lib/python3.11/site-packages/numpy/__init__.py", line 141, in <module>
from . import core
File "/usr/lib/python3.11/site-packages/numpy/core/__init__.py", line 49, in <module>
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 "/usr/lib/python-exec/python3.11/python3"
* The NumPy version is: "1.24.2"

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

Additional information:

OS: Gentoo Linux amd64 musl/clang

Numpy version: numpy-1.24.2

Python version: python-3.11.3

Not sure if it's related to Numpy or a Clang compiler bug.

Issue 2:
Describe the issue:

When build numpy with LLVM 15 clang/clang++ and libcxx, it somehow include a symbol from libcxx in the file https://github.com/numpy/numpy/blob/main/numpy/core/src/npysort/binsearch.cpp

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

The symbol _ZNSt3__122__libcpp_verbose_abortEPKcz is used for abort a program with a special verbose information.

https://libcxx.llvm.org/UsingLibcxx.html#id7

https://reviews.llvm.org/D130562

I don't know why this symbol was added, the code of that cpp don't seem to be relevant.

The numpy can be loaded if using LD_PRELOAD=/usr/lib/libc++.so.1 python

Reproduce the code example:

import numpy

Error message:

Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/numpy/core/__init__.py", line 23, in <module>
from . import multiarray
File "/usr/lib/python3.10/site-packages/numpy/core/multiarray.py", line 10, in <module>
from . import overrides
File "/usr/lib/python3.10/site-packages/numpy/core/overrides.py", line 6, in <module>
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 "<stdin>", line 1, in <module>
File "/usr/lib/python3.10/site-packages/numpy/__init__.py", line 141, in <module>
from . import core
File "/usr/lib/python3.10/site-packages/numpy/core/__init__.py", line 49, in <module>
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 "/usr/lib/python-exec/python3.10/python"
* The NumPy version is: "1.24.0"

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

Runtime information:

1.24.0
3.10.9 (main, Jan 28 2023, 16:07:29) [Clang 15.0.7 ]

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

Context for the issue:

No response