[Vm-dev] Compiling Newspeak Cog VM on Ubuntu 12.10 64bit

phil at highoctane.be phil at highoctane.be
Mon Feb 25 18:03:10 UTC 2013


I don't know about that VM but I got the PharoVM run on debian 6 amd64
yesterday.

Some of my findings and apt-gets + ln -s in there:

http://comments.gmane.org/gmane.comp.lang.smalltalk.pharo.devel/75198

Phil

2013/2/25 Eliot Miranda <eliot.miranda at gmail.com>:
>
> Hi Philip,
>
>     yes, those undefined warnings are the things to attack.  Things like
>
>         warning: undefined reference to `xcb_get_file_descriptor'
>         /lib32/libpthread.so.0: warning: undefined reference to
>         `_dl_deallocate_tls at GLIBC_PRIVATE'
>         /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so:
>         warning: undefined reference to `xcb_connect'
>
> I think indicate that both the 32-bit xcb library is wrong or not installed, and perhaps that the 32-bit C library is wrong (_dl_deallocate_tls at GLIBC_PRIVATE).  Unfortunately how to fix this, e.g. by installing the right libraries is not something I can help with; I only have a 32-bit VM to experiment with.
>
> One thing that might get you going is to use vm-display-X11 from my site, e.g. from http://www.mirandabanda.org/files/Cog/VM/VM.r2693/nsvmlinux-13.07.2692.tgz.
>
> By the way, why are you compiling your own VM instead of using one from my site?  Sounds interesting!!
>
> Cheers
> Eliot
>
> On Mon, Feb 25, 2013 at 7:26 AM, Philipp Tessenow <philipp at tessenow.org> wrote:
>>
>> Hi,
>>
>> I am trying to compile the Newspeak Cog VM on Ubuntu (12.10) 64bit, but
>> fate is not on my side ;) I'd higly appreciate any help, so here is my
>> story:
>>
>> The VM seems to compile correctly, but the newly build nsvm binary
>> complains about a missing vm-display-X11 plugin.
>>
>> Using strace, as suggested here
>> (http://forum.world.st/Cannot-load-vm-display-X11-module-after-build-from-latest-SVN-and-VMM-td104726.html)
>> shows, that nsvm actually finds vm-display-X11:
>>
>> <code>
>> ...
>> open("/home/philipp/stud/masterarbeit/build/squeak/nscogbuild/unixbuild/bld/../../../nsvmlinux/lib/nsvm/4.0-/vm-display-X11",
>> O_RDONLY|O_CLOEXEC) = 3
>> ...
>> open("/usr/lib/i386-linux-gnu/libX11.so.6", O_RDONLY|O_CLOEXEC) = 3
>> ...
>> open("/usr/lib/i386-linux-gnu/libxcb.so.1", O_RDONLY|O_CLOEXEC) = 3
>> ...
>> open("/usr/lib/i386-linux-gnu/libXau.so.6", O_RDONLY|O_CLOEXEC) = 3
>> ...
>> open("/usr/lib/i386-linux-gnu/libXdmcp.so.6", O_RDONLY|O_CLOEXEC) = 3
>> read(3,
>> "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240\16\0\0004\0\0\0"..., 512)
>> = 512
>> fstat64(3, {st_mode=S_IFREG|0644, st_size=21888, ...}) = 0
>> mmap2(NULL, 24692, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0)
>> = 0xfffffffff7198000
>> mmap2(0xf719d000, 8192, PROT_READ|PROT_WRITE,
>> MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4) = 0xfffffffff719d000
>> close(3)                                = 0
>> mprotect(0xf719d000, 4096, PROT_READ)   = 0
>> mprotect(0xf71a1000, 4096, PROT_READ)   = 0
>> mprotect(0xf71c3000, 4096, PROT_READ)   = 0
>> mprotect(0xf72f7000, 4096, PROT_READ)   = 0
>> munmap(0xf72fb000, 108384)              = 0
>> munmap(0xf71c5000, 1268568)             = 0
>> munmap(0xf71a3000, 135468)              = 0
>> munmap(0xf719f000, 12424)               = 0
>> munmap(0xf7198000, 24692)               = 0
>> stat64("/home/philipp/stud/masterarbeit/build/squeak/nscogbuild/unixbuild/bld/../../../nsvmlinux/lib/nsvm/4.0-/vm-display-X11.so",
>> 0xffe7562c) = -1 ENOENT (No such file or dir
>> ectory)
>> ...
>> </code>
>>
>> Unfortunately, after finding vm-display-X11 and loading some additional
>> libraries nsvm aborts and continues searching for other vm-disply-X11
>> plugins elsewhere.
>>
>> ldd gives the following output (which seems to be OK for me):
>> <code>
>> ldd
>> /home/philipp/stud/masterarbeit/build/squeak/nsvmlinux/lib/nsvm/4.0-//vm-display-X11
>>         linux-gate.so.1 =>  (0xf77d0000)
>>         libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf776d000)
>>         libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xf7637000)
>>         libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf748c000)
>>         /lib/ld-linux.so.2 (0xf77d1000)
>>         libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xf746a000)
>>         libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7465000)
>>         libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xf7461000)
>>         libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xf745a000)
>> </code>
>>
>> Reading the unixbuild/HowToBuild file I found the following:
>> <cite>
>> Testing an external plugin has completely linked
>> -------------------------------
>> You may find that an external plugin compiles and links but does not load.
>> This is usually because it contans undefined symbols.  To find undefined
>> symbols, remake the plugin, capturing the link step and then supply
>>         -Wl,--warn-unresolved-symbols -Wl,--no-allow-shlib-undefined
>> when manually repeating the link command
>> </cite>
>>
>> So I tried to link vm-display-X11 again with warnings enabled:
>>
>> <code>
>> gcc -m32 -shared  sqUnixX11.lo sqUnixMozilla.lo  -ldl -lpthread -lm
>> -lnsl -lX11 -lxcb -lpthread -lc -L/usr/lib32
>> -Wl,--warn-unresolved-symbols -Wl,--no-allow-shlib-undefined -Wl,-soname
>> -Wl,vm-display-X11 -o .libs/vm-display-X11
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so:
>> warning: undefined reference to `xcb_get_file_descriptor'
>> /lib32/libpthread.so.0: warning: undefined reference to
>> `_dl_deallocate_tls at GLIBC_PRIVATE'
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so:
>> warning: undefined reference to `xcb_connect'
>> /lib32/libc.so.6: warning: undefined reference to `_dl_argv at GLIBC_PRIVATE'
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so:
>> warning: undefined reference to `xcb_generate_id'
>> /lib32/libpthread.so.0: warning: undefined reference to
>> `_dl_allocate_tls at GLIBC_PRIVATE'
>> /lib32/libpthread.so.0: warning: undefined reference to
>> `_dl_get_tls_static_info at GLIBC_PRIVATE'
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so:
>> warning: undefined reference to `xcb_connect_to_display_with_auth_info'
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so:
>> warning: undefined reference to `xcb_writev'
>> /lib32/libpthread.so.0: warning: undefined reference to
>> `__libc_stack_end at GLIBC_2.1'
>> /lib32/libc.so.6: warning: undefined reference to
>> `__libc_enable_secure at GLIBC_PRIVATE'
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so:
>> warning: undefined reference to `dlsym at GLIBC_2.0'
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so:
>> warning: undefined reference to `dlopen at GLIBC_2.1'
>> /lib32/libpthread.so.0: warning: undefined reference to
>> `_dl_make_stack_executable at GLIBC_PRIVATE'
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so:
>> warning: undefined reference to `xcb_wait_for_reply'
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so:
>> warning: undefined reference to `xcb_poll_for_event'
>> /lib32/libpthread.so.0: warning: undefined reference to
>> `_dl_allocate_tls_init at GLIBC_PRIVATE'
>> /lib32/libpthread.so.0: warning: undefined reference to
>> `_rtld_global at GLIBC_PRIVATE'
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so:
>> warning: undefined reference to `xcb_get_maximum_request_length'
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so:
>> warning: undefined reference to `xcb_poll_for_reply'
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so:
>> warning: undefined reference to `xcb_take_socket'
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so:
>> warning: undefined reference to `xcb_wait_for_event'
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so:
>> warning: undefined reference to `xcb_disconnect'
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so:
>> warning: undefined reference to `xcb_connection_has_error'
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so:
>> warning: undefined reference to `xcb_get_setup'
>> /lib32/libpthread.so.0: warning: undefined reference to
>> `___tls_get_addr at GLIBC_2.3'
>> /lib32/libpthread.so.0: warning: undefined reference to
>> `_rtld_global_ro at GLIBC_PRIVATE'
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so:
>> warning: undefined reference to `xcb_parse_display'
>> </code>
>>
>> That is a lot of warnings. For my unexperienced eyes this looks like
>> libX11.so cannot find xcb, albeit I installed every x11/xcb library I
>> can think of (to name them: libx11-xcb-dev:i386, libx11-xcb1:i386,
>> libx11-6:i386, libx11-dev:i386, xcb-proto:i386, xcb:i386, libxcb1:i386,
>> libxcb1-dev:i386).
>>
>> I also tried the above steps on a Ubuntu 12.10 32bit VM with similar
>> results. Am I missing something? Do I need a special setup to compile a
>> CogVM? Any other ideas?
>>
>> Thanks,
>> Philipp
>
>
>
> --
> best,
> Eliot
>


More information about the Vm-dev mailing list