Created attachment 522474 [details, diff]
With sci-electronics/freehdl-0.0.8 the freehdl-v2cc command returns Segmentation fault even for the simplest VHDL demo (https://ghdl.readthedocs.io/en/latest/using/QuickStartGuide.html). It also does for any schematic I tried in Qucs.
I did some backtrace and suggest a patch which seems to fix this issue.
As the source file 'v2cc/v2cc-chunk.t' states,
;; respect to the entity). Note that the value is set to NULL if
;; the object/declaration/expression is not static at all!
(IIR_DeclarativeRegion static_declarative_region (= "NULL"))
so my patch provides a simple check of the NULL pointer. I am not sure my solution is correct, but at least, it allows me to use freehdl-v2cc.
Created attachment 522476 [details, diff]
sci-electronics/freehdl-0.0.8 installs the .la files.
This patch is to remove the references to these files, and substitute them by the correct values.
The fix is taken from these posts:
Created attachment 522478 [details]
This ebuild incorporates the two patches suggested above, and also fixes these problems:
1. undefined reference to L4ieee_Q14std_logic_1164_Y0y0_i51 and several other symbols in libieee.so
This issue is fixed by removing all the .cc files in 'ieee' subdirectory prior to build. These .cc files are generated during the build process, but they are shipped in the package archive for some reason. Probably, it was the developer's mistake. So I simply delete them, and everything builds correctly.
2. Since the .la files are deleted, in order for the later use of the libieee.so library, the '/etc/ld.so.conf.d/freehdl.conf' file is created. This was also grabbed from here: https://bugzilla.redhat.com/show_bug.cgi?id=1207310#c3
Created attachment 634540 [details]
An updated ebuild incorporating all the newly added patches. I am not sure about setting the CXXFLAGS variable inside the ebuild, but I had to add this flag in order to build FreeHDL on relatively modern system.
Created attachment 634542 [details, diff]
An updated patch for modern GCC versions in place of the previously used "fix-c++14.patch".
Created attachment 634544 [details, diff]
This new patch finally fixes a long-lasting problem with segfault because of the NULL pointer.
Created attachment 634546 [details, diff]
Just fixed the file name (here and in new ebuild too).
Created attachment 634548 [details, diff]
I have no idea what this patch actually fixes, but I found in in Ubuntu package. So I suggest it for the developers' review.