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

cmd/asm: type:xx error in go1.20 #58244

Closed
timandy opened this issue Feb 2, 2023 · 12 comments
Closed

cmd/asm: type:xx error in go1.20 #58244

timandy opened this issue Feb 2, 2023 · 12 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@timandy
Copy link

timandy commented Feb 2, 2023

What version of Go are you using (go version)?

$ go version
1.20

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What did you do?

MOVQ $type·int32(SB), AX
asm build error, but it works fine in go1.19

relocation target type.int32 not defined

@timandy timandy changed the title affected/package: compile asm type.xx error in go1.20 affected/package: compile asm type.xx error in go1.20 Feb 2, 2023
@tmthrgd
Copy link
Contributor

tmthrgd commented Feb 2, 2023

It’s in the release notes: https://go.dev/doc/go1.20#linker.

@timandy
Copy link
Author

timandy commented Feb 2, 2023

MOVQ    $type:int32(SB), AX

build error also
illegal or missing addressing mode for symbol type

@mknyszek mknyszek changed the title affected/package: compile asm type.xx error in go1.20 cmd/asm: type.xx error in go1.20 Feb 2, 2023
@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 2, 2023
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Feb 2, 2023
@mknyszek mknyszek added this to the Backlog milestone Feb 2, 2023
@mknyszek
Copy link
Contributor

mknyszek commented Feb 2, 2023

CC @golang/compiler

@cherrymui
Copy link
Member

I don't think we support reference type symbols in assembly code. And the name of type symbols is not guaranteed to be stable, and it can change at any time (as you noticed.) So this would not be expected to work. Thanks.

@cherrymui cherrymui closed this as not planned Won't fix, can't repro, duplicate, stale Feb 2, 2023
@timandy
Copy link
Author

timandy commented Feb 2, 2023

@cherrymui This answer is unacceptable, it worked fine until 1.20. I think this may be caused by the linker change, but the compiler has not been modified.

@timandy
Copy link
Author

timandy commented Feb 2, 2023

@cuonglm PTAL

@cuonglm
Copy link
Member

cuonglm commented Feb 2, 2023

@timandy I'm not sure what else to do here.

@ianlancetaylor
Copy link
Contributor

@timandy I'm sorry this change broke your code, but internal symbol names are always subject to change. We do not provide any guarantee for stability of assembler code. We do our best, of course, but we make no promises. These symbol names were changed for good reasons.

@timandy
Copy link
Author

timandy commented Feb 2, 2023

@ianlancetaylor I'm not opposed to internal symbol modification, and golang is developing very well.
I modified my code to accommodate the 1.20 changes, but the compiler reported other errors. This change appears to be contradictory.

The symbol name generated by the compiler changed, but the compiler did not recognize the new symbol when checking

image

@timandy
Copy link
Author

timandy commented Feb 3, 2023

@timandy I'm not sure what else to do here.

@cuonglm Does the commit change the symbol, but the cimpiler does not recognize the new symbol.

link: 0f8dffd

@cuonglm
Copy link
Member

cuonglm commented Feb 3, 2023

@timandy I'm not sure what else to do here.

@cuonglm Does the commit change the symbol, but the compilation does not recognize the new symbol

link: 0f8dffd

See Cherry's explanation above. This is not supported feature, and also not guaranteed to be stable. The asm is also outside of Go1 promise.

@timandy
Copy link
Author

timandy commented Feb 3, 2023

#37762

@timandy timandy changed the title cmd/asm: type.xx error in go1.20 cmd/asm: type:xx error in go1.20 Feb 3, 2023
@golang golang locked and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

7 participants