Open filmil opened 1 month ago
Could you add a test case that exercises this logic and fails without it? cgo is complicated enough that I wouldn't want to make a change without a test.
Sorry, this is not a polished fix. This just illustrates what seems to be a glaring omission in how cgo binaries are linked. I am not 100% sure what the correct fix should be. Do y'all have someone who's well versed in the innards of link.bzl who could advise?
Not sure why this wasn't added here.
What type of PR is this?
Bug fix repro. At least I think.
What does this PR do? Why is it needed?
It adds the
.a
libraries when linking a go program with C or C++ FFI archive. I am not seeing why this is not being done when linking the binary.An alternative is to add
linkmode = "c-shared"
, orlinkmode = "c-archive"
, but this is not correct if you want an actual executable, and not a library.Which issues(s) does this PR fix?
Fixes #
Other notes for review