all.bash fails with 'cc1: error: unrecognised debug output level "no-record-gcc-switches"'

1,516 views
Skip to first unread message

Dan Kortschak

unread,
Feb 22, 2016, 11:47:09 PM2/22/16
to golang-dev
all.bash is failing for me on tip with 'cc1: error: unrecognised debug
output level "no-record-gcc-switches"'.

I suspect that this is due to the ancient install I'm running at the
moment.

gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

Is there some way around this?

Dan

minux

unread,
Feb 23, 2016, 12:03:00 AM2/23/16
to Dan Kortschak, golang-dev
On Mon, Feb 22, 2016 at 11:46 PM, Dan Kortschak <dan.ko...@adelaide.edu.au> wrote:
all.bash is failing for me on tip with 'cc1: error: unrecognised debug
output level "no-record-gcc-switches"'.

cmd/go on tip should detect the availability of that flag before using it.
Are you sure you're using tip?

The relevant CL (https://golang.org/cl/19686) is committed on Feb 19.

Dan Kortschak

unread,
Feb 23, 2016, 2:05:38 AM2/23/16
to minux, golang-dev
It was one commit past tip - this may be the cause. I will investigate/confirm with a more recent linux install tonight.

Dan Kortschak

unread,
Feb 23, 2016, 4:36:53 AM2/23/16
to minux, golang-dev
OK, this seems to be an interaction between https://golang.org/cl/19686,
my https://golang.org/cl/19670/ and my old gcc version, though I can't
see how that is happening. Using tip with the old gcc works and the two
CLs together work with gcc 4.8.4.

I'm not sure where to start debugging this interaction. The failure
occurs during compilation of runtime/cgo and terminates at cmd/compile
(complete build output below).

Any suggestions?

On Tue, 2016-02-23 at 00:02 -0500, minux wrote:
> cmd/go on tip should detect the availability of that flag before using
> it.
> Are you sure you're using tip?

$ ./all.bash
##### Building Go bootstrap tool.
cmd/dist

##### Building Go toolchain using /home/daniel/Development/go-boot.
bootstrap/internal/obj
bootstrap/asm/internal/flags
bootstrap/compile/internal/big
bootstrap/internal/gcprog
bootstrap/internal/obj/arm
bootstrap/internal/obj/arm64
bootstrap/internal/obj/mips
bootstrap/internal/obj/ppc64
bootstrap/internal/obj/x86
bootstrap/asm/internal/lex
bootstrap/link/internal/ld
bootstrap/compile/internal/gc
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/x86
bootstrap/link
bootstrap/compile/internal/amd64
bootstrap/compile/internal/arm
bootstrap/compile/internal/arm64
bootstrap/compile/internal/mips64
bootstrap/compile/internal/ppc64
bootstrap/compile/internal/x86
bootstrap/compile

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

##### Building packages and commands for linux/amd64.
runtime/internal/sys
runtime/internal/atomic
runtime
errors
internal/race
sync/atomic
unicode/utf8
unicode
math
sort
container/list
container/ring
crypto/subtle
sync
encoding
unicode/utf16
image/color
runtime/race
cmd/vet/internal/whitelist
container/heap
image/color/palette
io
syscall
internal/singleflight
hash
crypto/cipher
runtime/trace
hash/adler32
hash/crc32
crypto/hmac
hash/crc64
hash/fnv
bytes
strings
math/rand
math/cmplx
strconv
bufio
text/tabwriter
path
html
internal/syscall/unix
time
compress/bzip2
reflect
regexp/syntax
crypto/aes
crypto
crypto/rc4
encoding/base64
encoding/ascii85
crypto/sha512
crypto/md5
crypto/sha1
crypto/sha256
encoding/pem
encoding/base32
image
os
regexp
image/internal/imageutil
image/draw
image/jpeg
path/filepath
runtime/debug
os/signal
cmd/pprof/internal/svg
encoding/binary
fmt
os/exec
io/ioutil
crypto/des
index/suffixarray
log
flag
cmd/internal/unvendor/golang.org/x/arch/x86/x86asm
cmd/internal/unvendor/golang.org/x/arch/arm/armasm
compress/flate
debug/dwarf
debug/gosym
debug/plan9obj
archive/tar
compress/lzw
cmd/internal/obj
math/big
encoding/hex
go/token
compress/zlib
archive/zip
compress/gzip
go/scanner
debug/elf
debug/macho
debug/pe
go/ast
database/sql/driver
cmd/internal/goobj
encoding/csv
encoding/gob
encoding/json
database/sql
encoding/xml
internal/golang.org/x/net/http2/hpack
crypto/dsa
cmd/internal/objfile
crypto/elliptic
encoding/asn1
crypto/rand
go/parser
go/printer
cmd/addr2line
crypto/rsa
crypto/x509/pkix
crypto/ecdsa
mime
mime/quotedprintable
net/http/internal
net/url
text/template/parse
go/constant
text/scanner
image/gif
image/png
runtime/pprof
internal/trace
cmd/cgo
go/format
testing
go/types
net/internal/socktest
testing/iotest
testing/quick
cmd/internal/obj/arm
text/template
cmd/internal/obj/arm64
cmd/internal/obj/mips
internal/testenv
cmd/internal/obj/ppc64
cmd/internal/obj/x86
cmd/asm/internal/flags
cmd/compile/internal/big
go/doc
html/template
cmd/asm/internal/lex
cmd/internal/gcprog
cmd/dist
go/build
cmd/fix
cmd/gofmt
cmd/asm/internal/arch
cmd/compile/internal/gc
cmd/cover
cmd/asm/internal/asm
cmd/asm
go/internal/gccgoimporter
runtime/cgo
# runtime/cgo
cc1: error: unrecognised debug output level "no-record-gcc-switches"
go/internal/gcimporter
cmd/api
cmd/doc
cmd/link/internal/ld
go/importer
cmd/newlink
cmd/nm
cmd/objdump
cmd/pack
cmd/pprof/internal/profile
cmd/pprof/internal/tempfile
cmd/vet
cmd/yacc
cmd/pprof/internal/plugin
cmd/pprof/internal/symbolz
cmd/pprof/internal/report
cmd/pprof/internal/symbolizer
cmd/link/internal/amd64
cmd/link/internal/arm64
cmd/link/internal/arm
cmd/link/internal/mips64
cmd/link/internal/ppc64
cmd/link/internal/x86
cmd/link
cmd/pprof/internal/commands
cmd/pprof/internal/driver
cmd/compile/internal/amd64
cmd/compile/internal/arm
cmd/compile/internal/arm64
cmd/compile/internal/mips64
cmd/compile/internal/ppc64
cmd/compile/internal/x86
cmd/compile
$

Dan Kortschak

unread,
Feb 23, 2016, 4:43:54 AM2/23/16
to minux, golang-dev
Resolved - did git sync and git mail to get the change to the old
machine and now that passes. I had not incorporated 19686 into my CL.

Thanks for that pointer.

Peng Gao

unread,
Jan 18, 2017, 10:13:06 AM1/18/17
to golang-dev

I got the same error, and I regenerate this error by more specific action `GOROOT=~/go1.7 GOPATH=~/GOPATH PATH=$PATH:~/go1.7/bin ./test.bash /usr/bin/gfortran` 

Directory go1.7 is a compiled 1.7 binary directory, and my pwd is the tip misc/cgo/fortran directory. I print CGO_LDFLAGS and libpath in test.bash. got

libpath /usr/lib/gcc/x86_64-redhat-linux/4.4.6

CGO_LDFLAGS  -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.4.6 -L /usr/lib/gcc/x86_64-redhat-linux/4.4.6

It seems no --gno-record-gcc-switches in flags, I am not sure if it is builtin in cgo compiler.

Any idea? 

Russ Cox

unread,
Jan 18, 2017, 10:32:18 AM1/18/17
to Peng Gao, golang-dev
On Wed, Jan 18, 2017 at 10:13 AM, Peng Gao <peng.g...@gmail.com> wrote:

I got the same error, and I regenerate this error by more specific action `GOROOT=~/go1.7 GOPATH=~/GOPATH PATH=$PATH:~/go1.7/bin ./test.bash /usr/bin/gfortran` 

Please try:

GOROOT=~/go1.7 GOPATH=~/GOPATH PATH=~/go1.7/bin:$PATH ./test.bash /usr/bin/gfortran

instead. The most likely reason for this problem is that $PATH contains an older version of go. I moved ~/go1.7/bin to the front of the path in the revised command line.

Thanks.
Russ

Peng Gao

unread,
Jan 19, 2017, 12:20:19 AM1/19/17
to golang-dev, peng.g...@gmail.com
I manually tried this on my machine,
gcc -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build534583490=/tmp/go-build -gno-record-gcc-switches -c trivial.c

It gets no errors, I think my gcc supports no-record-gcc-switches.

But in the fortran test it still complains about no-record-gcc-switches.

Peng Gao

unread,
Jan 19, 2017, 12:57:23 AM1/19/17
to golang-dev
I tried this `gfortran -gno-record-gcc-switches -c answer.f90`

f951: error: unrecognised debug output level "no-record-gcc-switches"

It seems my gfortran compiler doesn't support this flag.

below are my output of gfortran and gcc version information.

[mike.gao@192-168-150-169 tmp]$ gfortran --version
GNU Fortran (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
Copyright (C) 2010 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

[mike.gao@192-168-150-169 tmp]$ gcc --version 
gcc (GCC) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

On Tuesday, February 23, 2016 at 12:47:09 PM UTC+8, Dan Kortschak wrote:

Peng Gao

unread,
Jan 19, 2017, 5:38:55 AM1/19/17
to golang-dev
I fix this error by this patch https://go-review.googlesource.com/#/c/35510/, but I found I lost fortran lib too, so I deleted the default link library.

minux

unread,
Jan 19, 2017, 6:54:01 PM1/19/17
to Peng Gao, golang-dev
On Thu, Jan 19, 2017 at 12:57 AM, Peng Gao <peng.g...@gmail.com> wrote:
I tried this `gfortran -gno-record-gcc-switches -c answer.f90`

f951: error: unrecognised debug output level "no-record-gcc-switches"

It seems my gfortran compiler doesn't support this flag.

below are my output of gfortran and gcc version information.

[mike.gao@192-168-150-169 tmp]$ gfortran --version
GNU Fortran (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
Copyright (C) 2010 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

[mike.gao@192-168-150-169 tmp]$ gcc --version 
gcc (GCC) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The problem is that your gfortran and gcc are not the same version.

Peng Gao

unread,
Jan 20, 2017, 10:57:15 PM1/20/17
to golang-dev, peng.g...@gmail.com
Is it a must to make sure the gfortran and gcc the same version? 
And if it is, what about adding a check for the difference about compiler version? So that users like me can get less confusion when compiling.
Reply all
Reply to author
Forward
0 new messages