Fix status code of generated Makefile
we use verilator in a larger build process that is driven by a script. It aborts on any error, but the build of the verilated simulation does not return a non-zero status code on linker errors. The reason is that the output of the linker is piped through c++filt. The status code is then the status code of c++filt which is 0 on a linker error too apparently.
Hence I prepared a simple fix to this by generating a different linker command in the Makefile in the attached patch. I know this is not nice, but in my opinion the nicest solution among the options to solve it (except maybe removing c++filt..). I am open to change it to a different way of handling it.
I also attach a minimal example.
#2 Updated by Stefan Wallentowitz about 1 year ago
I also think that all recent linkers do the demangling themselves pretty well. For the sake of simplicity I also think it can better be removed. If someone has an older linker, they can still take the output and push it through c++-filt I suppose.
Probably the shortest patch for Verilator ever written can be found attached :)
Also available in: Atom