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

"illegal combination" error when used in gomobile bind #681

Closed
ICU2020 opened this issue Oct 5, 2022 · 6 comments
Closed

"illegal combination" error when used in gomobile bind #681

ICU2020 opened this issue Oct 5, 2022 · 6 comments

Comments

@ICU2020
Copy link

ICU2020 commented Oct 5, 2022

I build my android lib with:

gomobile bind -target=android/arm64 -tags='headless' -o=$(my_android_lib) -ldflags="-w -X -s" $(my_dir)

and found the error below:

//# github.com/klauspost/compress/zstd/internal/xxhash
asm: illegal combination: 00072 () PCALIGN $16 ABCON0 NONE NONE NONE, 4 0
asm: illegal combination: 00072 () PCALIGN $16 ABCON0 NONE NONE NONE, 4 0
asm: illegal combination: 00072 () PCALIGN $16 ABCON0 NONE NONE NONE, 4 0
asm: illegal combination: 00072 () PCALIGN $16 ABCON0 NONE NONE NONE, 4 0
asm: illegal combination: 00032 () PCALIGN $16 ABCON0 NONE NONE NONE, 4 0
asm: illegal combination: 00032 () PCALIGN $16 ABCON0 NONE NONE NONE, 4 0
asm: illegal combination: 00032 () PCALIGN $16 ABCON0 NONE NONE NONE, 4 0
asm: illegal combination: 00032 () PCALIGN $16 ABCON0 NONE NONE NONE, 4 0
asm: assembly failed

make: *** [my_android_lib.aar] Error 1

Update:

But when I use :
gomobile bind -target=android/arm -tags='headless' -o=$(my_android_lib) -ldflags="-w -X -s" $(my_dir)

the error disappear.

Used commit: 7484543

@klauspost
Copy link
Owner

@lizthegrey Can you take a look at this? Seems like a regression from #464

@lizthegrey
Copy link
Contributor

I think this is a bug in gomobile rather than a problem with the assembly. PCALIGN is a supported operation in Golang. https://github.com/golang/go/blob/master/src/cmd/internal/obj/arm64/doc.go#L54:L94

@ICU2020
Copy link
Author

ICU2020 commented Oct 6, 2022

I think this is a bug in gomobile rather than a problem with the assembly. PCALIGN is a supported operation in Golang. https://github.com/golang/go/blob/master/src/cmd/internal/obj/arm64/doc.go#L54:L94

Is there some ways to walk around?

@lizthegrey
Copy link
Contributor

I think this is a bug in gomobile rather than a problem with the assembly. PCALIGN is a supported operation in Golang. golang/go@master/src/cmd/internal/obj/arm64/doc.go#L54:L94

Is there some ways to walk around?

I don't believe it's essential to PCALIGN for correctness, only performance. You could try building from a branch with those directives removed, or manually add NOPs to make the alignment work out.

Meanwhile I'd recommend filing a bug upstream on the gomobile component.

@ICU2020
Copy link
Author

ICU2020 commented Oct 6, 2022

I think this is a bug in gomobile rather than a problem with the assembly. PCALIGN is a supported operation in Golang. golang/go@master/src/cmd/internal/obj/arm64/doc.go#L54:L94

Is there some ways to walk around?

I don't believe it's essential to PCALIGN for correctness, only performance. You could try building from a branch with those directives removed, or manually add NOPs to make the alignment work out.

Meanwhile I'd recommend filing a bug upstream on the gomobile component.

Thanks a lot for your response. Could you give some advice which branch I should choose to avoid PCALIGN? Thanks.

@klauspost
Copy link
Owner

@ICU2020 You can build with -tags=noasm,headless as a temporary workaround. Feel free to link this issue if you post a bug report for gomobile.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants