golang/go

cmd/cgo: building c-archive with function pointer works with Go 1.14, but not 1.15 and beyond

Open

#44,648 创建于 2021年2月26日

在 GitHub 查看
 (4 评论) (0 反应) (0 负责人)Go (19,008 fork)batch import
NeedsFixcompiler/runtimehelp wanted

仓库指标

Star
 (133,883 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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

Does this issue reproduce with the latest release?

Yes.

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

What did you do?

I build a Go c-archive static library to use in several C/C++ programs. Building c-archives with cgo broke in a way that I don't understand in Go 1.15 and later. Building with Go 1.14 works fine. I put together a simple example here: https://github.com/willie/cgotest

What did you expect to see?

I expected to be able to build a c-archive static library with no errors.

What did you see instead?

贡献者指南