wrcad / xictools

XicTools: Xic graphical editor, WRspice circuit simulator, and accessories. for electronic design.
http://wrcad.com
138 stars 40 forks source link

Fix build errors in fastcap/fasthenry #6

Closed thasti closed 4 years ago

thasti commented 4 years ago

While trying to build xictools in an up-to-date environment (gcc version 10.1.0, x86_64-pc-linux-gnu), the builds of both fastcap and fasthenry fail during linking. ld complains about redefinition of the timestuff struct, which is declared in resusage.h as included in multiple source files. A similar issue appears for fp (a generic file pointer, declared as a global variable in fasthenry and zbuf).

I was able to fix those issues by treating timestuff as a weak symbol and therefore share these occurences of the struct. This fixes the build for me.

Could you perhaps take a look at my fixes and/or propose another solution for this issue? I would be happy to implement them in case the current solution is not considered acceptable/the intended implementation.

wrcad commented 4 years ago

The latest updates to the level branch fixes the problem for me.

thasti commented 4 years ago

Thanks for fixing, can confirm it working!