首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >链接错误码2

链接错误码2
EN

Stack Overflow用户
提问于 2017-03-10 21:10:21
回答 1查看 497关注 0票数 2

我运行了命令opam install ocamlbuild,似乎我对ocamlopt有某种问题

以下是opam告诉我的:(我猜它只是不喜欢我的4.04版本)

代码语言:javascript
复制
### stdout ###
# [...]
# mkdir -p tmp
# ocamlopt.opt -pack src/const.cmx src/loc.cmx src/discard_printf.cmx src/signatures.cmi src/my_std.cmx src/my_unix.cmx src/tags.cmx src/display.cmx src/log.cmx src/shell.cmx src/bool.cmx src/glob_ast.cmx src/glob_lexer.cmx src/glob.cmx src/lexers.cmx src/param_tags.cmx src/command.cmx src/ocamlbuild_config.cmx src/ocamlbuild_where.cmx src/slurp.cmx src/options.cmx src/pathname.cmx src/configuration.cmx src/flags.cmx src/hygiene.cmx src/digest_cache.cmx src/resource.cmx src/rule.cmx src/solver.cmx src/report.cmx src/tools.cmx src/fda.cmx src/findlib.cmx src/ocaml_arch.cmx src/ocaml_utils.cmx src/ocaml_dependencies.cmx src/ocaml_compiler.cmx src/ocaml_tools.cmx src/ocaml_specific.cmx src/exit_codes.cmx src/plugin.cmx src/hooks.cmx src/main.cmx -o tmp/ocamlbuild_pack.cmx
# mv tmp/ocamlbuild_pack.cmx src/ocamlbuild_pack.cmx
# mv tmp/ocamlbuild_pack.o src/ocamlbuild_pack.o
# ocamlopt.opt -for-pack Ocamlbuild_pack -w L -w R -w Z -I src -I +unix -safe-string -bin-annot -c src/ocamlbuild_plugin.ml
# ocamlopt.opt -for-pack Ocamlbuild_pack -w L -w R -w Z -I src -I +unix -safe-string -bin-annot -c src/ocamlbuild_executor.ml
# ocamlopt.opt -for-pack Ocamlbuild_pack -w L -w R -w Z -I src -I +unix -safe-string -bin-annot -c src/ocamlbuild_unix_plugin.ml
# ocamlopt.opt -for-pack Ocamlbuild_pack -w L -w R -w Z -I src -I +unix -safe-string -bin-annot -c src/ocamlbuild.ml
# ocamlopt.opt -I +unix -I src -o ocamlbuild.native unix.cmxa src/ocamlbuild_pack.cmx src/ocamlbuild_plugin.cmx src/ocamlbuild_executor.cmx src/ocamlbuild_unix_plugin.cmx src/ocamlbuild.cmx
# Makefile:131: recipe for target 'ocamlbuild.native' failed
### stderr ###
# [...]
# /usr/bin/ld: /home/oleg/.opam/4.04.0/lib/ocaml/libasmrun.a(finalise.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
# /usr/bin/ld: /home/oleg/.opam/4.04.0/lib/ocaml/libasmrun.a(custom.o): relocation R_X86_64_32 against symbol `caml_custom_table' can not be used when making a shared object; recompile with -fPIC
# /usr/bin/ld: /home/oleg/.opam/4.04.0/lib/ocaml/libasmrun.a(unix.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
# /usr/bin/ld: /home/oleg/.opam/4.04.0/lib/ocaml/libasmrun.a(backtrace.o): relocation R_X86_64_32 against symbol `caml_backtrace_last_exn' can not be used when making a shared object; recompile with -fPIC
# /usr/bin/ld: /home/oleg/.opam/4.04.0/lib/ocaml/libasmrun.a(startup.o): relocation R_X86_64_32S against symbol `caml_data_segments' can not be used when making a shared object; recompile with -fPIC
# /usr/bin/ld: final link failed: Nonrepresentable section on output
# collect2: error: ld returned 1 exit status
# File "caml_startup", line 1:
# Error: Error during linking
# make: *** [ocamlbuild.native] Error 2

谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-03-11 01:57:01

从输出判断,您可以尝试重新安装当前开关,该开关看起来是4.04.0

运行opam switch reinstall 4.04.0应该重新编译ocamlopt.opt二进制文件。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42727774

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档