Undefined symbol operator delete(void*, std::align_val_t) on MacOS
Using command line tools 9.0 on macOS Sierra 10.12, when I try to compile the latest release build 912, I get a link error:
Undefined symbols for architecture x86_64: "operator delete(void*, std::align_val_t)", referenced from: V3Global::makeNetlist() in Verilator.o V3Global::readFiles() in Verilator.o _main in Verilator.o AstNetlist::AstNetlist() in Verilator.o AstNetlist::~AstNetlist() in Verilator.o std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_ostringstream() in Verilator.o std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_stringbuf() in Verilator.o ...
This compiled correctly with version 906. I'll try to isolate further.
#1 Updated by Wilson Snyder almost 2 years ago
- Status changed from New to AskedReporter
I'd think if it gets through the compiler it should link, but maybe there's some strange linker flag needed. This does suggests it's a linker flag issue, but I doubt it's simply the solution they suggest. Can you experiment please?
#2 Updated by Jeff Bush almost 2 years ago
Thanks for the pointer. Adding -lc++ didn't fix the problem, but removing the -faligned-new compile flag did. My theory is that, at some point, Apple updated the compiler to a version that supports the aligned versions of new/delete, but didn't implement it in libstdc++ yet (this may also be because I'm still on Sierra). It appears the -faligned-new flag was added to verilator in this change: d4bae48ca25eef14647b1d9146651d403ce67477, which is where I think it broke for me. One fix might be for me to upgrade my operating system.
Also available in: Atom