Page MenuHomePhabricator

build-error with --with-opengl=es --enable-egl
Closed, ResolvedPublic

Description

Hello,

building with --with-opengl=es --enable-egl fails:

libtool: link: gcc -shared  -fPIC -DPIC  modules/evas/engines/gl_generic/.libs/modules_evas_engines_gl_generic_module_la-evas_engine.o modules/evas/engines/gl_generic/.libs/modules_evas_engines_gl_generic_module_la-evas_ector_gl_buffer.o modules/evas/engines/gl_generic/.libs/modules_evas_engines_gl_generic_module_la-evas_ector_gl_image_buffer.o modules/evas/engines/gl_generic/filters/.libs/modules_evas_engines_gl_generic_module_la-gl_filter_blend.o modules/evas/engines/gl_generic/filters/.libs/modules_evas_engines_gl_generic_module_la-gl_filter_blur.o modules/evas/engines/gl_generic/filters/.libs/modules_evas_engines_gl_generic_module_la-gl_filter_curve.o modules/evas/engines/gl_generic/filters/.libs/modules_evas_engines_gl_generic_module_la-gl_filter_displace.o modules/evas/engines/gl_generic/filters/.libs/modules_evas_engines_gl_generic_module_la-gl_filter_fill.o modules/evas/engines/gl_generic/filters/.libs/modules_evas_engines_gl_generic_module_la-gl_filter_mask.o  -Wl,--whole-archive modules/evas/engines/gl_common/.libs/libevas_engine_gl_common.a -Wl,--no-whole-archive  -Wl,-rpath -Wl,/tmp/EFL/efl-1.20.4/src/lib/evas/.libs -Wl,-rpath -Wl,/tmp/EFL/efl-1.20.4/src/lib/ecore/.libs -Wl,-rpath -Wl,/tmp/EFL/efl-1.20.4/src/lib/ector/.libs -Wl,-rpath -Wl,/tmp/EFL/efl-1.20.4/src/lib/efl/.libs -Wl,-rpath -Wl,/tmp/EFL/efl-1.20.4/src/lib/eet/.libs -Wl,-rpath -Wl,/tmp/EFL/efl-1.20.4/src/lib/emile/.libs -Wl,-rpath -Wl,/tmp/EFL/efl-1.20.4/src/lib/eo/.libs -Wl,-rpath -Wl,/tmp/EFL/efl-1.20.4/src/lib/eina/.libs /tmp/EFL/efl-1.20.4/src/lib/evas/.libs/libevas.so /tmp/EFL/efl-1.20.4/src/lib/ecore/.libs/libecore.so -lgthread-2.0 -lglib-2.0 /tmp/EFL/efl-1.20.4/src/lib/ector/.libs/libector.so /tmp/EFL/efl-1.20.4/src/lib/efl/.libs/libefl.so /tmp/EFL/efl-1.20.4/src/lib/eet/.libs/libeet.so /tmp/EFL/efl-1.20.4/src/lib/emile/.libs/libemile.so -lgnutls -llz4 -lgcrypt /tmp/EFL/efl-1.20.4/src/lib/eo/.libs/libeo.so /tmp/EFL/efl-1.20.4/src/lib/eina/.libs/libeina.so -lsystemd -lEGL -lpng16 -lz -lharfbuzz -lfribidi -lfontconfig /usr/lib/x86_64-linux-gnu/libfreetype.so -lluajit-5.1 lib/ecore/.libs/libecore.so lib/ector/.libs/libector.so lib/emile/.libs/libemile.so lib/efl/.libs/libefl.so lib/eina/.libs/libeina.so lib/eet/.libs/libeet.so lib/eo/.libs/libeo.so -lpthread -ljpeg -ldl -lm lib/evas/.libs/libevas.so -lrt  -g -O2 -fstack-protector-strong -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,-z -Wl,defs -Wl,--as-needed -Wl,--gc-sections -Wl,--as-needed -Wl,--no-copy-dt-needed-entries   -pthread -Wl,-soname -Wl,module.so -o modules/evas/engines/gl_generic/.libs/module.so
modules/evas/engines/gl_generic/.libs/modules_evas_engines_gl_generic_module_la-evas_engine.o: In function `eng_gl_surface_read_pixels':
./src/modules/evas/engines/gl_generic/evas_engine.c:1773: undefined reference to `glGetIntegerv'
./src/modules/evas/engines/gl_generic/evas_engine.c:1776: undefined reference to `glPixelStorei'
./src/modules/evas/engines/gl_generic/evas_engine.c:1780: undefined reference to `glGetIntegerv'
./src/modules/evas/engines/gl_generic/evas_engine.c:1794: undefined reference to `glReadPixels'
./src/modules/evas/engines/gl_generic/evas_engine.c:1785: undefined reference to `glReadPixels'
./src/modules/evas/engines/gl_generic/evas_engine.c:1786: undefined reference to `glGetError'
modules/evas/engines/gl_generic/.libs/modules_evas_engines_gl_generic_module_la-evas_engine.o: In function `_native_bind_cb':
./src/modules/evas/engines/gl_generic/evas_engine.c:323: undefined reference to `glBindTexture'
[ more errors like these follow ]
collect2: error: ld returned 1 exit status
Makefile:24982: recipe for target 'modules/evas/engines/gl_generic/module.la' failed
make[6]: *** [modules/evas/engines/gl_generic/module.la] Error 1

See https://buildd.debian.org/status/fetch.php?pkg=efl&arch=armhf&ver=1.20.4-1&stamp=1507200241&raw=0 for a complete buildlog. This is armhf, but the error also shows up on amd64.

ametzler created this task.Oct 7 2017, 7:04 AM
ProhtMeyhet closed this task as Invalid.Oct 8 2017, 6:42 AM
ProhtMeyhet added a subscriber: ProhtMeyhet.

somewhere you are missing some gl headers. i've given up on debian and on building c code, so i can't really help you there. but shouldn't it be -legl (lower case) instead of -lEGL for gcc ?

you might want to check the debian official package for clues.

glGetIntegerv
glPixelStorei
glGetIntegerv
glReadPixels
glGetError
glBindTexture

^^ these missing functions are all from opengl.

These *are* Debian official packages. The link is to the official buildlogs.

ametzler reopened this task as Open.Oct 8 2017, 11:24 AM

... also, the error message is not about missing headers but a missing library. I think -lGLESv2 is missing.

I am not 100% sure why, but configure.ac around line 2619 unconditionally resets evas_engine_gl_common_libs

# OpenGL common
evas_engine_gl_common_cflags=""
if test "x${have_egl}" = "xyes"; then
   evas_engine_gl_common_libs="-lEGL"
else
   evas_engine_gl_common_libs="-lGL"
fi

which overwrites the results of line 2582

EVAS_CHECK_ENGINE([gl-xlib], [${want_x11_xlib_opengl}], [no], [OpenGL XLib])

that had set evas_engine_gl_common_libs=-lGLESv2 -lm -pthread

Indeed stopping resetting evas_engine_gl_common_libs by changing 2622 lets the build succeed.

-   evas_engine_gl_common_libs="-lEGL"
+   evas_engine_gl_common_libs="-lEGL ${evas_engine_gl_common_libs}"

Reopening, since it was not correctly diagnosed.

ProhtMeyhet assigned this task to raster.Oct 8 2017, 2:48 PM
ProhtMeyhet added subscribers: zmike, jpeg, stephenmhouston.

These *are* Debian official packages. The link is to the official buildlogs.

i am sorry, but i've taken you tried to build your own package inside your own repository. debian is a mess, so i saw here libevas 1.20.4 was build on everything except arm64 correctly.

... also, the error message is not about missing headers but a missing library.

it breaks in the compiler, which looks for headers, but yes headers are part of a library.

Reopening, since it was not correctly diagnosed.

correct. now let's hear the professionals.

well on arch everything works. gles or full opengl. i've verified. no compile errors here....

for whatever reason the linking is later gotten right somewhere... but i've added more linking into the configure.ac that should solve this. can you verify and re-open if it's still an issue?

Works for me, thank you.