Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined symbol operator delete(void*, std::align_val_t) on MacOS #1231

Closed
veripoolbot opened this issue Oct 14, 2017 · 4 comments
Closed

Undefined symbol operator delete(void*, std::align_val_t) on MacOS #1231

veripoolbot opened this issue Oct 14, 2017 · 4 comments

Comments

@veripoolbot
Copy link

@veripoolbot veripoolbot commented Oct 14, 2017


Author Name: Jeff Bush (@jbush001)
Original Redmine Issue: 1231 from https://www.veripool.org

Original Assignee: Wilson Snyder (@wsnyder)


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.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Oct 14, 2017


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-10-14T13:08:44Z


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?

https://stackoverflow.com/questions/16865260/quickblox-linker-error-operator-deletevoid-referenced-from

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Oct 14, 2017


Original Redmine Comment
Author Name: Jeff Bush (@jbush001)
Original Date: 2017-10-14T15:57:47Z


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: d4bae48, which is where I think it broke for me. One fix might be for me to upgrade my operating system.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Oct 14, 2017


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-10-14T16:59:37Z


Fixed in git to suppress -faligned-new if a new/delete doesn't link properly.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Oct 14, 2017


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-10-14T20:22:49Z


In 3.914.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.