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: regression in handling of linker flags #16842

Closed
dsnet opened this issue Aug 22, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@dsnet
Copy link
Member

commented Aug 22, 2016

Commit fa8a28d introduced a regression where -ldflags doesn't quite work like it used to.

Reproduction:

$ GO_LDFLAGS='-I /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2' ./make.bash
# cmd/go
/home/rawr/Projects/go/pkg/tool/linux_amd64/link: conflict dynlinker: /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 and /lib64/ld-linux-x86-64.so.2
runtime/cgo(.text): stderr: not defined
runtime/cgo(.text): fwrite: not defined
runtime/cgo(.text): __vfprintf_chk: not defined
runtime/cgo(.text): fputc: not defined
runtime/cgo(.text): abort: not defined
runtime/cgo(.text): pthread_create: not defined
runtime/cgo(.text): strerror: not defined
runtime/cgo(.text): stderr: not defined
runtime/cgo(.text): __fprintf_chk: not defined
runtime/cgo(.text): abort: not defined
runtime/cgo(.text): pthread_mutex_lock: not defined
runtime/cgo(.text): pthread_cond_wait: not defined
runtime/cgo(.text): pthread_mutex_unlock: not defined
runtime/cgo(.text): pthread_mutex_lock: not defined
runtime/cgo(.text): pthread_cond_broadcast: not defined
runtime/cgo(.text): pthread_mutex_unlock: not defined
runtime/cgo(.text): pthread_mutex_lock: not defined
runtime/cgo(.text): pthread_mutex_unlock: not defined
runtime/cgo(.text): pthread_mutex_lock: not defined
runtime/cgo(.text): pthread_mutex_unlock: not defined
/home/rawr/Projects/go/pkg/tool/linux_amd64/link: too many errors
##### Building Go bootstrap tool.
cmd/dist

##### Building Go toolchain using /usr/local/go1.4.3.
bootstrap/internal/dwarf
bootstrap/internal/sys
bootstrap/asm/internal/flags
bootstrap/internal/bio
bootstrap/compile/internal/big
bootstrap/internal/obj
bootstrap/compile/internal/syntax
bootstrap/internal/gcprog
bootstrap/internal/obj/arm
bootstrap/internal/obj/arm64
bootstrap/internal/obj/mips
bootstrap/internal/obj/ppc64
bootstrap/internal/obj/s390x
bootstrap/internal/obj/x86
bootstrap/asm/internal/lex
bootstrap/link/internal/ld
bootstrap/compile/internal/ssa
bootstrap/asm/internal/arch
bootstrap/asm/internal/asm
bootstrap/asm
bootstrap/link/internal/amd64
bootstrap/link/internal/arm
bootstrap/link/internal/arm64
bootstrap/link/internal/mips64
bootstrap/link/internal/ppc64
bootstrap/link/internal/s390x
bootstrap/link/internal/x86
bootstrap/link
bootstrap/compile/internal/gc
bootstrap/compile/internal/amd64
bootstrap/compile/internal/arm
bootstrap/compile/internal/arm64
bootstrap/compile/internal/mips64
bootstrap/compile/internal/ppc64
bootstrap/compile/internal/s390x
bootstrap/compile/internal/x86
bootstrap/compile

##### Building go_bootstrap for host, linux/amd64.
runtime/internal/sys
runtime/internal/atomic
runtime
encoding
errors
internal/race
internal/syscall/windows/sysdll
math
sort
sync/atomic
unicode
unicode/utf16
unicode/utf8
sync
container/heap
internal/singleflight
io
syscall
bytes
hash
strings
strconv
hash/adler32
bufio
reflect
encoding/base64
crypto
path
regexp/syntax
crypto/sha1
internal/syscall/windows
internal/syscall/windows/registry
time
regexp
os
os/signal
path/filepath
io/ioutil
encoding/binary
fmt
context
flag
go/token
log
net/url
text/template/parse
compress/flate
encoding/json
debug/dwarf
go/scanner
os/exec
go/ast
debug/macho
compress/zlib
debug/elf
text/template
go/parser
go/doc
go/build
cmd/go

