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
Closed

cmd/go: invalid flag when importing bimg #27496

tssajo opened this issue Sep 4, 2018 · 5 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@tssajo
Copy link

tssajo 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 the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 4, 2018
@andybons andybons added this to the Unplanned milestone Sep 4, 2018
@andybons
Copy link
Member

andybons commented Sep 4, 2018

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

@AlexRouSg
Copy link
Contributor

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

@gopherbot
Copy link

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

@gopherbot
Copy link

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

@gopherbot
Copy link

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

gopherbot pushed a commit that referenced this issue Sep 7, 2018
…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
…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
raxod502 added a commit to replit/prybar that referenced this issue Jun 13, 2019
* Fix "Running as root is not recommended" message at container
  startup. See <ocaml/opam#2575>.
* Add Makefile targets to build and run Docker images, and 'make help'
  target.
* Reduce number of layers in Dockerfile and improve build time.
* Fix several bugs in Makefile which were causing spurious rebuilds.
* Remove legacy extract.sh script.
* Use HTTPS when downloading libmozjs.
* Improve readability of Dockerfile and Makefile. Split out dependency
  installation into a separate Bash script.
* Reduce verbosity of build.
* Fix mistake in Cgo configuration for R, although R is still broken
  because using Cgo with libR requires Go 1.10.5 while Ubuntu Bionic
  only ships 1.10.4. See <golang/go#27496>.
raxod502 added a commit to replit/prybar that referenced this issue Jun 13, 2019
* Fix "Running as root is not recommended" message at container
  startup. See <ocaml/opam#2575>.
* Add Makefile targets to build and run Docker images, and 'make help'
  target.
* Reduce number of layers in Dockerfile and improve build time.
* Fix several bugs in Makefile which were causing spurious rebuilds.
* Remove legacy extract.sh script.
* Use HTTPS when downloading libmozjs.
* Improve readability of Dockerfile and Makefile. Split out dependency
  installation into a separate Bash script.
* Reduce verbosity of application and Docker builds.
* Fix mistake in Cgo configuration for R, although R is still broken
  because using Cgo with libR requires Go 1.10.5 while Ubuntu Bionic
  only ships 1.10.4. See <golang/go#27496>.
@golang golang locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants