Twitter | Search | |
fasterthanlime, now looking for a job
Today in "Amos has bad luck with Go": 1. I had `-fuse-ld=lld` in my `~/.cargo/config` to speed up linking of my site 2. This *hella broke* cgo 3. Google brings up "try -Bsymbolic", didn't fix it 4. There's no flag to *undo* `-fuse-ld=lld` 5. rm ~/.cargo/config fixed it
Reply Retweet Like More
fasterthanlime, now looking for a job Jul 6
Replying to @fasterthanlime
Syntax/type error: nice message, red squiggles Logic error: tests fail, get nice colorized diff in CI output Linker error: *nothing* works, crashes in a different function every time you change the flags, 3 google results, two of them are 404 the other "we solved it, closing"
Reply Retweet Like
fasterthanlime, now looking for a job Jul 6
Replying to @fasterthanlime
Note: I use Rust and Go together in that project, rustc is in charge of linking the final thing together, that's why this happened in the first place. Not specifically a Go bug, alternative linkers break with a lot of stuff and my setup is arcane.
Reply Retweet Like
fasterthanlime, now looking for a job Jul 6
Replying to @fasterthanlime
weeeeeeeeeee linkers!
Reply Retweet Like
Elichai Turkel Jul 6
Replying to @fasterthanlime
Ha! I also use it in my config, but until now only used cgo on C code, not rust. Does cgo uses rustc to orchestrate the linking? Or is the problem because the lib was linked with lld and the final binary with ld?
Reply Retweet Like
fasterthanlime, now looking for a job Jul 6
Replying to @Elichai2
Oh no no, cgo really wants the gcc linker. I'm gluing Go, Rust and Node.JS together. Technically I have a rust crate that compiles to a dynlib, and that crates links against some Go code compiled as a static lib. It's all very glue-y, I need to do a write-up on it!
Reply Retweet Like
Sungbin Jo (조성빈) Jul 6
Replying to @fasterthanlime
Hmm, an cargo config broke cgo...? I’ve never used Go myself but that seems a serious bug lying there... 🤔
Reply Retweet Like
fasterthanlime, now looking for a job Jul 6
Replying to @kb091412
Well, I'm using Rust and Go together (built as a shared library). Rust links the final thing - so it's not just cgo being broken by random files lying around :) But yeah using alternative linkers breaks stuff all the time.
Reply Retweet Like