#64055 closed defect (fixed)
legacysupport @1.0.4: Add support for missing "operator delete ( void* ptr, std::size_t sz )" in macos < 10.12
Reported by: | tenzap | Owned by: | tenzap |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | mascguy (Christopher Nielsen), cjones051073 (Chris Jones), kencu (Ken) | |
Port: | legacysupport |
Description (last modified by tenzap)
Originally, when building KeePassXC on macOS 10.11 with a compiler that supports the -fsized-deallocation (like clang++-mp-9.0, or a recent AppleClang, probably >= 8) there is this error:
error: call to unavailable function 'operator delete': introduced in macOS 10.12
Test case file to compile with -fsized-deallocation
flag:
#include <new> int main() { void * ptr = nullptr; std::size_t size = 1; ::operator delete(ptr, size); }
Maybe this is part of the things that could be addressed by legacysupport?
There may be other related functions missing since delete is 'overloaded' https://en.cppreference.com/w/cpp/memory/new/operator_delete https://en.cppreference.com/w/cpp/header/new
For now this is worked around in KeePassXC with a patch that disables use of -fsized-deallocation on macos < 10.12.
Change History (13)
comment:1 Changed 3 years ago by tenzap
Description: | modified (diff) |
---|
comment:3 Changed 3 years ago by tenzap
Description: | modified (diff) |
---|
comment:4 Changed 3 years ago by tenzap
Description: | modified (diff) |
---|
comment:5 Changed 3 years ago by mascguy (Christopher Nielsen)
Cc: | mascguy added |
---|
comment:6 Changed 3 years ago by mascguy (Christopher Nielsen)
Cc: | cjones051073 kencu added |
---|
comment:7 Changed 3 years ago by kencu (Ken)
I don't see that the OP proposes something new to add to legacysupport here in this ticket.
Disabling the newer functionality is one fix, if possible.
Using macports-libcxx
is another fix, that can work in some cases, but should be actually tested due to possible ABI collisions.
comment:8 Changed 3 years ago by cjones051073 (Chris Jones)
I think this goes somehwat beyond the sort of thing legacy-support should be implementing.
comment:9 Changed 3 years ago by kencu (Ken)
Resolution: | → fixed |
---|---|
Status: | new → closed |
yes, as I already did implement it in macports-libcxx, and there is nothing else to be done.
For the OP:
what you are asking for already exists! Add the legacysupport PG and enable macports-libcxx using that PG's options (see the PG code for the exact bit to add).
comment:10 Changed 3 years ago by mascguy (Christopher Nielsen)
@tenzap For the addition of the legacysupport
PG, you may want to include that first, before any other portgroup. (Chris/Ken, let us know if that's good advice, and/or if there are cases where one or more other PGs should be included first.)
As for the use of macports-libcxx
, I've started using the following convention. The comment itself is important, as it explains to others why it's necessary. You can feel free to supplement and/or modify the comment though, with the specifics surrounding the delete operator.
# Enable use of 'macports-libcxx' for macOS 10.12 and earlier, as port uses # libcxx features normally only available on 10.13 and later. legacysupport.use_mp_libcxx \ yes
And feel free to let us know how it goes, as well as if you encounter any issues!
comment:11 Changed 3 years ago by mascguy (Christopher Nielsen)
p.s. Note that you'll specifically need to use legacysupport
1.1, as 1.0 doesn't include the macports-libcxx
functionality.
comment:13 Changed 3 years ago by tenzap
Owner: | set to tenzap |
---|
Ken/Chris, would it make sense to add this to legacysupport? Or is the better choice to have ports utilize
macports-libcxx
?