Page MenuHomePhabricator

Impossible to build EFL on FreeBSD
Closed, ResolvedPublic

Description

Git version of EFL cannot be built on FreeBSD 11.2 (neither with autotools nor with meson).

../src/lib/ecore/efl_core_proc_env.c:34:8: error: use of undeclared identifier 'environ'
   if (environ)

Adding the declaration of 'environ' unblocks the build:

extern char **environ;
Peter2121 triaged this task as High priority.
raster assigned this task to bu5hm4n.Feb 27 2019, 12:29 AM
raster added a subscriber: raster.

likely related to @bu5hm4n 's changes

Please test the attached revision.

Nothing changed adding the header.

This isn't fixin anything.

Seems the environ symbol is found in /usr/lib/crt1.o.

I'm not sure if disabling errors upon unresolved-symbols would fix this?

netstar raised the priority of this task from High to Showstopper Issues.Feb 28 2019, 7:16 AM
netstar edited projects, added efl (efl-1.22); removed E on FreeBSD.
netstar added a subscriber: q66.

So libc doesn't have environ symbol.

Tried LDFLAGS=--warn-unresolved-symbols suggestion from @q66.

vtorri, I don't think it's related as in the bug they discuss a runtime problem, but we have a build time problem. I've just declared the variable as 'extern' and the build passed, E works correctly with the compiled version of EFL (I'm using it since 2 days). BUT, I don't know if somewhere this function was used, so MAYBE we are concerned by 220103 bug too.

netstar, why can't we just declare the variable in case of FreeBSD build?

raster added a comment.Mar 1 2019, 2:36 AM

