cosmonim icon indicating copy to clipboard operation
cosmonim copied to clipboard

Linking issue

Open ajusa opened this issue 2 years ago • 1 comments

Here's the error that I'm getting:

/usr/bin/ld.bfd: errno: TLS reference in /usr/lib64/libm-2.34.a(w_pow.o) mismatches non-TLS reference in /home/ajusa/.cache/nim/main_d/stdlib_io.nim.c.o
/usr/bin/ld.bfd: /usr/lib64/libm-2.34.a: error adding symbols: bad value
collect2: error: ld returned 1 exit status

Looks like something to do with libm. Is it trying to link against my libm rather than the cosmopolitan version maybe?

ajusa avatar Dec 22 '21 06:12 ajusa

That is the case - manually running the GCC command that fails (and removing the -lm) fixes my issue. Is it possible for a compiler flag or something else to do that?

ajusa avatar Jul 22 '22 07:07 ajusa

I didn't really investigate that issue before because Cosmopolitan stopped working with Nim for me, but with the version 2.0 of Cosmopolitan it seems to work again, and I can't reproduce your issue (I specifically used code that imports std/math so that it adds -lm). Please reopen if you find a repro again, thanks!

Yardanico avatar Aug 31 '22 13:08 Yardanico