Blog

Error al compilar: mix deps.compile meeseeks_html5ever: symbol LLVMInitializeMSP430TargetInfo version LLVM_7 not defined…

Error al compilar: mix deps.compile meeseeks_html5ever: symbol LLVMInitializeMSP430TargetInfo version LLVM_7 not defined…

Estoy haciendo alguna cosa con Elixir, necesitaba la librería meeseeks. Primero tuve que instalar rust: sudo dnf install rust cargo Sin embargo, al hacer iex -S mix, saltaba el siguiente error: error: couldn't load codegen backend "/usr/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so": "/usr/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so: symbol LLVMInitializeMSP430TargetInfo version LLVM_7 not defined in file libLLVM-7.so with link time reference" Buscando el fichero libLLVM-7.so lo encuentro en /usr/lib64/libLLVM-7.so. Busco el símbolo que causa el error:
[j@localhost sukui]$ readelf -Ws /usr/lib64/libLLVM-7.so | grep LLVMInitializeMSP430TargetInfo
[j@localhost sukui]$ 
No devolvía nada. Me encontré este enlace en el que se mencionaba un error parecido, que se solventaba actualizando llvm. Haciendo dnf list installed «*llvm*» comprobé que tenía la versión 7.0.1-3.fc29. Actualizo a la versión 7.0.1-4.fc29 con´sudo dnf update llvm-libs, y ahora va todo bien: el símbolo está y compila:
[j@localhost sukui]$ readelf -Ws /usr/lib64/libLLVM-7.so | grep LLVMInitializeMSP430TargetInfo
  4702: 0000000002501b30    56 FUNC    GLOBAL DEFAULT   13 LLVMInitializeMSP430TargetInfo@@LLVM_7

[j@localhost sukui]$ mix deps.compile meeseeks_html5ever
==> meeseeks_html5ever
Compiling NIF crate :meeseeks_html5ever_nif (native/meeseeks_html5ever_nif)...
 Downloading crates ...
  Downloaded markup5ever v0.7.5
  Downloaded xml5ever v0.12.1
  Downloaded lazy_static v1.2.0
  Downloaded tendril v0.4.1
  Downloaded rustler v0.20.0
  Downloaded scoped-pool v1.0.0
  Downloaded html5ever v0.22.5
  Downloaded log v0.4.6
  Downloaded serde_json v1.0.38
  Downloaded phf v0.7.24
  Downloaded string_cache v0.7.3
  Downloaded serde_derive v1.0.88
  Downloaded phf_codegen v0.7.24
  Downloaded mac v0.1.1
  Downloaded serde v1.0.88
  Downloaded string_cache_codegen v0.4.2
  Downloaded time v0.1.42
  Downloaded phf_shared v0.7.24
  Downloaded itoa v0.4.3
  Downloaded utf-8 v0.7.5
  Downloaded proc-macro2 v0.4.27
  Downloaded cfg-if v0.1.6
  Downloaded quote v0.6.11
  Downloaded scopeguard v0.1.2
  Downloaded ryu v0.2.7
  Downloaded string_cache_shared v0.3.0
  Downloaded which v2.0.1
  Downloaded crossbeam v0.2.12
  Downloaded new_debug_unreachable v1.0.2
  Downloaded erlang_nif-sys v0.6.4
  Downloaded syn v0.15.26
  Downloaded futf v0.1.4
  Downloaded unicode-xid v0.1.0
  Downloaded siphasher v0.2.3
  Downloaded precomputed-hash v0.1.1
  Downloaded phf_generator v0.7.24
  Downloaded variance v0.1.3
  Downloaded rand v0.6.5
  Downloaded rand_xorshift v0.1.1
  Downloaded libc v0.2.48
  Downloaded unreachable v0.1.1
  Downloaded rand_isaac v0.1.1
  Downloaded rand_core v0.4.0
  Downloaded rand_pcg v0.1.1
  Downloaded failure v0.1.5
  Downloaded rand_chacha v0.1.1
  Downloaded rand_hc v0.1.0
  Downloaded rand_os v0.1.2
  Downloaded autocfg v0.1.2
  Downloaded rand_core v0.3.1
  Downloaded rand_jitter v0.1.3
  Downloaded void v1.0.2
  Downloaded rustc_version v0.2.3
  Downloaded backtrace v0.3.14
  Downloaded rustc-demangle v0.1.13
  Downloaded semver v0.9.0
  Downloaded backtrace-sys v0.1.28
  Downloaded semver-parser v0.7.0
  Downloaded cc v1.0.29
   Compiling semver-parser v0.7.0
   Compiling autocfg v0.1.2
   Compiling libc v0.2.48
   Compiling rand_core v0.4.0
   Compiling cc v1.0.29
   Compiling proc-macro2 v0.4.27
   Compiling unicode-xid v0.1.0
   Compiling siphasher v0.2.3
   Compiling ryu v0.2.7
   Compiling serde v1.0.88
   Compiling cfg-if v0.1.6
   Compiling string_cache_shared v0.3.0
   Compiling rustc-demangle v0.1.13
   Compiling itoa v0.4.3
   Compiling mac v0.1.1
   Compiling new_debug_unreachable v1.0.2
   Compiling erlang_nif-sys v0.6.4
   Compiling lazy_static v1.2.0
   Compiling utf-8 v0.7.5
   Compiling void v1.0.2
   Compiling precomputed-hash v0.1.1
   Compiling variance v0.1.3
   Compiling scopeguard v0.1.2
   Compiling crossbeam v0.2.12
   Compiling rand_chacha v0.1.1
   Compiling rand v0.6.5
   Compiling backtrace v0.3.14
   Compiling semver v0.9.0
   Compiling rand_core v0.3.1
   Compiling rand_jitter v0.1.3
   Compiling phf_shared v0.7.24
   Compiling backtrace-sys v0.1.28
   Compiling log v0.4.6
   Compiling futf v0.1.4
   Compiling unreachable v0.1.1
   Compiling scoped-pool v1.0.0
   Compiling rand_hc v0.1.0
   Compiling rand_xorshift v0.1.1
   Compiling rand_isaac v0.1.1
   Compiling rustc_version v0.2.3
   Compiling phf v0.7.24
   Compiling tendril v0.4.1
   Compiling rand_pcg v0.1.1
   Compiling rand_os v0.1.2
   Compiling time v0.1.42
   Compiling quote v0.6.11
   Compiling serde_json v1.0.38
   Compiling syn v0.15.26
   Compiling failure v0.1.5
   Compiling which v2.0.1
   Compiling phf_generator v0.7.24
   Compiling rustler v0.20.0
   Compiling string_cache_codegen v0.4.2
   Compiling phf_codegen v0.7.24
   Compiling string_cache v0.7.3
   Compiling serde_derive v1.0.88
   Compiling html5ever v0.22.5
   Compiling markup5ever v0.7.5
   Compiling xml5ever v0.12.1
   Compiling meeseeks_html5ever_nif v0.11.0 (/home/j/Documents/sukui/deps/meeseeks_html5ever/native/meeseeks_html5ever_nif)
    Finished release [optimized] target(s) in 10m 36s
