Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#43197 - [llvm-ocaml] Cannot use ocaml with llvm: undefined symbol, missing external function
Attached to Project:
Arch Linux
Opened by Alain Kalker (ackalker) - Monday, 22 December 2014, 17:05 GMT
Last edited by Evangelos Foutras (foutrelis) - Sunday, 04 January 2015, 22:51 GMT
Opened by Alain Kalker (ackalker) - Monday, 22 December 2014, 17:05 GMT
Last edited by Evangelos Foutras (foutrelis) - Sunday, 04 January 2015, 22:51 GMT
|
DetailsDescription:
TL;DR - Please rebuild llvm-ocaml against latest ocaml version. - Link info for llvm ocaml package appears to be broken. llvm-ocaml appears to be out of sync with the latest ocaml package. Trying to build [1] produces the following error (full log attached to this issue): File "ipl_llvm.ml", line 1: Error: The files /usr/lib/ocaml/pervasives.cmi and /usr/lib/ocaml/llvm.cmi make inconsistent assumptions over interface Pervasives Rebuilding the llvm package against the latest ocaml and reinstalling the llvm, llvm-libs, llvm-ocaml and clang packages resolved the above problem. However, a new, related issue pops up, A clean build of [1] now produces the following error: ocamlc -g -ccopt -lstdc++ llvm.cma llvm_executionengine.cma llvm_analysis.cma llvm_scalar_opts.cma llvm_target.cma llvm_bitwriter.cma var.cmo base.cmo value.cmo term.cmo eval.cmo printing.cmo reify.cmo ctx.cmo check_term.cmo initial.cmo expr.cmo check_expr.cmo lex.cmo syntax.cmo ipl_compile.cmo ipl_llvm.cmo test_llvm.cmo -o test_llvm File "_none_", line 1: Error: Error on dynamically loaded library: /usr/lib/ocaml/dllllvm.so: /usr/lib/ocaml/dllllvm.so: undefined symbol: LLVMGetFirstUse Makefile:113: recipe for target 'test_llvm' failed make: *** [test_llvm] Error 2 To investigate, I tried building a custom toplevel containing the llvm bindings: $ ocamlmktop -o llvmtop llvm.cma File "_none_", line 1: Error: Error on dynamically loaded library: /usr/lib/ocaml/dllllvm.so: /usr/lib/ocaml/dllllvm.so: undefined symbol: LLVMGetFirstUse $ pacgrep LLVMGetFirstUse llvm-libs # personal script $ pacgrep LLVMGetFirstUse llvm-libs Binary file /usr/lib/libLLVM-3.5.0.so matches Binary file /usr/lib/libLLVM-3.5.so matches It appears the link information for llvm linking dllllvm.so with libLLVM-*.so is broken. Could this be an RPATH issue? (it appears that RPATH is being forcibly removed in the PKGBUILD). Additional info: * package version(s) ocaml 4.02.1-1 llvm 3.5.0-2.1 llvm-libs 3.5.0-2.1 llvm-ocaml 3.5.0-2.1 * config and/or log files etc. Steps to reproduce: $ ocamlmktop -o llvmtop llvm.cma File "_none_", line 1: Error: Error on dynamically loaded library: /usr/lib/ocaml/dllllvm.so: /usr/lib/ocaml/dllllvm.so: undefined symbol: LLVMGetFirstUse |
This task depends upon
Closed by Evangelos Foutras (foutrelis)
Sunday, 04 January 2015, 22:51 GMT
Reason for closing: Fixed
Additional comments about closing: llvm 3.5.0-3
Sunday, 04 January 2015, 22:51 GMT
Reason for closing: Fixed
Additional comments about closing: llvm 3.5.0-3
$ ocamlc -cc g++ llvm.cma llvm_bitreader.cma bc.cmo -o bc
and turning it into the following ugly monstrosity:
$ ocamlc -verbose -custom -cclib "$(llvm-config --libs) /usr/lib/ocaml/dllllvm_bitreader.so /usr/lib/ocaml/dllllvm.so /usr/lib/libLLVM-3.5.so" -cc g++ llvm.cma llvm_bitreader.cma bc.cmo -o bc
[2]: http://nopaniers.calepin.co/getting-started-with-ocaml-bindings-for-llvm.html
The OCaml .so libs were indeed underlinked which I've reported upstream: http://llvm.org/bugs/show_bug.cgi?id=22014
Please note that intuitionistic still won't build because Llvm_executionengine is broken in LLVM 3.5.