You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/usr/lib/golang/pkg/tool/linux_amd64/link: running clang failed: exit status 1
/opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../bin/ld: cannot find -lelf: No such file or directory
/opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../bin/ld: cannot find -lz: No such file or directory
/opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../bin/ld: cannot find -lelf: No such file or directory
clang的版本如下:centos9 stream操作系统。
clang -v
clang version 18.1.8 (CentOS 18.1.8-3.el9)
Target: x86_64-redhat-linux-gnu
报如下错误:
make[1]: Entering directory '/root/cloud-native-security-with-ebpf/chapter14/modify-incoming-traffic'
CC=clang
CGO_CFLAGS="-I/root/cloud-native-security-with-ebpf/chapter14/modify-incoming-traffic/output"
CGO_LDFLAGS="-lelf -lz /root/cloud-native-security-with-ebpf/chapter14/modify-incoming-traffic/output/libbpf.a"
GOARCH=amd64
go build
-tags netgo -ldflags '-w -extldflags "-static"'
-o main ./main.go
command-line-arguments
/usr/lib/golang/pkg/tool/linux_amd64/link: running clang failed: exit status 1
/opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../bin/ld: cannot find -lelf: No such file or directory
/opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../bin/ld: cannot find -lz: No such file or directory
/opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../bin/ld: cannot find -lelf: No such file or directory
请问代码是运行在gcc哪一个版本?clang哪个一个版本。centos9安装clang会自动安装gcc-toolset-13.
The text was updated successfully, but these errors were encountered: