Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go plugin not compiling #391

Closed
JensAc opened this issue Jan 5, 2023 · 3 comments · Fixed by #407
Closed

go plugin not compiling #391

JensAc opened this issue Jan 5, 2023 · 3 comments · Fixed by #407
Assignees
Labels
bug Something isn't working

Comments

@JensAc
Copy link

JensAc commented Jan 5, 2023

Hi,
when I try to build a plugin containing circl like so

go build -buildmode=plugin

I get:

asm: fp_amd64.s:68: when dynamic linking, R15 is clobbered by a global variable access and is used here: 00215 (....l/vendor/github.com/cloudflare/circl/math/fp25519/fp_amd64.s:68)  MULXQ   24(SI), AX, R15
asm: assembly failed

I am sorry, but I have no idea on debugging this. I found similar issues which let me assume that some upstream change could be required. If you find time to look into this, I would really appreciate your help.

@JensAc
Copy link
Author

JensAc commented Jan 6, 2023

So, now I did some research on this. This issue is that the R15 register cannot be used in assembly, when compiling in plugin mode. Therefore, replacing the R15 register by the DI register could do the trick, as also done here. Would that be an option for this codebase as well? If yes, I could file a PR.

@bwesterb
Copy link
Member

bwesterb commented Jan 11, 2023

Sorry for the late reply. I think your analysis is correct and I think we would take that PR. @armfazh you agree?

(If so, we should add plugin compilation to the CI.)

@bwesterb bwesterb self-assigned this Jan 11, 2023
@bwesterb bwesterb assigned armfazh and unassigned bwesterb Jan 29, 2023
@armfazh
Copy link
Contributor

armfazh commented Feb 13, 2023

Update, I have checked spots in which compilation does not succeed due to R15 register.
I am working on patching the code, and pretty close to have CIRCL compiling as a plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants