Issue 123224
Summary [libc++] regression: new/delete symbol overrides broken on macOS
Labels libc++
Assignees
Reporter tycho
    This is referring to commit https://github.com/llvm/llvm-project/commit/841895543edcf98bd16027c6b85fe7c6419a4566.

In a shared library which statically links libc++ (ANGLE's libEGL in this case), the symbols for `new` and `new[]` are, as of the above commit, suddenly exposed as global, but the corresponding `delete` and `delete[]` operators are not.

Before the above commit:
```
$ nm -g -C --defined-only contrib/angle/angle/out/macOS-Debug-arm64/libEGL.dylib | grep -e new -e delete
```

After:
```
$ nm -g -C --defined-only contrib/angle/angle/out/macOS-Debug-arm64/libEGL.dylib | grep -e new -e delete
00000000001e9460 T operator new[](unsigned long)
00000000001e9740 T operator new[](unsigned long, std::align_val_t)
00000000001e9328 T operator new(unsigned long)
00000000001e95e0 T operator new(unsigned long, std::align_val_t)
```

This causes applications like mine with custom allocators (mimalloc in this case) to provide the implementations for the operator `new` symbols, but not the `delete` symbols, which inevitably causes a crash within the shared library when it tries to free memory.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to