在Slackware 14.2中安装runc时出现错误。

huangapple go评论77阅读模式
英文:

runc installation error in Slackware 14.2

问题

我正在尝试通过SBoTools在Slackware 14.2上安装Docker,但是我遇到了runc安装的错误信息。

undefined reference to `seccomp_rule_add_exact_array'
collect2: error: ld returned 1 exit status

make: *** [all] Error 2

Makefile:30: recipe for target 'all' failed

Failures: runc: runc.SlackBuild return non-zero

我尝试从源代码构建runc,但是遇到了相同的错误。我不是go-lang的专家,也不知道问题是否与它有关。

谢谢,


更多细节:

问题发生在安装时执行以下命令时:

go build -i -ldflags "-X main.gitCommit=54296cf40ad8143b62dbcaa1d90e520a2136ddfe -X main.version=1.0.0-rc2" -tags "seccomp" -o runc .

编辑#2-问题解决。

好的,问题出在slackbuilds的runc软件包的Makefile中。
有两行将使用命令"go build",并且两者都有一个名为"-ldflags"的标志...为了解决问题,只需将此标志更新为"-gccgoflags",然后问题就会解决。
注意:如果您正在尝试安装Docker,则containerd也会出现此问题。

希望这对某人有所帮助,我将向Slackbuilds软件包的维护者报告此问题 在Slackware 14.2中安装runc时出现错误。

英文:

I'm trying to install Docker in Slackware 14.2 via SBoTools, but I got an error message of runc installation.

> undefined reference to `seccomp_rule_add_exact_array'
collect2: error: ld returned 1 exit status

>make: *** [all] Error 2

>Makefile:30: recipe for target 'all' failed

> Failures: runc: runc.SlackBuild return non-zero

I tried to build runc from source, but got the same error. I'm not an specialist with go-lang and don't know if the problem is with it.

Thanks,


More details:

The problem happens when in the installation when it gives that command:

go build -i -ldflags "-X main.gitCommit=54296cf40ad8143b62dbcaa1d90e520a2136ddfe -X main.version=1.0.0-rc2" -tags "seccomp" -o runc .

Edit #2 - Problem solved.

Alright, the problem was in Makefile of runc package from slackbuilds.
There is two lines where the command "go build" will be used and in both there is an flag called "-ldflags"... To solve the problem, just update this flag with "-gccgoflags" and that sould work.
Obs: If you're trying to install Docker, you'll have this problem with containerd too.

Hope this can help someone and I'll report this for the mainteiner of the package in Slackbuilds 在Slackware 14.2中安装runc时出现错误。

答案1

得分: 2

在构建时,您的PATH变量没有正确设置。go可执行文件被从/usr/bin目录中获取;该可执行文件对应于gccgo,而不是google-golang软件包中的那个,后者应该被使用。

英文:

You did not have your PATH variable correctly set when building. The go executable is being picked up from /usr/bin; that executable corresponds to gccgo, not to the one in the google-golang package, which is the one to be used.

答案2

得分: 2

问题不在于-ldflags,问题在于你在安装google-go-lang之后没有设置你的PATH。
要解决这个问题,你可以从你安装了go的root提示符注销并重新登录,或者简单地执行以下命令来加载/etc/profile.d/go.sh

source /etc/profile.d/go.sh

然后在刚刚加载了go.sh的提示符下继续安装runc和其他软件包。
参考:slackware:howtos:docker

英文:

The problem isn't -ldflags, The problem is that you haven't set your PATH after installing google-go-lang.
To do this you can logout from root prompt that you installed go and log back in, or simply just source /etc/profile.d/go.sh:

source /etc/profile.d/go.sh

and then continue on installing runc and other packages from the prompt that you just sourced go.sh.
see:slackware:howtos:docker

答案3

得分: 0

不,这与Go语言无关。这个错误是在编译(或者更准确地说是链接)C代码时发生的。乍一看,问题似乎是因为你的libseccomp版本过旧。缺失的符号是在该库的2.0版本和2.1版本之间添加的。

英文:

No, it's nothing to do with Go at all. That error is occurring while compiling (or rather linking) C code. At first glance, it looks like the problem is that your libseccomp is out of date. The missing symbol was added betwen version 2.0 and 2.1 of that library.

huangapple
  • 本文由 发表于 2017年8月31日 12:31:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/45973279.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定