I was building a shared/dynamic library by using bazel
. The rules in Build
file are like below
cc_library(
name = "a",
srcs = ["a.cc"]
)
filegroup(
name = "vis_ld",
srcs = ["tool/vis.ld"]
)
cc_library(
name = "b",
hdrs = ["b.h"],
srcs = ["b.cc"],
deps = [":a"],
)
cc_binary(
name = "libgeta.so",
deps = [":b"],
linkshared = True,
linkopts = [
"-Wl,--version-script,","$(location :vis_ld)"
],
data = [":vis_ld"]
)
<代码>libgeta.so是目标双向文档。 我们从该规则中知道,存在着限制出口标志的文字档案。 这里有线索,如果我修建libgeta.so
。 在当地,它进行罚款。 当我试图利用巴策群集时,它没有出现以下错误。
/opt/rh/devtoolset-7/root/usr/bin/ld.gold: error: cannot open tool/vs.ld: No such file or directory
/opt/rh/devtoolset-7/root/usr/bin/ld.gold: fatal error: unable to parse version script file tool/vs.ld
collect2: error: ld returned 1 exit status
the bazel version I was using is 0.24.1
.
它使我困惑了几天,请帮助。 感谢!
我试图在编集时间生成<代码>vs.ld文档,但并非有效。