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

runtime: code generation confusion #34841

Closed
acln0 opened this issue Oct 11, 2019 · 3 comments
Closed

runtime: code generation confusion #34841

acln0 opened this issue Oct 11, 2019 · 3 comments

Comments

@acln0
Copy link
Contributor

acln0 commented Oct 11, 2019

I am hacking on the runtime. In the process, I wanted to add a constant such that it ends up in the (apparently machine-generated) defs_linux_$GOARCH.go files. I'm confused about whether or not I should be editing these files by hand. There appears to be a code generation step described in defs_linux.go, but I couldn't get it to work. A go tool cgo -cdefs does not appear to exist anymore. go tool cgo -godefs does seem to exist, but that one chokes (among other things), on this line, which cannot possibly be right.

If I fix that, I get a missing definition error for C.MAP_PRIVATE, which appears to be in linux/mman.h these days rather than asm/mman.h? (at least on my system, which is Debian GNU/Linux bullseye/sid, according to lsb_release)

Do these comments need an update? Am I doing something wrong or missing a detail? When 77f9b27 was written, was the code generation tool actually invoked?

Thanks.

@acln0
Copy link
Contributor Author

acln0 commented Oct 11, 2019

/cc @tklauser

@bcmills
Copy link
Contributor

bcmills commented Oct 11, 2019

This discussion is probably better suited to the golang-dev list.

@ianlancetaylor
Copy link
Contributor

The code generation steps in the runtime package have been broken since the runtime was converted from C to Go. Since the files rarely change, nobody has cared enough to fix this.

This is a dup of #23341. See the discussion there.

@golang golang locked and limited conversation to collaborators Oct 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants