diablodiab / scummvm

ScummVM main repository
https://www.scummvm.org
GNU General Public License v2.0
6 stars 0 forks source link

Undefined symbol for the linux 86-64 nightly. #10

Closed i30817 closed 2 years ago

i30817 commented 2 years ago

Anything i need to install? It isn't clear from the error if it's possible to fix that way.

i3@Splenir:~/.config/retroarch/cores$ ldd -r -v scummvm_libretro.so
    linux-vdso.so.1 (0x00007ffee49fc000)
    libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fea3ef72000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fea3ee23000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fea3ee08000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fea3ec16000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fea44ebd000)
undefined symbol: _ZN5Audio9MixerImplC1Ej   (./scummvm_libretro.so)

    Version information:
    ./scummvm_libretro.so:
        libgcc_s.so.1 (GCC_3.0) => /lib/x86_64-linux-gnu/libgcc_s.so.1
        libm.so.6 (GLIBC_2.27) => /lib/x86_64-linux-gnu/libm.so.6
        libm.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libm.so.6
        libstdc++.so.6 (CXXABI_1.3.8) => /lib/x86_64-linux-gnu/libstdc++.so.6
        libstdc++.so.6 (GLIBCXX_3.4.15) => /lib/x86_64-linux-gnu/libstdc++.so.6
        libstdc++.so.6 (CXXABI_1.3) => /lib/x86_64-linux-gnu/libstdc++.so.6
        libstdc++.so.6 (GLIBCXX_3.4) => /lib/x86_64-linux-gnu/libstdc++.so.6
        libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
        libc.so.6 (GLIBC_2.7) => /lib/x86_64-linux-gnu/libc.so.6
        libc.so.6 (GLIBC_2.3) => /lib/x86_64-linux-gnu/libc.so.6
        libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
    /lib/x86_64-linux-gnu/libstdc++.so.6:
        libm.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libm.so.6
        ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
        libgcc_s.so.1 (GCC_4.2.0) => /lib/x86_64-linux-gnu/libgcc_s.so.1
        libgcc_s.so.1 (GCC_3.4) => /lib/x86_64-linux-gnu/libgcc_s.so.1
        libgcc_s.so.1 (GCC_3.3) => /lib/x86_64-linux-gnu/libgcc_s.so.1
        libgcc_s.so.1 (GCC_3.0) => /lib/x86_64-linux-gnu/libgcc_s.so.1
        libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
        libc.so.6 (GLIBC_2.6) => /lib/x86_64-linux-gnu/libc.so.6
        libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6
        libc.so.6 (GLIBC_2.18) => /lib/x86_64-linux-gnu/libc.so.6
        libc.so.6 (GLIBC_2.16) => /lib/x86_64-linux-gnu/libc.so.6
        libc.so.6 (GLIBC_2.3) => /lib/x86_64-linux-gnu/libc.so.6
        libc.so.6 (GLIBC_2.3.4) => /lib/x86_64-linux-gnu/libc.so.6
        libc.so.6 (GLIBC_2.17) => /lib/x86_64-linux-gnu/libc.so.6
        libc.so.6 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libc.so.6
        libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
    /lib/x86_64-linux-gnu/libm.so.6:
        ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
        libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6
        libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
        libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6
    /lib/x86_64-linux-gnu/libgcc_s.so.1:
        libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
        libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
    /lib/x86_64-linux-gnu/libc.so.6:
        ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
        ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2

although ldd only showed one, this command is supposed to show undefined symbols too, so here it is:

