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 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

This comment has been minimized.

Copy link
Contributor Author

@acln0 acln0 commented Oct 11, 2019

/cc @tklauser

@bcmills

This comment has been minimized.

Copy link
Member

@bcmills bcmills commented Oct 11, 2019

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

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Oct 11, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.