cloudius-systems / osv

OSv, a new operating system for the cloud.
osv.io
Other
4.11k stars 605 forks source link

erlang package doesn't work on Fedora 27 #943

Open nyh opened 6 years ago

nyh commented 6 years ago

On Fedora 27, gcc 7.2.1,

scripts/build -j5 image=erlang
scripts/run.py -V

I get:

$ scripts/run.py -V
OSv v0.24-486-gedaa9dc9
4 CPUs detected
...
/usr/lib64/erlang/erts-7.0/bin/beam.smp: failed looking up symbol tgetent

[backtrace]
0x000000000033a7cf <elf::object::symbol(unsigned int)+223>
0x000000000033d384 <elf::object::resolve_pltgot(unsigned int)+132>
0x000000000033d555 <elf_resolve_pltgot+69>
0x0000000000386aca <???+3697354>
0xffff80007f3c16cf <???+2134644431>

There's no report that the termcap library couldn't be loaded. Why is tgetent() not found?

nyh commented 6 years ago

Earlier I missed the debug message

could not load libtinfo.so.6

Indeed,

$ readelf -a ROOTFS/usr/lib64/erlang/erts-7.0/bin/beam.smp
...
 0x0000000000000001 (NEEDED)             Shared library: [libtinfo.so.6]
...

However, we put in the image, from modules/ncurses and older version of this library,

/usr/lib/libtinfo.so.5: /home/nyh/tmp/osv/modules/ncurses/build/ncurses-5.9/lib/libtinfo.so.5

So the problem is that although we plan to use at runtime ncurses which we build ourselves, from modules/ncurses, we build Erlang with the system's ncurses. We should be consistent and choose one of two options:

  1. Compile Erlang against header files and shared library from ../modules/ncurses - and then, as we already do, put that shared library in the image.
  2. Compile Erlang against the system's terminfo, but then put the library from the system (use "ldd" to find it) in the image, not ../modules/ncurses.