##### Building packages and commands for linux/amd64.
runtime/internal/sys
runtime/internal/atomic
runtime
errors
internal/race
sync/atomic
unicode
unicode/utf8
math
sort
sync
container/heap
container/list
io
syscall
container/ring
crypto/subtle
bytes
strings
path
bufio
hash
hash/adler32
text/tabwriter
hash/crc32
compress/bzip2
strconv
crypto/cipher
time
math/rand
crypto/hmac
internal/syscall/unix
internal/nettrace
internal/singleflight
encoding
unicode/utf16
vendor/golang_org/x/net/lex/httplex
hash/crc64
reflect
regexp/syntax
crypto
crypto/aes
os
crypto/sha512
path/filepath
crypto/md5
crypto/rc4
regexp
crypto/sha1
io/ioutil
crypto/sha256
encoding/base64
encoding/pem
encoding/ascii85
encoding/base32
hash/fnv
html
image/color
internal/syscall/windows/sysdll
runtime/debug
runtime/trace
image
image/color/palette
math/cmplx
os/signal
runtime/race
cmd/compile/internal/test
cmd/internal/pprof/svg
cmd/vet/internal/whitelist
fmt
encoding/binary
image/internal/imageutil
image/draw
image/jpeg
cmd/internal/sys
crypto/des
index/suffixarray
cmd/internal/dwarf
log
flag
debug/dwarf
compress/flate
debug/gosym
debug/plan9obj
cmd/internal/obj
cmd/vendor/golang.org/x/arch/arm/armasm
compress/zlib
debug/macho
debug/pe
debug/elf
cmd/vendor/golang.org/x/arch/x86/x86asm
archive/tar
cmd/internal/goobj
archive/zip
compress/gzip
compress/lzw
context
cmd/internal/objfile
math/big
encoding/hex
go/token
os/exec
cmd/addr2line
go/scanner
go/ast
database/sql/driver
encoding/csv
encoding/gob
database/sql
crypto/dsa
crypto/elliptic
encoding/asn1
crypto/rand
go/parser
crypto/rsa
go/printer
crypto/ecdsa
crypto/x509/pkix
encoding/json
encoding/xml
vendor/golang_org/x/net/http2/hpack
mime
mime/quotedprintable
cmd/cgo
net/http/internal
net/url
text/template/parse
go/constant
go/format
text/scanner
image/gif
go/types
image/png
text/template
runtime/pprof
testing
runtime/cgo
go/doc
html/template
go/build
internal/testenv
internal/trace
net/internal/socktest
net
os/user
testing/iotest
testing/quick
cmd/internal/obj/arm
go/internal/gccgoimporter
go/internal/gcimporter
go/importer
cmd/api
cmd/internal/obj/arm64
cmd/internal/obj/mips
cmd/internal/obj/ppc64
cmd/internal/obj/s390x
cmd/internal/obj/x86
cmd/asm/internal/flags
cmd/asm/internal/lex
cmd/internal/bio
cmd/compile/internal/big
cmd/compile/internal/ssa
crypto/x509
net/textproto
mime/multipart
crypto/tls
net/http/httptrace
log/syslog
net/mail
cmd/asm/internal/arch
cmd/compile/internal/syntax
cmd/asm/internal/asm
cmd/asm
net/http
net/smtp
cmd/internal/gcprog
cmd/cover
cmd/dist
cmd/doc
cmd/fix
cmd/gofmt
cmd/internal/pprof/profile
cmd/internal/pprof/tempfile
cmd/link/internal/ld
cmd/internal/pprof/plugin
cmd/internal/pprof/report
expvar
net/http/cgi
net/http/cookiejar
net/http/fcgi
net/http/httptest
net/http/httputil
net/http/pprof
net/rpc
cmd/go
net/rpc/jsonrpc
cmd/internal/pprof/commands
cmd/internal/pprof/driver
cmd/internal/pprof/fetch
cmd/internal/pprof/symbolizer
cmd/internal/pprof/symbolz
cmd/link/internal/amd64
cmd/link/internal/arm
cmd/link/internal/arm64
cmd/link/internal/mips64
cmd/link/internal/ppc64
cmd/link/internal/s390x
cmd/link/internal/x86
cmd/nm
cmd/link
cmd/objdump
cmd/pack
cmd/pprof
# cmd/go
/home/rawr/Projects/go/pkg/tool/linux_amd64/link: conflict dynlinker: /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 and /lib64/ld-linux-x86-64.so.2
runtime/cgo(.text): stderr: not defined
runtime/cgo(.text): fwrite: not defined
runtime/cgo(.text): __vfprintf_chk: not defined
runtime/cgo(.text): fputc: not defined
runtime/cgo(.text): abort: not defined
runtime/cgo(.text): pthread_create: not defined
runtime/cgo(.text): strerror: not defined
runtime/cgo(.text): stderr: not defined
runtime/cgo(.text): __fprintf_chk: not defined
runtime/cgo(.text): abort: not defined
runtime/cgo(.text): pthread_mutex_lock: not defined
runtime/cgo(.text): pthread_cond_wait: not defined
runtime/cgo(.text): pthread_mutex_unlock: not defined
runtime/cgo(.text): pthread_mutex_lock: not defined
runtime/cgo(.text): pthread_cond_broadcast: not defined
runtime/cgo(.text): pthread_mutex_unlock: not defined
runtime/cgo(.text): pthread_mutex_lock: not defined
runtime/cgo(.text): pthread_mutex_unlock: not defined
runtime/cgo(.text): pthread_mutex_lock: not defined
runtime/cgo(.text): pthread_mutex_unlock: not defined
/home/rawr/Projects/go/pkg/tool/linux_amd64/link: too many errors
cmd/trace
cmd/vet/internal/cfg
cmd/vet
# cmd/pprof
/home/rawr/Projects/go/pkg/tool/linux_amd64/link: conflict dynlinker: /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 and /lib64/ld-linux-x86-64.so.2
runtime/cgo(.text): stderr: not defined
runtime/cgo(.text): fwrite: not defined
runtime/cgo(.text): __vfprintf_chk: not defined
runtime/cgo(.text): fputc: not defined
runtime/cgo(.text): abort: not defined
runtime/cgo(.text): pthread_create: not defined
runtime/cgo(.text): strerror: not defined
runtime/cgo(.text): stderr: not defined
runtime/cgo(.text): __fprintf_chk: not defined
runtime/cgo(.text): abort: not defined
runtime/cgo(.text): pthread_mutex_lock: not defined
runtime/cgo(.text): pthread_cond_wait: not defined
runtime/cgo(.text): pthread_mutex_unlock: not defined
runtime/cgo(.text): pthread_mutex_lock: not defined
runtime/cgo(.text): pthread_cond_broadcast: not defined
runtime/cgo(.text): pthread_mutex_unlock: not defined
runtime/cgo(.text): pthread_mutex_lock: not defined
runtime/cgo(.text): pthread_mutex_unlock: not defined
runtime/cgo(.text): pthread_mutex_lock: not defined
runtime/cgo(.text): pthread_mutex_unlock: not defined
/home/rawr/Projects/go/pkg/tool/linux_amd64/link: too many errors
# cmd/trace
/home/rawr/Projects/go/pkg/tool/linux_amd64/link: conflict dynlinker: /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 and /lib64/ld-linux-x86-64.so.2
runtime/cgo(.text): stderr: not defined
runtime/cgo(.text): fwrite: not defined
runtime/cgo(.text): __vfprintf_chk: not defined
runtime/cgo(.text): fputc: not defined
runtime/cgo(.text): abort: not defined
runtime/cgo(.text): pthread_create: not defined
runtime/cgo(.text): strerror: not defined
runtime/cgo(.text): stderr: not defined
runtime/cgo(.text): __fprintf_chk: not defined
runtime/cgo(.text): abort: not defined
runtime/cgo(.text): pthread_mutex_lock: not defined
runtime/cgo(.text): pthread_cond_wait: not defined
runtime/cgo(.text): pthread_mutex_unlock: not defined
runtime/cgo(.text): pthread_mutex_lock: not defined
runtime/cgo(.text): pthread_cond_broadcast: not defined
runtime/cgo(.text): pthread_mutex_unlock: not defined
runtime/cgo(.text): pthread_mutex_lock: not defined
runtime/cgo(.text): pthread_mutex_unlock: not defined
runtime/cgo(.text): pthread_mutex_lock: not defined
runtime/cgo(.text): pthread_mutex_unlock: not defined
/home/rawr/Projects/go/pkg/tool/linux_amd64/link: too many errors
cmd/compile/internal/gc
cmd/compile/internal/amd64
cmd/compile/internal/arm
cmd/compile/internal/mips64
cmd/compile/internal/arm64
cmd/compile/internal/ppc64
cmd/compile/internal/s390x
cmd/compile/internal/x86
cmd/compile

/cc @matloob @crawshaw

@dsnet dsnet added this to the Go1.8 milestone Aug 22, 2016

@matloob matloob assigned dsnet and unassigned matloob Aug 29, 2016

@matloob

This comment has been minimized.

Copy link
Contributor

commented Aug 29, 2016

I believe this was fixed by golang.org/cl/27562. Please assign back to me if that is not the case.

@dsnet

This comment has been minimized.

Copy link
Member Author

commented Aug 29, 2016

I confirm that this is fixed.

@dsnet dsnet closed this Aug 29, 2016

@golang golang locked and limited conversation to collaborators Aug 29, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.