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/link: in package .syso not working in Go 1.12 #29253

minux opened this issue Dec 14, 2018 · 1 comment

cmd/link: in package .syso not working in Go 1.12 #29253

minux opened this issue Dec 14, 2018 · 1 comment


Copy link

@minux minux commented Dec 14, 2018

Current go master (Go 1.12) broke the use of in-package syso files (broken by with names shorter than 12 byte (because
the limitation on filename length, even though race detector relies on syso,
it is not broken by the CL.)

As a short reproduction, run the following shell script under $GOPATH/src:


set -ex

mkdir issue
cd issue

cat <<EOF > ext.c
// +build ignore

int f(int x) { return x * 2; }
cat <<EOF > pkg.go
package issue

// extern int f(int);
import "C"

func init() {
cat <<EOF > main.go
// +build ignore

package main

import _ "issue"

func main() {}

cc -c -fPIC -o ext.syso ext.c
go run main.go

Because Go 1.12 cmd/link no longer passes the bundled syso to the external linker,
the final go run will fail to build the executable due to missing f symbol.

This is a Go 1.12 regression, so labelling it as release-broker.

@minux minux added this to the Go1.12 milestone Dec 14, 2018
@minux minux self-assigned this Dec 14, 2018
Copy link

@gopherbot gopherbot commented Dec 14, 2018

Change mentions this issue: cmd/link: fix in-package syso linking

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.