Compiling 2 files (.ex)
Generated meeseeks_html5ever app
[j@localhost sukui]$
Ahora:
[j@localhost sukui]$ iex -S mix
Erlang/OTP 20 [erts-9.3.3.8] [source][/source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [hipe] [kernel-poll:false]

==> meeseeks
Compiling 1 file (.yrl)
Compiling 1 file (.xrl)
Compiling 2 files (.erl)
Compiling 89 files (.ex)
warning: function :xmerl_xpath_scan.tokens/1 is undefined (module :xmerl_xpath_scan is not available)
  lib/meeseeks/selector/xpath/tokenizer.ex:10

Generated meeseeks app
==> sukui
Compiling 3 files (.ex)
Generated sukui app
** (Mix) Could not start application xmerl: could not find application file: xmerl.app
Mirando aquí veo que tengo que instalar erlang-xmerl, que me actualiza varias cosas incluyendo erlang, y ahora sí que puedo hacer:
[j@localhost sukui]$ iex -S mix
2019-05-02 18:12:34 ~s~n
	"driver_select(0x00007f43c0700ba8, 0, ERL_DRV_READ ERL_DRV_USE, 1) by tty_sl (tty_sl -c -e) driver #Port<0.505> called before stop_select was called for driver 'tty_sl'\n"
Erlang/OTP 20 [erts-9.3.3.10] [source][/source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [hipe] [kernel-poll:false]


=ERROR REPORT==== 2-May-2019::20:12:34 ===
driver_select(0x00007f43c0700ba8, 0, ERL_DRV_READ ERL_DRV_USE, 1) by tty_sl (tty_sl -c -e) driver #Port<0.505> called before stop_select was called for driver 'tty_sl'

Interactive Elixir (1.7.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 
BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
       (v)ersion (k)ill (D)b-tables (d)istribution
^C[j@localhost sukui]$ 
[j@localhost sukui]$ 
El error de Erlang que aparece arriba creo que es normal al actualizar. Al ejecutar por segunda vez todo va bien:
[j@localhost sukui]$ iex -S mix
Erlang/OTP 20 [erts-9.3.3.10] [source][/source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [hipe] [kernel-poll:false]

Interactive Elixir (1.7.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 
BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
       (v)ersion (k)ill (D)b-tables (d)istribution
^C[j@localhost sukui]$