i3@Splenir:~/.config/retroarch/cores$ nm -gDC scummvm_libretro.so 
                 U abort
                 U access
                 U acos
                 U acosf
                 U asin
                 U asinf
                 U __assert_fail
                 U atan
                 U atan2
                 U atan2f
                 U atanf
                 U calloc
                 U clearerr
                 U closedir
                 U cos
                 U cosf
                 U cosh
                 U coshf
                 U __ctype_toupper_loc
                 U __cxa_atexit
                 w __cxa_finalize
                 U __cxa_guard_abort
                 U __cxa_guard_acquire
                 U __cxa_guard_release
                 U __cxa_pure_virtual
                 U __cxa_throw_bad_array_new_length
                 U difftime
                 U dirname
                 U __dynamic_cast
                 U __errno_location
                 U exit
                 U exp
                 U expf
                 U fclose
                 U feof
                 U ferror
                 U fflush
                 U fgetc
                 U fgets
                 U fileno
                 U floor
                 U fmax
                 U fmaxf
                 U fminf
                 U fmod
                 U fmodf
                 U fopen
                 U fprintf
                 U fputc
                 U fputs
                 U fread
                 U free
                 U frexp
                 U frexpf
                 U fseek
                 U fseeko
                 U ftell
                 U ftello
                 U fwrite
                 U __fxstat
                 U getc
                 U getcwd
                 U getenv
                 U gettimeofday
                 w __gmon_start__
                 U gmtime
                 U __gxx_personality_v0
                 U isalnum
                 U isalpha
                 U iscntrl
                 U isgraph
                 U islower
                 U __isoc99_sscanf
                 U isprint
                 U ispunct
                 U isspace
                 U isupper
                 U isxdigit
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 U ldexp
                 U ldexpf
                 U localtime
                 U log
                 U log10
                 U log10f
                 U logf
                 U longjmp
                 U lrintf
                 U lround
                 U lroundf
                 U malloc
                 U memchr
                 U memcmp
                 U memcpy
                 U memmove
                 U memset
                 U mkdir
                 U mktime
                 U modf
                 U nanosleep
                 U nearbyint
                 U opendir
                 U perror
                 U pow
                 U powf
                 U printf
                 U putchar
                 U puts
                 U qsort
                 U rand
                 U readdir
                 U realloc
                 U remove
                 U rename
0000000000948c00 T retro_api_version
00000000009495b0 T retro_cheat_reset
00000000009495c0 T retro_cheat_set
00000000037e3de0 T retro_closedir
0000000000948ca0 T retro_deinit
00000000037e3d60 T retro_dirent_error
00000000037e3d90 T retro_dirent_get_name
00000000037e3da0 T retro_dirent_is_dir
0000000000949550 T retro_get_memory_data
0000000000949560 T retro_get_memory_size
00000000009495d0 T retro_get_region
0000000000948c50 T retro_get_system_av_info
0000000000948c10 T retro_get_system_info
0000000000948c70 T retro_init
0000000000948e40 T retro_load_game
00000000009493b0 T retro_load_game_special
00000000037e3d00 T retro_opendir
00000000037e3d70 T retro_readdir
0000000000949570 T retro_reset
00000000009493c0 T retro_run
0000000000949590 T retro_serialize
0000000000949580 T retro_serialize_size
0000000000948700 T retro_set_audio_sample
0000000000948710 T retro_set_audio_sample_batch
0000000000948dd0 T retro_set_controller_port_device
0000000000948740 T retro_set_environment
0000000000948720 T retro_set_input_poll
0000000000948730 T retro_set_input_state
00000000009486f0 T retro_set_video_refresh
00000000009494f0 T retro_unload_game
00000000009495a0 T retro_unserialize
                 U rewind
                 U round
                 U roundf
                 U _setjmp
                 U setvbuf
                 U sin
                 U sincos
                 U sincosf
                 U sinf
                 U sinh
                 U sinhf
                 U snprintf
                 U sprintf
                 U sqrt
                 U sqrtf
                 U srand
                 U sscanf
                 U stderr
                 U stdin
                 U stdout
                 U stpcpy
                 U strcat
                 U strchr
                 U strcmp
                 U strcoll
                 U strcpy
                 U strcspn
                 U strdup
                 U strerror
                 U strftime
                 U strlen
                 U strncat
                 U strncmp
                 U strncpy
                 U strpbrk
                 U strrchr
                 U strspn
                 U strstr
                 U strtod
                 U strtok
                 U strtol
                 U strtoll
                 U strtoul
                 U tan
                 U tanf
                 U tanh
                 U tanhf
                 U time
                 U tolower
                 U toupper
                 U truncf
                 U _Unwind_Resume
                 U vfprintf
                 U vsnprintf
                 U vsprintf
                 U __xstat
                 U operator delete[](void*)
                 U operator delete(void*)
                 U Audio::MixerImpl::MixerImpl(unsigned int)
                 U operator new[](unsigned long)
                 U operator new[](unsigned long, std::nothrow_t const&)
                 U std::__basic_file<char>::is_open() const
                 U std::istream::read(char*, long)
                 U std::istream::seekg(long, std::_Ios_Seekdir)
                 U std::istream::seekg(std::fpos<__mbstate_t>)
                 U std::istream::tellg()
                 U std::basic_filebuf<char, std::char_traits<char> >::open(char const*, std::_Ios_Openmode)
                 U std::basic_filebuf<char, std::char_traits<char> >::close()
                 U std::basic_filebuf<char, std::char_traits<char> >::basic_filebuf()
                 U std::basic_filebuf<char, std::char_traits<char> >::~basic_filebuf()
                 U std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)
                 U std::__detail::_List_node_base::_M_unhook()
                 U std::ios_base::ios_base()
                 U std::ios_base::~ios_base()
                 U std::basic_ios<char, std::char_traits<char> >::init(std::basic_streambuf<char, std::char_traits<char> >*)
                 U std::basic_ios<char, std::char_traits<char> >::clear(std::_Ios_Iostate)
                 U operator new(unsigned long)
                 U std::nothrow
                 U std::terminate()
                 U VTT for std::basic_ifstream<char, std::char_traits<char> >
                 U vtable for __cxxabiv1::__class_type_info
                 U vtable for __cxxabiv1::__si_class_type_info
                 U vtable for __cxxabiv1::__vmi_class_type_info
                 U vtable for std::basic_ifstream<char, std::char_traits<char> >
                 U vtable for std::basic_ios<char, std::char_traits<char> >

