Page MenuHomePhabricator

Windows: undefined references for some evas loaders and savers
Closed, InvalidPublic

Description

i've not compiled the efl for some months and now it fails a bit strangely. undef ref of evas module functions, for some evas loaders or savers.

For example:

cc @src/modules/evas/image_savers/libshared_saver_tiff.dll.rsp
E:/Documents/programmes_x64/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/modules/evas/image_savers/00433fd@@shared_saver_tiff@sha/evas_image_save_tiff.c.obj: in function `evas_image_saver_tiff_init':
E:/Documents/programmes_x64/msys2/home/vtorri/gitroot_64/efl/src/modules/evas/image_savers/tiff/evas_image_save_tiff.c:135: undefined reference to `evas_module_register'
E:/Documents/programmes_x64/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/modules/evas/image_savers/00433fd@@shared_saver_tiff@sha/evas_image_save_tiff.c.obj: in function `evas_image_saver_tiff_shutdown':
E:/Documents/programmes_x64/msys2/home/vtorri/gitroot_64/efl/src/modules/evas/image_savers/tiff/evas_image_save_tiff.c:135: undefined reference to `evas_module_unregister'
collect2.exe: error: ld returned 1 exit status
[1085/3648] Linking target src/modules/evas/image_savers/libshared_saver_webp.dll.
FAILED: src/modules/evas/image_savers/libshared_saver_webp.dll
cc @src/modules/evas/image_savers/libshared_saver_webp.dll.rsp
E:/Documents/programmes_x64/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/modules/evas/image_savers/00433fd@@shared_saver_webp@sha/evas_image_save_webp.c.obj: in function `evas_image_saver_webp_init':
E:/Documents/programmes_x64/msys2/home/vtorri/gitroot_64/efl/src/modules/evas/image_savers/webp/evas_image_save_webp.c:105: undefined reference to `evas_module_register'
E:/Documents/programmes_x64/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/modules/evas/image_savers/00433fd@@shared_saver_webp@sha/evas_image_save_webp.c.obj: in function `save_image_webp':
E:/Documents/programmes_x64/msys2/home/vtorri/gitroot_64/efl/src/modules/evas/image_savers/webp/evas_image_save_webp.c:48: undefined reference to `evas_common_convert_argb_unpremul'
E:/Documents/programmes_x64/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/modules/evas/image_savers/00433fd@@shared_saver_webp@sha/evas_image_save_webp.c.obj: in function `evas_image_saver_webp_shutdown':
E:/Documents/programmes_x64/msys2/home/vtorri/gitroot_64/efl/src/modules/evas/image_savers/webp/evas_image_save_webp.c:105: undefined reference to `evas_module_unregister'
collect2.exe: error: ld returned 1 exit status
vtorri created this task.Jan 13 2020, 9:34 PM
vtorri triaged this task as Showstopper Issues priority.

maybe i have found the problem

first, on Windows, the linker must have the dependencies from the right to the left (fewer to most deps ). Here is libshared_saver_tiff.dll.rsp :

-o src/modules/evas/image_savers/libshared_saver_tiff.dll src/modules/evas/image_savers/00433fd@@shared_saver_tiff@sha/evas_image_save_tiff.c.obj "-LE:/Documents/programmes_x64/msys2/opt/ewpi_64/lib" "-Wl,--allow-shlib-undefined" "-shared" "-Wl,--start-group" "-Wl,--out-implib=src/modules/evas/image_savers/libshared_saver_tiff.dll.a" "-g3" "-ggdb3" "-Og" "-pipe" "src/lib/eina/libeina.dll.a" "src/lib/evil/libevil.dll.a" "src/lib/evas/libevas.dll.a" "src/lib/ecore/libecore.dll.a" "src/lib/eo/libeo.dll.a" "src/lib/efl/libefl.dll.a" "src/lib/ector/libector.dll.a" "src/lib/emile/libemile.dll.a" "src/lib/eet/libeet.dll.a" "src/static_libs/buildsystem/libbuildsystem.a" "-pthread" "-lpsapi" "-lole32" "-lws2_32" "-lsecur32" "-luuid" "-lregex" "-lm" "-lintl" "E:/Documents/programmes_x64/msys2/opt/ewpi_64/lib/libfreetype.dll.a" "E:/Documents/programmes_x64/msys2/opt/ewpi_64/lib/libfontconfig.dll.a" "E:/Documents/programmes_x64/msys2/opt/ewpi_64/lib/libfribidi.dll.a" "E:/Documents/programmes_x64/msys2/opt/ewpi_64/lib/libpixman-1.dll.a" "E:/Documents/programmes_x64/msys2/opt/ewpi_64/lib/libluajit.dll.a" "E:/Documents/programmes_x64/msys2/opt/ewpi_64/lib/libharfbuzz.dll.a" "E:/Documents/programmes_x64/msys2/opt/ewpi_64/lib/libtiff.dll.a" "-lpsapi" "-lole32" "-lws2_32" "-lsecur32" "-luuid" "-lregex" "-lkernel32" "-luser32" "-lgdi32" "-lwinspool" "-lshell32" "-loleaut32" "-lcomdlg32" "-ladvapi32" "-Wl,--end-group"

and, for example, you can see these libs : "src/lib/eina/libeina.dll.a" "src/lib/evil/libevil.dll.a" "src/lib/evas/libevas.dll.a"

the order is wrong.

iirc, the "goal" files, which were used to compile first some libs before some others, have been removed. maybe it's the problem.

Mhm, i do not have a real impact on the order of libs there ... that is the result of some internal windows libs.

Do you know when this stopped working ?

I fixed up our loader modules a while back (a whole bunch were compiled in always as opposed to being modules like they used to be) thus bloating out our runtime deps and dirty pages... so the issue here is not what is being linked to but link ordering if my quick read of the above is right? as @bu5hm4n says - that is one of those details meson itself handles - we provide more abstract sets like "link to these here". we don't determine ordering (well it's not meant to determine ordering - that's kind of the point of meson to not have us worry about every compiler,platform and requirements of ordering of linkage etc.) ?

i used dependency walker which is a tool that parses the PE files (file format used for the DLL) and it reports something very strange : only 2 symbols are exported : fribidi_unicode_version and fribidi_version_info !?!?!? I don't understand, all the evas symbols should be here. There is no problem for other generated dll (ecore, eina, evil, etc...).

I'm completely lost, i see no reason why the evas symbols are not in libevas-1.dll

below are the shots of dependency walker for libevas-1.dll and libecore-1.dll

vtorri closed this task as Invalid.Thu, Jan 23, 10:49 PM

solved (though i still don't understand why it failed) : i unset PKG_CONFIG_PATH and it compiled flawlessly with my script. no problem with latest meson too

i should cross compile it event on Windows, it will be more stable, i think

sorry for the noise

WTF? ... that's just odd. both the dependency walker thing and the pkg config path fixing it.... you definitely had a problem for sure.... but it's been kind of hard to know where to look at fixing it because it's so odd. :(

exactly. it was too odd. was it meson ? ninja ? some EAPI (or other similar macro) stuff ?