{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/11739","labels_url":"https://api.github.com/repos/golang/go/issues/11739/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/11739/comments","events_url":"https://api.github.com/repos/golang/go/issues/11739/events","html_url":"https://github.com/golang/go/issues/11739","id":95540964,"number":11739,"title":"cmd/go: \"#cgo pkg-config:\" comments do not work with gccgo","user":{"login":"mwhudson","id":672022,"avatar_url":"https://avatars.githubusercontent.com/u/672022?v=3","gravatar_id":"","url":"https://api.github.com/users/mwhudson","html_url":"https://github.com/mwhudson","followers_url":"https://api.github.com/users/mwhudson/followers","following_url":"https://api.github.com/users/mwhudson/following{/other_user}","gists_url":"https://api.github.com/users/mwhudson/gists{/gist_id}","starred_url":"https://api.github.com/users/mwhudson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwhudson/subscriptions","organizations_url":"https://api.github.com/users/mwhudson/orgs","repos_url":"https://api.github.com/users/mwhudson/repos","events_url":"https://api.github.com/users/mwhudson/events{/privacy}","received_events_url":"https://api.github.com/users/mwhudson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"mwhudson","id":672022,"avatar_url":"https://avatars.githubusercontent.com/u/672022?v=3","gravatar_id":"","url":"https://api.github.com/users/mwhudson","html_url":"https://github.com/mwhudson","followers_url":"https://api.github.com/users/mwhudson/followers","following_url":"https://api.github.com/users/mwhudson/following{/other_user}","gists_url":"https://api.github.com/users/mwhudson/gists{/gist_id}","starred_url":"https://api.github.com/users/mwhudson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwhudson/subscriptions","organizations_url":"https://api.github.com/users/mwhudson/orgs","repos_url":"https://api.github.com/users/mwhudson/repos","events_url":"https://api.github.com/users/mwhudson/events{/privacy}","received_events_url":"https://api.github.com/users/mwhudson/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/24","html_url":"https://github.com/golang/go/milestones/Go1.6","labels_url":"https://api.github.com/repos/golang/go/milestones/24/labels","id":1096159,"number":24,"title":"Go1.6","description":"","creator":{"login":"josharian","id":67496,"avatar_url":"https://avatars.githubusercontent.com/u/67496?v=3","gravatar_id":"","url":"https://api.github.com/users/josharian","html_url":"https://github.com/josharian","followers_url":"https://api.github.com/users/josharian/followers","following_url":"https://api.github.com/users/josharian/following{/other_user}","gists_url":"https://api.github.com/users/josharian/gists{/gist_id}","starred_url":"https://api.github.com/users/josharian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josharian/subscriptions","organizations_url":"https://api.github.com/users/josharian/orgs","repos_url":"https://api.github.com/users/josharian/repos","events_url":"https://api.github.com/users/josharian/events{/privacy}","received_events_url":"https://api.github.com/users/josharian/received_events","type":"User","site_admin":false},"open_issues":336,"closed_issues":143,"state":"open","created_at":"2015-05-05T02:39:06Z","updated_at":"2015-09-22T20:28:12Z","due_on":"2016-01-31T08:00:00Z","closed_at":null},"comments":7,"created_at":"2015-07-16T22:04:02Z","updated_at":"2015-09-22T23:35:10Z","closed_at":null,"body":"I don't have a minimal example, but https://launchpadlibrarian.net/211688868/buildlog_ubuntu-wily-arm64.account-polld_0.1%2B15.04.20150410-0ubuntu2~gcc5.1_BUILDING.txt.gz is an example of this happening. http://bazaar.launchpad.net/~ubuntu-push-hackers/account-polld/trunk/view/head:/accounts/accounts.go#L20 is \"#cgo pkg-config: glib-2.0 libaccounts-glib libsignon-glib\" but the flags are not being passed in the link.\r\n\r\nI don't entirely get how this is supposed to work. cgo writes the flags to a file:\r\n\r\n```\r\n$ cat $WORK/launchpad.net/account-polld/accounts/_obj/_cgo_flags\r\n_CGO_LDFLAGS=-g -O2 -laccounts-glib -lsignon-glib -lgio-2.0 -lgobject-2.0 -lglib-2.0\r\n_CGO_CFLAGS=-pthread -I/usr/include/signond -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -I /tmp/go-build086811367/launchpad.net/account-polld/accounts/_obj/\r\n```\r\n\r\nbut afaict nothing ever looks at this file. When *gccgo is false (https://github.com/golang/go/blob/master/src/cmd/cgo/out.go#L42) it also writes out //go:cgo_ldflag comments, which is how this works with the usual compiler but gccgo doesn't use those comments I think."},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/142453165","html_url":"https://github.com/golang/go/issues/11739#issuecomment-142453165","issue_url":"https://api.github.com/repos/golang/go/issues/11739","id":142453165,"user":{"login":"mwhudson","id":672022,"avatar_url":"https://avatars.githubusercontent.com/u/672022?v=3","gravatar_id":"","url":"https://api.github.com/users/mwhudson","html_url":"https://github.com/mwhudson","followers_url":"https://api.github.com/users/mwhudson/followers","following_url":"https://api.github.com/users/mwhudson/following{/other_user}","gists_url":"https://api.github.com/users/mwhudson/gists{/gist_id}","starred_url":"https://api.github.com/users/mwhudson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwhudson/subscriptions","organizations_url":"https://api.github.com/users/mwhudson/orgs","repos_url":"https://api.github.com/users/mwhudson/repos","events_url":"https://api.github.com/users/mwhudson/events{/privacy}","received_events_url":"https://api.github.com/users/mwhudson/received_events","type":"User","site_admin":false},"created_at":"2015-09-22T23:35:10Z","updated_at":"2015-09-22T23:35:10Z","body":"No that fixed the worst of the problems in the area, but this one is different: pkg-config is run when the go package is compiled, but the flags must be used when the executable is *linked*, which might not be in the same invocation of the go tool."}}