Supposedly, _ZN5Audio9MixerImplC1Ej was Audio::MixerImpl::MixerImpl(unsigned int) pre-mangling according to this tool. Whatever. What's more concerning is all the other undefined things, so...

i30817 commented 2 years ago

I think it's the wrong version of gcc installed which pulls in the c++ files? Man...

I have gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)

i30817 commented 2 years ago

This was fixed in the build bot meanwhile (i've been without internet and checked today).

eqikkwkp25-cyber commented 2 years ago

@i30817 Thanks for pointing out this. I am using a GPI Case2 with an RPI CM4 and replaced scummvm_libretro.so core and scummvm files by http://build.bot.nu/nightly/linux/aarch64/latest/scummvm_libretro.so.zip and http://build.bot.nu/assets/system/ScummVM.zip using Lakka nightly for RPI4 but get "undefined symbol". Any hints or solutions?

i30817 commented 2 years ago

My problem was that i was building and didn't made clean both sides (scummvm repository and this subdirectory).

I suspect you should not build scummvm first or at all, just call the make on the make file of backends/platforms/libretro dir, not the make of scummvm itself.

Build artifacts of one get used in the other and the makefiles have different defines or mangling (or something like that) and it causes 'undefined symbol' when the linker tries to reused a object file of scummvm proper in the core version.

Your problem might be different because you're building in another platform though.

Also remember to make the scummvm assets and place them in the core system subdirectory ($HOME/.config/retroarch/system/ is the extraction dir and the zip contains a 'scummvm' directory at the top level). I do something like make && ../aux-data/bundle_aux_data.bash && 7z x -y -o$HOME/.config/retroarch/system/ ../aux-data/scummvm.zip && cp scummvm_libretro.so ~/.config/retroarch/cores/ again from the libretro core build dir.

Your problem is likely unrelated to this or the buildbot is making the same mistake of reusing build artifacts somehow. It's possible the symbol might be a library that the core expects but lakka hasn't. The buildbot also has the scummvm data/assets as a zip so if you're not building try first to unzip it on the right dir (not sure what it is in lakka but for me it's $HOME/.config/retroarch/system/ with the subdir 'scummvm' coming from the zip itself, as mentioned.

i30817 commented 2 years ago

I'd do what i did first and call ldd -r -v scummvm_libretro.so and try to interpret the 'missing symbol'. In my case it was obvious it was coming from the scummvm code itself, which meant it was a makefile problem, which lead me to realize i'd called 'make' on the main scummvm code first, which lead me to the solution.

In your case it might show which .so is missing in lakka.

i30817 commented 2 years ago

Also @eqikkwkp25-cyber if you're going to build the core yourself, you should probably be using the libretro-backend repository instead of this one, that's the one i'm using (follow the readme).