The rpm installation package for Bearer can be run on Rhel7. But it cannot run on rhel6 because the gblibc version of rhel6 is too low, and upgrading gblibc carries the risk of system crashes.
Now I want to compile Bearer on Rhel6.
command:
GOOS=linux GOFLAGS=-v GOGCFLAGS=”all=-N -l” CGO_CFLAGS=”$CGO_CFLAGS -std=gnu99″ go build -ldflags “-X main.buildstamp=date '+%Y-%m-%d_%H:%M:%S'
-X ‘main.goversion=$(go version)'” -mod vendor -o bear_bin cmd/bearer/bearer.go
The compilation error is as follows:
command-line-arguments
/root/tools/go1.22.2/pkg/tool/linux_amd64/link: running g++ failed: exit status 1
/tmp/go-link-1560246436/000039.o: In function clock_now': parser.c:(.text+0x442): undefined reference to
clock_gettime’
collect2: 错误:ld 返回 1
OS:rhel6
linux kenel:2.6.32-431
gcc version:gcc-4.8.5
go version:go1.22.2
bearer version:bearer-1.43.2
Do anybody know how to solve it? Could you please inform me? Thank you very much!
billow liu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.