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
Verilator is unfriendly to cross compiling verilated output. Simple fix. #1221
Comments
Original Redmine Comment Those are setup by configure (for the most part), so your patch would only work in very limited cases. For now, why wouldn't you just override those variables when you call make? To fix this, the patch should use the proper configure host and target settings to specify a cross compiler. That setups two settings, one for the host (Verilator) compiler, and one for the target (Verilated) compiler etc. Then configure needs to run on each compiler separately to determine the appropriate flags, as assuming both are the same (flags/version) isn't correct for cross compilation. Alsosome make variables that are now common need host/target splits. It certainly would be appreciated if you'd like to make a patch to do this. |
Original Redmine Comment I'm thinking you're thinking about ./configure for building Verilator itself, however, I'm talking about the verilated outcome from a design. What I'm used to is doing a cross compile with the variable CROSS_COMPILE set, but in other cases it's not set... so if CROSS_COMPILE is not set, CXX becomes g++ which is the intended outcome for a non-cross build. In my case, there is a chance that CROSS_COMPILE is set to x86_64-w64-mingw32- which would make CXX become x86_64-w64-mingw32-g++ which would work for building Windows software on a Linux machine. In no case do I want to fix Verilator to generating code for a specific platform. |
Original Redmine Comment Configure sets up both the compile options for the host, and for the target and assumes at present both are the same. You'll see the problem if you set your cross compiler to something really different (e.g. non GCC) as it will get passed the host's flags incorrectly (as again Verilator thinks host and target are the same). |
Original Redmine Comment Seems like this got stalled so closing due to age, if you end up with a general patch for cross compiling please reopen. |
Author Name: Rob Stoddard
Original Redmine Issue: 1221 from https://www.veripool.org
In verilated.mk the following change should be made...
From:
To:
The text was updated successfully, but these errors were encountered: