Patch to support MinGW compilation
|Assignee:||Wilson Snyder||% Done:||
Thought it shouldn't be difficult to port verilator to MinGW(no cygwin1.dll dependencies). Just a few lines of preprocessor directives. Makefile_obj was cribbing about __errno linker reference error(Probably because _errno is what is defined in mingw). Thought of correcting this in MinGW, but then libm is not referenced at all in verilator. So just removed -lm and it still worked. Guess libm is not being referenced at all.
Files change: V3Files.cpp V3Options.cpp Makefile_obj
Patch attached: verilator-3.720-mingw-enable.patch
Please review and if you find it ok, you can include it in your next release.
Updated by Wilson Snyder over 3 years ago
- Status changed from New to Resolved
Thanks! Pushed to git for 3.721++.
Updated by Amir Gonnen over 3 years ago
Presumably I did similar changes in order to build Verilator with MinGw. Looking at this patch, on V3Options::setenvStr you use "new" without deleting afterwards. I suggest instead: putenv( ((string)envvar + "=" + value).c_str() );
Updated by Shankar Giri over 3 years ago
Thanks for the correction. It is better this way.
I figured since this was being called only once, there is no progressive or cumulative memory leak, but I completely concede this way is better.
Also available in: Atom