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/go: invalid flag when importing bimg #27496

Closed
tssajo opened this issue Sep 4, 2018 · 5 comments

Comments

Projects
None yet
4 participants
@tssajo
Copy link

commented Sep 4, 2018

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

# go version
go version go1.11 linux/amd64

Does this issue reproduce with the latest release?

Yes, and I can reproduce the issue with Go 1.10.x too.
However the build works just fine with Go 1.9.6 on an Ubuntu 14.04 system.

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

# lsb_release -a
Distributor ID: Debian
Description:    Debian GNU/Linux 8.11 (jessie)
Release:        8.11
Codename:       jessie
# go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/tss/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build414295438=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Wrote a program using h2non/bimg.v1 that begins like this:

package main

import (
	bimg "gopkg.in/h2non/bimg.v1"
)

and then tried to build it:

go build

What did you expect to see?

A successful build.

What did you see instead?

# go build
go build gopkg.in/h2non/bimg.v1: invalid flag in pkg-config --libs: -Wl,--export-dynamic

Any help would be highly appreciated!

Note: Because of the above issue, I'm stuck with Go 1.9.6 for quiet a while now... :(

@andybons andybons changed the title Unable to build anything importing bimg in Go 1.11 (Linux) cmd/go: invalid flag when importing bimg Sep 4, 2018

@andybons andybons added this to the Unplanned milestone Sep 4, 2018

@andybons

This comment has been minimized.

Copy link
Member

commented Sep 4, 2018

@ianlancetaylor looks like another flag to add to the whitelist?

@AlexRouSg

This comment has been minimized.

Copy link
Contributor

commented Sep 4, 2018

@tssajo As a temporary workaround there is a CGO_LDFLAGS_ALLOW environmental flag which accepts a regex.

@gopherbot

This comment has been minimized.

Copy link

commented Sep 7, 2018

Change https://golang.org/cl/134016 mentions this issue: cmd/go: add -Wl,--export-dynamic to linker flag whitelist

@gopherbot

This comment has been minimized.

Copy link

commented Sep 7, 2018

Change https://golang.org/cl/134056 mentions this issue: [elease-branch.go1.11] cmd/go: add -Wl,--export-dynamic to linker flag whitelist

@gopherbot

This comment has been minimized.

Copy link

commented Sep 7, 2018

Change https://golang.org/cl/134135 mentions this issue: [release-branch.go1.10] cmd/go: add -Wl,--export-dynamic to linker flag whitelist

@gopherbot gopherbot closed this in ceb7745 Sep 7, 2018

gopherbot pushed a commit that referenced this issue Sep 7, 2018

[release-branch.go1.11] cmd/go: add -Wl,--export-dynamic to linker fl…
…ag whitelist

Fixes #27496

Change-Id: I53538c7697729294a9e50ace26a6a7183131e837
Reviewed-on: https://go-review.googlesource.com/134016
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
(cherry picked from commit 7f57e2236d59b96467635c8adb024f9b7b972790)
Reviewed-on: https://go-review.googlesource.com/134056

gopherbot pushed a commit that referenced this issue Sep 7, 2018

[release-branch.go1.10] cmd/go: add -Wl,--export-dynamic to linker fl…
…ag whitelist

Fixes #27496

Change-Id: I53538c7697729294a9e50ace26a6a7183131e837
Reviewed-on: https://go-review.googlesource.com/134016
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
(cherry picked from commit ceb7745)
Reviewed-on: https://go-review.googlesource.com/134135
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.