bbdb2e5c23139d96b6fa57633f9a73e85ea6e7d6 i hope should fix this. i also found a few other loose ends regarding environ related things and fixed those too. my fbsd vm tho is having other issues (meson cant find libintl.h and it isn't respecting CFLAGS when looking for libintl.h ...:() so my fix above is a guess, but a decent one based on the fact that efl_core_proc_env.c was indeed missing the extern char **environ declaration and uour comment above that it works.

[453/3977] Linking target src/lib/ecore/libecore.so.1.22.0.

FAILED: src/lib/ecore/libecore.so.1.22.0

cc  -o src/lib/ecore/libecore.so.1.22.0 'src/lib/ecore/bbd70c4@@ecore@sha/efl_app.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecor
e_alloc.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_anim.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_app.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_events.c.o' 'src/l
ib/ecore/bbd70c4@@ecore@sha/ecore_getopt.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_glib.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_idle_enterer.c.o' 'src/lib/ecore/b
bd70c4@@ecore@sha/ecore_idle_exiter.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_idler.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_job.c.o' 'src/lib/ecore/bbd70c4@@ecore
@sha/ecore_main.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_event_message.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_event_message_handler.c.o' 'src/lib/ecore/bbd70c4@
@ecore@sha/efl_loop.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_loop_consumer.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_loop_fd.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl
_loop_handler.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_loop_message.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_loop_message_future.c.o' 'src/lib/ecore/bbd70c4@@ecore@sh
a/efl_loop_message_handler.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_loop_message_future_handler.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_task.c.o' 'src/lib/ecore/bbd7
0c4@@ecore@sha/efl_io_closer_fd.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_io_positioner_fd.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_io_reader_fd.c.o' 'src/lib/ecore/bb
d70c4@@ecore@sha/efl_io_sizer_fd.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_io_writer_fd.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_io_stdin.c.o' 'src/lib/ecore/bbd70c4@@
ecore@sha/efl_io_stdout.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_io_stderr.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_io_file.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl
_io_copier.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_io_buffered_stream.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_loop_model.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_
generic_model.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_container_model.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_composite_model.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha
/efl_boolean_model.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_select_model.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_model_accessor_view.c.o' 'src/lib/ecore/bbd70c4@@eco
re@sha/efl_view_model.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_linear_interpolator.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_accelerate_interpolator.c.o' 'src/lib/ecor
e/bbd70c4@@ecore@sha/efl_decelerate_interpolator.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_sinusoidal_interpolator.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_divisor_int
erpolator.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_bounce_interpolator.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_spring_interpolator.c.o' 'src/lib/ecore/bbd70c4@@ecore
@sha/efl_cubic_bezier_interpolator.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_main_timechanges.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_pipe.c.o' 'src/lib/ecore/bbd
70c4@@ecore@sha/ecore_poller.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_time.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_timer.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/e
core_thread.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_throttle.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_exe.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_exe.c.o' 'sr
c/lib/ecore/bbd70c4@@ecore@sha/efl_thread.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_appthread.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_threadio.c.o' 'src/lib/ecore/bbd
70c4@@ecore@sha/efl_core_env.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_core_proc_env.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_core_command_line.c.o' 'src/lib/ecore/bbd
70c4@@ecore@sha/ecore_signal.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_exe_posix.c.o' -Wl,--no-undefined -Wl,--as-needed -Wl,-O1 -shared -fPIC -Wl,--start-group -Wl,-s
oname,libecore.so.1 -O2 -ffast-math -march=native -g -ggdb3 src/lib/eina/libeina.so.1.22.0 src/lib/eo/libeo.so.1.22.0 src/lib/efl/libefl.so.1.22.0 src/static_libs/buildsy
stem/libbuildsystem.a -ldl /usr/local/lib/libunwind-generic.so /usr/local/lib/libunwind.so -ldl -ldl -lm -ldl -lintl /usr/local/lib/libglib-2.0.so /usr/local/lib/libintl.
so /usr/local/lib/libgthread-2.0.so -pthread /usr/local/lib/libgstreamer-1.0.so /usr/local/lib/libgobject-2.0.so -ldl -ldl -Wl,--end-group '-Wl,-rpath,$ORIGIN/../eina:$OR
IGIN/../eo:$ORIGIN/../efl:$ORIGIN/../../static_libs/buildsystem' -Wl,-rpath-link,/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build/src/lib/eina:/usr/home/peter/Prog
ramming/Prog-EFL/test-efl/efl/build/src/lib/eo:/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build/src/lib/efl:/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build
/src/static_libs/buildsystem
src/lib/ecore/bbd70c4@@ecore@sha/efl_exe.c.o: In function `_efl_exe_efl_task_run':
/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build/../src/lib/ecore/efl_exe.c:582: undefined reference to `environ'
src/lib/ecore/bbd70c4@@ecore@sha/efl_core_proc_env.c.o: In function `_efl_core_proc_env_efl_core_env_clear':
/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build/../src/lib/ecore/efl_core_proc_env.c:104: undefined reference to `environ'
src/lib/ecore/bbd70c4@@ecore@sha/efl_core_proc_env.c.o: In function `_sync':
/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build/../src/lib/ecore/efl_core_proc_env.c:36: undefined reference to `environ'
cc: error: linker command failed with exit code 1 (use -v to see invocation)

Still does not build.

raster added a comment.Mar 1 2019, 8:21 AM

are you building with meson there? looks like it.

this seems to be a meson + bsd issue. meson insists on adding -Wl,-no-undefined by default. this forces compilation to fail when there are undefined symbols for shared libraries. it seems that bsd has some incompatibility with this as the environ symbol only comes from crt1.o or something like that when a BINARY is linked together.

this means efl works - it finds the same environ symbol in the calling binary at runtime, BUT the compilation fails because this symbol is unresolved at link time. it's a meson issue it seems but i found a workaround. use - -Dbl_undef=false as a config option to meson and it disables meson's insistence on the no-undefined option. this is something for meson to sort out i think in its bsd support but the way it works out of the box is incompatible with shared libs that access environ and meson as the compilation infra.

Sorry, the workaround does not work.
I deleted build directory and reconfigured meson with the proposed option.
The build still fails.

[453/3977] Linking target src/lib/ecore/libecore.so.1.22.0.

FAILED: src/lib/ecore/libecore.so.1.22.0

cc  -o src/lib/ecore/libecore.so.1.22.0 'src/lib/ecore/bbd70c4@@ecore@sha/efl_app.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/eco
re_alloc.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_anim.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_app.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_events.c.o' 'src
/lib/ecore/bbd70c4@@ecore@sha/ecore_getopt.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_glib.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_idle_enterer.c.o' 'src/lib/ecor
e/bbd70c4@@ecore@sha/ecore_idle_exiter.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_idler.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_job.c.o' 'src/lib/ecore/bbd70c4@@e
core@sha/ecore_main.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_event_message.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_event_message_handler.c.o' 'src/lib/ecore/bbd
70c4@@ecore@sha/efl_loop.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_loop_consumer.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_loop_fd.c.o' 'src/lib/ecore/bbd70c4@@ecore@s
ha/efl_loop_handler.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_loop_message.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_loop_message_future.c.o' 'src/lib/ecore/bbd70c4@@e
core@sha/efl_loop_message_handler.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_loop_message_future_handler.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_task.c.o' 'src/lib/ec
ore/bbd70c4@@ecore@sha/efl_io_closer_fd.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_io_positioner_fd.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_io_reader_fd.c.o' 'src/lib
/ecore/bbd70c4@@ecore@sha/efl_io_sizer_fd.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_io_writer_fd.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_io_stdin.c.o' 'src/lib/ecore
/bbd70c4@@ecore@sha/efl_io_stdout.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_io_stderr.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_io_file.c.o' 'src/lib/ecore/bbd70c4@@ec
ore@sha/efl_io_copier.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_io_buffered_stream.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_loop_model.c.o' 'src/lib/ecore/bbd70c4@@ec
ore@sha/efl_generic_model.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_container_model.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_composite_model.c.o' 'src/lib/ecore/bbd70
c4@@ecore@sha/efl_boolean_model.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_select_model.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_model_accessor_view.c.o' 'src/lib/ecor
e/bbd70c4@@ecore@sha/efl_view_model.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_linear_interpolator.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_accelerate_interpolator.c.o
' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_decelerate_interpolator.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_sinusoidal_interpolator.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha
/efl_divisor_interpolator.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_bounce_interpolator.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_spring_interpolator.c.o' 'src/lib/eco
re/bbd70c4@@ecore@sha/efl_cubic_bezier_interpolator.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_main_timechanges.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_pipe.c.o'
'src/lib/ecore/bbd70c4@@ecore@sha/ecore_poller.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_time.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_timer.c.o' 'src/lib/ecore/b
bd70c4@@ecore@sha/ecore_thread.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_throttle.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_exe.c.o' 'src/lib/ecore/bbd70c4@@ecore@
sha/efl_exe.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_thread.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_appthread.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_threadio.c.
o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_core_env.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_core_proc_env.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/efl_core_command_line.c
.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_signal.c.o' 'src/lib/ecore/bbd70c4@@ecore@sha/ecore_exe_posix.c.o' -Wl,--no-undefined -Wl,--as-needed -Wl,-O1 -shared -fPIC -
Wl,--start-group -Wl,-soname,libecore.so.1 -O2 -ffast-math -march=native -g -ggdb3 src/lib/eina/libeina.so.1.22.0 src/lib/eo/libeo.so.1.22.0 src/lib/efl/libefl.so.1.22.0
 src/static_libs/buildsystem/libbuildsystem.a -ldl /usr/local/lib/libunwind-generic.so /usr/local/lib/libunwind.so -ldl -ldl -lm -ldl -lintl /usr/local/lib/libglib-2.0.s
o /usr/local/lib/libintl.so /usr/local/lib/libgthread-2.0.so -pthread /usr/local/lib/libgstreamer-1.0.so /usr/local/lib/libgobject-2.0.so -ldl -ldl -Wl,--end-group '-Wl,
-rpath,$ORIGIN/../eina:$ORIGIN/../eo:$ORIGIN/../efl:$ORIGIN/../../static_libs/buildsystem' -Wl,-rpath-link,/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build/src/li
b/eina:/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build/src/lib/eo:/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build/src/lib/efl:/usr/home/peter/Programming
/Prog-EFL/test-efl/efl/build/src/static_libs/buildsystem



src/lib/ecore/bbd70c4@@ecore@sha/efl_exe.c.o: In function `_efl_exe_efl_task_run':

/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build/../src/lib/ecore/efl_exe.c:582: undefined reference to `environ'

src/lib/ecore/bbd70c4@@ecore@sha/efl_core_proc_env.c.o: In function `_efl_core_proc_env_efl_core_env_clear':

/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build/../src/lib/ecore/efl_core_proc_env.c:104: undefined reference to `environ'

src/lib/ecore/bbd70c4@@ecore@sha/efl_core_proc_env.c.o: In function `_sync':

/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build/../src/lib/ecore/efl_core_proc_env.c:36: undefined reference to `environ'

cc: error: linker command failed with exit code 1 (use -v to see invocation)

I used the following command to configure the build:

meson build -Dxinput22=true  -Dharfbuzz=true -Decore-imf-loaders-disabler=xim,scim,ibus -Dsystemd=false -Deeze=false -Dbl_undef=false

err sorry

-Db_lundef=false
is it
typo.
here is the meson cofigure line i have in my fbsd build script:

-Db_lundef=false \
-Dxinput22=true -Dbuffer=false -Dfb=false -Ddrm=false \
-Dtslib=false -Dharfbuzz=true -Dwl=false -Dnetwork-backend=connman \
-Devas-loaders-disabler= -Dbindings=cxx,luajit -Dbuild-examples=false \
-Decore-imf-loaders-disabler= -Dsystemd=false -Deeze=false"

that worked until freebsd shot itself in the foot. don't get me started (a package update ended up with zsh failing to run - which is my login shell thanks to libdl.so.1 not being found so the packages broke their dependencies, then i tried an upgrade to freebase 12 ... and that ended up with even more freebsd shooting itself in the foot - it ended up with pam errors and sudo not working then now i log in as my user and i end up being root -i can't access my user anymore... pkg has shot itself in the foot too - it thinks pkg is not installed but i say yes to install it and then it still thinks its not installed. i give up. freebsd is so fragile that you just look at it sideways and it shoots itself in the foot :(- long story short - my freebsd vm fucked itself up and i frankly am not in a mood to try install freebsd again after it shot itself in the foot so much so you'll have to trust me that the above worked and got an efl build done - at least until freebsd fell over :))

FAILED: src/bin/efreet/efreet_desktop_cache_create
cc  -o src/bin/efreet/efreet_desktop_cache_create 'src/bin/efreet/d57513e@@efreet_desktop_cache_create@exe/efreet_desktop_cache_create.c.o' -Wl,--as-nee
ed -Wl,-O1 -O2 -ffast-math -march=native -g -ggdb3 -Wl,--start-group src/lib/efreet/libefreet.so.1.22.0 src/lib/eina/libeina.so.1.22.0 src/lib/eo/libeo.
o.1.22.0 src/lib/efl/libefl.so.1.22.0 src/lib/ecore/libecore.so.1.22.0 src/lib/eet/libeet.so.1.22.0 src/lib/emile/libemile.so.1.22.0 src/lib/ecore_file/
ibecore_file.so.1.22.0 -ldl /usr/local/lib/libunwind-generic.so /usr/local/lib/libunwind.so -ldl -ldl -ldl -ldl -ldl -ldl -ldl -ldl -ldl -ldl -Wl,--end-
roup -pthread '-Wl,-rpath,$ORIGIN/../../lib/efreet:$ORIGIN/../../lib/eina:$ORIGIN/../../lib/eo:$ORIGIN/../../lib/efl:$ORIGIN/../../lib/eet:$ORIGIN/../..
lib/emile:$ORIGIN/../../static_libs/lz4:$ORIGIN/../../lib/ecore:$ORIGIN/../../static_libs/buildsystem:$ORIGIN/../../lib/ecore_con:$ORIGIN/../../lib/eldb
s:$ORIGIN/../../static_libs/http-parser:$ORIGIN/../../lib/ecore_file:$ORIGIN/../../lib/ecore_ipc' -Wl,-rpath-link,/usr/home/peter/Programming/Prog-EFL/t
st-efl/efl/build/src/lib/efreet:/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build/src/lib/eina:/usr/home/peter/Programming/Prog-EFL/test-efl/efl/b
ild/src/lib/eo:/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build/src/lib/efl:/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build/src/lib/eet:/
sr/home/peter/Programming/Prog-EFL/test-efl/efl/build/src/lib/emile:/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build/src/static_libs/lz4:/usr/hom
/peter/Programming/Prog-EFL/test-efl/efl/build/src/lib/ecore:/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build/src/static_libs/buildsystem:/usr/ho
e/peter/Programming/Prog-EFL/test-efl/efl/build/src/lib/ecore_con:/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build/src/lib/eldbus:/usr/home/peter
Programming/Prog-EFL/test-efl/efl/build/src/static_libs/http-parser:/usr/home/peter/Programming/Prog-EFL/test-efl/efl/build/src/lib/ecore_file:/usr/home
peter/Programming/Prog-EFL/test-efl/efl/build/src/lib/ecore_ipc
src/lib/ecore_file/libecore_file.so.1.22.0: undefined reference to `inotify_add_watch'
src/lib/ecore_file/libecore_file.so.1.22.0: undefined reference to `inotify_init'
src/lib/ecore_file/libecore_file.so.1.22.0: undefined reference to `inotify_rm_watch'
cc: error: linker command failed with exit code 1 (use -v to see invocation)

Do you have libinotify installed?
config command was:

meson setup --wipe build -Decore-imf-loaders-disabler=xim,scim,ibus -Db_lundef=false \
-Dxinput22=true -Dbuffer=false -Dfb=false -Ddrm=false \
-Dtslib=false -Dharfbuzz=true -Dwl=false -Dnetwork-backend=connman \
-Devas-loaders-disabler= -Dbindings=cxx,luajit -Dbuild-examples=false \
-Dsystemd=false -Deeze=false
raster added a comment.Mar 1 2019, 4:34 PM

i couldn't say anymore - fbsd has since my build shot itself in the face. perhaps i did have some inotify lib installed... but i managed to build efl, e, rage and terminology...

If I remove libinotify I get another error:

[2193/3289] Compiling C object 'src/lib/elementary/f70ca57@@elementary@sha/efl_ui_win.c.o'.
FAILED: src/lib/elementary/f70ca57@@elementary@sha/efl_ui_win.c.o
cc -Isrc/lib/elementary/f70ca57@@elementary@sha -Isrc/lib/elementary -I../src/lib/elementary -I. -I../ -Isrc/lib/elementary/../../.. -I../src/lib/elementary/../../.. -Isrc/lib/eina -I../src/lib/eina -Isrc/lib/eet -I../src/lib/eet -Isrc/lib/emile -I../src/lib/emile -Isrc/lib/efl -I../src/lib/efl -Isrc/lib/eo -I../src/lib/eo -Isrc/lib/evas -I../src/lib/evas -Isrc/lib/evas/common -I../src/lib/evas/common -Isrc/lib/evas/common3d -I../src/lib/evas/common3d -Isrc/lib/evas/common3d/save_load -I../src/lib/evas/common3d/save_load -Isrc/lib/evas/include -I../src/lib/evas/include -Isrc/lib/evas/filters -I../src/lib/evas/filters -Isrc/static_libs/vg_common -I../src/static_libs/vg_common -Isrc/lib/evas/canvas -I../src/lib/evas/canvas -Isrc/modules/evas/engines/buffer -I../src/modules/evas/engines/buffer -Isrc/lib/ecore -I../src/lib/ecore -Isrc/lib/ector -I../src/lib/ector -Isrc/static_libs/buildsystem -I../src/static_libs/buildsystem -Isrc/static_libs/buildsystem/../../lib -I../src/static_libs/buildsystem/../../lib -Isrc/lib/ecore_evas -I../src/lib/ecore_evas -Isrc/lib/ecore_file -I../src/lib/ecore_file -Isrc/lib/ecore_input -I../src/lib/ecore_input -Isrc/lib/ecore_imf -I../src/lib/ecore_imf -Isrc/lib/ecore_con -I../src/lib/ecore_con -Isrc/lib/edje -I../src/lib/edje -Isrc/lib/ephysics -I../src/lib/ephysics -Isrc/lib/eldbus -I../src/lib/eldbus -Isrc/lib/efreet -I../src/lib/efreet -Isrc/lib/ethumb_client -I../src/lib/ethumb_client -Isrc/lib/ethumb -I../src/lib/ethumb -Isrc/lib/elocation -I../src/lib/elocation -Isrc/lib/emotion -I../src/lib/emotion -Isrc/lib/eio -I../src/lib/eio -Isrc/static_libs/atspi/.. -I../src/static_libs/atspi/.. -Isrc/lib/ecore_x -I../src/lib/ecore_x -Isrc/lib/efl/interfaces -Isrc/lib/ector/cairo -Isrc/lib/ector/gl -Isrc/lib/ector/software -Isrc/lib/evas/gesture -I/usr/local/include/freetype2 -I/usr/local/include/fribidi -I/usr/local/include/luajit-2.0 -I/usr/local/include/harfbuzz -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O3 -fvisibility=hidden -Wall -Wunused-parameter -Wsign-compare -Wno-missing-field-initializers -DHAVE_CONFIG_H=1 -D_GNU_SOURCE=1 -DEFL_EO_API_SUPPORT=1 -DEFL_BETA_API_SUPPORT=1 -DEFL_BUILD=1 -DELM_INTERNAL_API_ARGESFSDFEFC=1 -O2 -ffast-math -march=native -g -ggdb3 -fPIC -pthread '-DPACKAGE_DATA_DIR="/usr/local/share/elementary"' -DNEED_RUN_IN_TREE=1 -DELEMENTARY_BUILD=1  -MD -MQ 'src/lib/elementary/f70ca57@@elementary@sha/efl_ui_win.c.o' -MF 'src/lib/elementary/f70ca57@@elementary@sha/efl_ui_win.c.o.d' -o 'src/lib/elementary/f70ca57@@elementary@sha/efl_ui_win.c.o' -c ../src/lib/elementary/efl_ui_win.c
In file included from ../src/lib/elementary/efl_ui_win.c:8974:
src/lib/elementary/efl_ui_win.eo.c:161:9: warning: implicit declaration of function 'eina_value_any_value_ptr_convert' is invalid in C99 [-Wimplicit-function-declaration]
   if (!eina_value_any_value_ptr_convert(&val, &cval))
        ^
src/lib/elementary/efl_ui_win.eo.c:181:11: warning: implicit declaration of function 'eina_value_any_value_ptr_init' is invalid in C99 [-Wimplicit-function-declaration]
   return eina_value_any_value_ptr_init(val);
          ^
src/lib/elementary/efl_ui_win.eo.c:181:11: error: returning 'int' from a function with incompatible result type 'Eina_Value' (aka 'struct _Eina_Value')
   return eina_value_any_value_ptr_init(val);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings and 1 error generated.

There is a thread in FreeBSD forum about porting polybar, they had libinotify problems too...
https://forums.freebsd.org/threads/polybar-i-want-to-give-it-a-try.62494/

netstar closed this task as Resolved.Mar 2 2019, 1:41 PM

FreeBSD doesn't have inotify and if you start building EFL on a desktop machine where you pull in things like GIMP, it'll pull in inotify emulation with an inotify.h header that will break your build.

EFL here builds with these options:

LDFLAGS=-L/usr/local/lib -Wl,--warn-unresolved-symbols
CFLAGS=-I/usr/local/include
meson build -Dsystemd=false -Deeze=false -Dbuild-examples=false

I found another issue with elementary_codegen examples being built. It' s a lot simpler for now to just disable examples with meson/ninja. Will close this ticket. @Peter2121 if you have time making a ticket for the elementary_codegen breackage would be cool (sorry I don't have the time right now).

Peter2121 reopened this task as Open.Mar 2 2019, 2:27 PM

Sorry, netstar, the problem explained in this post is still present, building with your options.
Errors about inotify_* changed to warnings (will it run correctly after build?)

netstar closed this task as Resolved.Mar 3 2019, 2:23 AM

EFL builds here. It's FreeBSD-12.0. Make sure you remove any package that is including inotify headers because the EFL build will see these headers and assume we can use inotify but we cannot use it on FreeBSD. If you have inotify.h in /usr/local/include or elsewhere, remove it, or the package that is pulling in this bogus header.

Try a clean tree, and with only the dependencies installed that EFL depends on. Else you can end up in a situation like above where, for example, GIMP will include some inotify emulation and a header to confuse any build system. FreeBSD does NOT have inotify support (for now).

Then with a clean tree:

setenv LDFLAGS "-L/usr/local/lib -Wl,--warn-unresolved-symbols"
setenv CFLAGS "-I/usr/local/include"
meson build -Dsystemd=false -Deeze=false -Dbuild-examples=false
vtorri added a comment.Mar 3 2019, 2:53 AM

why only the header and not the library is tested ?

vtorri who knows.

vtorri added a comment.Mar 3 2019, 3:07 AM

you can add this. If notify is usually in libc, then AC_CHECK_LIB should be sufficient (same for meson)

netstar,

Make sure you remove any package that is including inotify headers because the EFL build will see these headers and assume we can use inotify but we cannot use it on FreeBSD. If you have inotify.h in /usr/local/include or elsewhere, remove it, or the package that is pulling in this bogus header.

It seems really hacky. So, an average user who has GIMP installed (or OpenJDK or ...) needs to delete headers from /usr/local/include?? Something is going bad with the meson here...

Same thing

LDFLAGS "-L/usr/local/lib -Wl,--warn-unresolved-symbols"

OK, I understand that -L/usr/local/lib should be here (BTW, why meson does not detect this path himself? It's an advanced build system, isn't it?) But --warn-unresolved-symbols seems to be hacky as well.

I'll retry a clean build this evening, but anyway - build EFL now is not a problem (I've built it using autotools), I'm just trying to help with this new build system. So if you consider that it's OK in the actual state - no problems, it's up to you to close the ticket.

Okay, i see three issues here:

  • inotify Why, OH WHY, is anyone installing on bsd a header which works in a different way to how the standard header works? And why should we handle that case? Don't get me wrong, but i don't see that the role of EFL is to support distrubutions that decided to ship buggy half-way-there support for something like inotify.h ...
  • -L/usr/local/lib Its not the role of a buildsystem to guess where to find the libraries, its IMO the responsitibility of the system to either have the library installed in a place where the compiler can find it out of the box. Or have a note to its users somewhere that they need additional CFLAGS.
  • build problem Not sure what exactly is causing this, but i never saw that, nor do i see those functions being generated with eolian for me in efl_ui_win.eo.c can you retry with latest master?

In general regarding environ: I cannot understand why freeBSD acts in such a way regarding environ. Why is the symbol only injected when *running* a appliction? This is the complete opposite of what the rest does, and i seriously cannot find a single reason to do that ... Further more, it forces you to not check for unresolved symbols whenever you use environ.

bu5hm4n,
Libinotify is present in FreeBSD as port:
FreshPorts
You can see the limitations of this library in pkg-message section of this page. This library is used for 50+ ports and they manage to use it correctly. I referenced two projects that added support of FreeBSD's inotify without hacks: polybar, gerbera It does not seem to me that they needed to work hard to add this support ;) Anyway, if EFL cannot use it correctly under FreeBSD - we need a meson option to disable it without removing headers.

As about environ - I don't understand it neither.

It does not matter if we work hard for it or not. inotify.h is a linux thing, which requires *no* -l argument, hense most projects build without a check to the library (It will fail anyways on linux). So here we are once again at the point where the distribution should probebly add a note somewhere that they require custom CFLAGS, to link against this custom libinotify.

However, i am going to disable the inotify backend for BSD, then we got rid of this.

So, I took my test PC (FreeBSD 12) , I've uninstaled all EFL stuff, I've cloned EFL repo and I've patched src/lib/ecore_file/meson.build like in Diff 19894.
Then I've declared the following environment variables:

LD_LIBRARY_PATH=/usr/local/lib
CFLAGS=-I/usr/local/include
CPATH=/usr/local/include
LIBRARY_PATH=/usr/local/lib
LDFLAGS=-L/usr/local/lib -Wl,--warn-unresolved-symbols

Then I've configured EFL as follows:

meson build -Dsystemd=false -Deeze=false -Dbuild-examples=false

Then I started the build

ninja -C build

And it still cannot build EFL:

[2325/3287] Generating edje_cc_ethumb_frame with a custom command.
FAILED: data/ethumb/frames/default.edj 
/usr/bin/env EFL_RUN_IN_TREE=1 /root/Prog_EFL/efl/build/src/bin/edje/edje_cc -beta -fastcomp -sd /root/Prog_EFL/efl/data/ethumb/frames -id /root/Prog_EFL/efl/data/ethumb/frames -fd /root/Prog_EFL/efl/data/ethumb/frames ../data/ethumb/frames/default.edc data/ethumb/frames/default.edj
ld-elf.so.1: /root/Prog_EFL/efl/build/src/bin/edje/../../lib/ecore_file/libecore_file.so.1: Undefined symbol "inotify_init"
[2326/3287] Generating edje_cc_default.edc with a custom command.
FAILED: data/elementary/themes/default.edj 
/usr/bin/env EFL_RUN_IN_TREE=1 /root/Prog_EFL/efl/build/src/bin/edje/edje_cc -beta -fastcomp -deps data/elementary/themes/default.edj.d -sd /root/Prog_EFL/efl/data/elementary/themes/snd -id /root/Prog_EFL/efl/data/elementary/themes/img -id /root/Prog_EFL/efl/data/elementary/themes/fdo -fd /root/Prog_EFL/efl/data/elementary/themes/fnt ../data/elementary/themes/default.edc data/elementary/themes/default.edj
ld-elf.so.1: /root/Prog_EFL/efl/build/src/bin/edje/../../lib/ecore_file/libecore_file.so.1: Undefined symbol "inotify_init"
[2327/3287] Compiling C object 'src/bin/edje/2ae1fb6@@edje_decc@exe/edje_cc_sources.c.o'.
ninja: build stopped: subcommand failed.

If I do something wrong - tell me how should I proceed.
Libinotify is present on this PC, there are many packages using it.

I don't reopen the ticked as it works for netstar ;)

Sorry, i must have been half asleep when i wrote this patch, it must be if sys_linux == true. sorry :(

OK, with if sys_linux == true it works better ;)
I could build EFL, Enlightenment and Terminology, everything works fine on FreeBSD 12.