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

running gcc failed: exit status 1 #44703

Closed
dongbiao830415 opened this issue Mar 1, 2021 · 4 comments
Closed

running gcc failed: exit status 1 #44703

dongbiao830415 opened this issue Mar 1, 2021 · 4 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@dongbiao830415
Copy link

dongbiao830415 commented Mar 1, 2021

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

$ go version
go version go1.16 linux/amd64

Does this issue reproduce with the latest release?

yes

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

go env Output
$ go env
GO111MODULE="off"
GOARCH="amd64"
GOBIN="/root/src/go_dev/bin"
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/src/go_dev/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/src/go_dev"
GOPRIVATE=""
GOPROXY="https://repo.haplat.net/go-local,https://repo.haplat.net/go,direct"
GOROOT="/root/dongb/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/root/dongb/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
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-build2255314678=/tmp/go-build -gno-record-gcc-switches"

os

centos7

kernel version

5.6.7-1.el7.elrepo.x86_64

xfsprogs version

xfsprogs-devel-4.5.0-18.el7.x86_64

gcc version

$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
Copyright (C) 2015 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.

What did you do?

git clone https://github.com/cirocosta/xfsvol.git
cd xfsvol/xfsvolctl
go build -v

What did you expect to see?

Compiled successfully

What did you see instead?

github.com/cirocosta/xfsvol/xfsvolctl

/root/dongb/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-476550193/000008.o: unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

@cherrymui
Copy link
Member

/usr/bin/ld: /tmp/go-link-476550193/000008.o: unrecognized relocation (0x2a) in section `.text'

This is not an object generated by Go. It is probably generated by the C compiler. Is you C compiler compatible with your binutils? What version of binutils are you using?

@seankhliao seankhliao added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 1, 2021
@ianlancetaylor
Copy link
Contributor

Closing as dup of #43996. Please comment if you disagree.

@dongbiao830415
Copy link
Author

dongbiao830415 commented Mar 2, 2021

Closing as dup of #43996. Please comment if you disagree.

binutils version is binutils-2.23.52.0.1-55.el7.x86_64, gcc binutils xfsprogs installed by yum,so it should not be a compatibility issue。
I can compile successfully through " go build -v -gcflags="all=-N -l" "。
go version <= 1.15 is ok。

@ianlancetaylor
Copy link
Contributor

As discussed on #43996, you will get this error if you use the prebuilt Go install from golang.org and are using GNU binutils earlier than 2.24.

You will not get this error if you build Go yourself.

@golang golang locked and limited conversation to collaborators Mar 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants