Page MenuHomePhabricator

Mac OS EFL Build Fail
Closed, ResolvedPublic

Description

When building EFL on Mac OS High Sierra:

Using homebrew:

Am building with gstreamer plugins don't see any harm, this is my configure line:

./configure --prefix=/opt --with-x11=none --enable-cocaa
  OBJCLD   lib/ecore_cocoa/libecore_cocoa.la
  CCLD     lib/efreet/libefreet_mime.la
  CCLD     lib/ecore_imf_evas/libecore_imf_evas.la
  OBJCLD   modules/evas/engines/gl_cocoa/module.la
  CCLD     modules/evas/engines/gl_common/libevas_engine_gl_common.la
Undefined symbols for architecture x86_64:
  "_evas_common_font_ext_clear", referenced from:
      _evas_outbuf_free in modules_evas_engines_gl_cocoa_module_la-evas_outbuf.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [modules/evas/engines/gl_cocoa/module.la] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
netstar created this task.Nov 29 2017, 12:12 PM

sorry typo:

./configure --prefix=/opt --with-x11=none --enable-cocoa
jpeg added a comment.Nov 29 2017, 6:16 PM


Please submit if this works for you. I can't test. :)

@jpeg with your patch applied it goes further.

Now we have unresolved symbols later on:

CCLD     modules/ecore_evas/engines/cocoa/module.la

CCLD     modules/ecore_evas/engines/extn/module.la

CCLD     lib/edje/libedje.la

CCLD     bin/ecore_evas/ecore_evas_convert

CCLD     bin/ecore_evas/eetpack

clang: warning: argument unused during compilation: '-pie'

CCLD     modules/emotion/gstreamer1/module.la

clang: warning: argument unused during compilation: '-pie'

clang: warning: argument unused during compilation: '-pie'

Undefined symbols for architecture x86_64:

"_evas_common_font_cache_get", referenced from:

    _eng_font_cache_flush in modules_evas_engines_gl_generic_module_la-evas_engine.o

    _eng_font_cache_get in modules_evas_engines_gl_generic_module_la-evas_engine.o

"_evas_common_font_cache_set", referenced from:

    _eng_font_cache_flush in modules_evas_engines_gl_generic_module_la-evas_engine.o

    _eng_font_cache_set in modules_evas_engines_gl_generic_module_la-evas_engine.o

"_evas_common_font_draw", referenced from:

    _eng_font_draw in modules_evas_engines_gl_generic_module_la-evas_engine.o

"_evas_common_font_draw_prepare", referenced from:

    _eng_font_draw in modules_evas_engines_gl_generic_module_la-evas_engine.o

"_evas_common_font_flush", referenced from:

    _eng_font_cache_flush in modules_evas_engines_gl_generic_module_la-evas_engine.o

"_evas_common_font_glyph_uncompress", referenced from:

    _evas_gl_font_texture_new in libevas_engine_gl_common.a(modules_evas_engines_gl_common_libevas_engine_gl_common_la-evas_gl_font.o)

ld: symbol(s) not found for architecture x86_64

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

make[4]: *** [modules/evas/engines/gl_generic/module.la] Error 1

make[4]: *** Waiting for unfinished jobs....

make[3]: *** [all-recursive] Error 1

make[2]: *** [all] Error 2

make[1]: *** [all-recursive] Error 1

make: *** [all] Error 2

jpeg reassigned this task from jpeg to smohanty.Dec 1 2017, 12:26 AM
jpeg added subscribers: smohanty, jpeg.

I think @smohanty changed the font code, please have a look.
I totally forgot about travis... it's quite convenient to test this kind of things.
https://travis-ci.org/Enlightenment/efl/branches

It is indeed. Esepcially if you have your own branches and what to see that some basic build testing works on osx for example. I just need to find more time to extend it further.

@smohanty can you please have at least a look at this? It broke the compilation on OSX which was working fine before.

Just a note. When we get to a stage where the build works, I'm quite happy to build daily so that hopefully this sort of thing can be caught as and when it happens.

jpeg added a comment.Dec 19 2017, 1:37 AM

This is a mystery... I tried using dlsym and only got more errors.
See travis build 900: https://travis-ci.org/Enlightenment/efl/jobs/318462374

Undefined symbols for architecture x86_64:
  "_evas_common_font_cache_get", referenced from:
      _eng_font_cache_flush in modules_evas_engines_gl_generic_module_la-evas_engine.o
      _eng_font_cache_get in modules_evas_engines_gl_generic_module_la-evas_engine.o
  "_evas_common_font_cache_set", referenced from:
      _eng_font_cache_flush in modules_evas_engines_gl_generic_module_la-evas_engine.o
      _eng_font_cache_set in modules_evas_engines_gl_generic_module_la-evas_engine.o
  "_evas_common_font_draw", referenced from:
      _eng_font_draw in modules_evas_engines_gl_generic_module_la-evas_engine.o
  "_evas_common_font_draw_prepare", referenced from:
      _eng_font_draw in modules_evas_engines_gl_generic_module_la-evas_engine.o
  "_evas_common_font_flush", referenced from:
      _eng_font_cache_flush in modules_evas_engines_gl_generic_module_la-evas_engine.o
  "_evas_common_font_glyph_uncompress", referenced from:
      _evas_gl_font_texture_new in libevas_engine_gl_common.a(modules_evas_engines_gl_common_libevas_engine_gl_common_la-evas_gl_font.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [modules/evas/engines/gl_generic/module.la] Error 1

Without my own build environment I don't know what to do.
But I suspect that somehow evas_engines_gl_generic_module is just not linked to libevas. I tried adjusting configure.ac and

jayji added a subscriber: jayji.Dec 19 2017, 3:01 AM
jayji added a comment.Dec 19 2017, 3:48 AM

I'll have a look at this, haven't built efl on mac for a while.
It would be much nicer if we had a meson build to speed up build time :/

jayji added a comment.Dec 19 2017, 4:39 AM

I have this:

Undefined symbols for architecture x86_64:
  "_evas_common_font_ext_clear", referenced from:
      _evas_outbuf_free in modules_evas_engines_gl_cocoa_module_la-evas_outbuf.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [modules/evas/engines/gl_cocoa/module.la] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

which seems legit, given the nm output:

$ nm lib/evas/.libs/libevas.dylib| grep font_ext
00000000001b2c80 t __cb_hash_font_ext
00000000001a8a30 T _evas_common_draw_context_font_ext_set
00000000001b2c60 t _evas_common_font_ext_clear  <------ internal to libevas

On Linux, the symbol is indeed public:

$ nm build/src/lib/evas/.libs/libevas.so | grep font_ext
000000000017a520 t _cb_hash_font_ext
0000000000175f60 T evas_common_draw_context_font_ext_set
000000000017bf70 T evas_common_font_ext_clear   <------------- :)

Seems we have an EAPI definition problem :/
More to come...

jayji added a comment.Dec 19 2017, 4:47 AM

What was done in evas_font.h in D5419: Remove evas internal dependency from the evas_font module seems pretty weird to me. Why do we re-define EAPI there?

jayji added a comment.Dec 19 2017, 5:13 AM

And there are cyclic includes as well:

evas_font.h -> evas_text_utils.h -> evas_font_ot.h -> evas_font.h

But anyway... I fixed that. There are more linking errors now T_T

jayji added a comment.Dec 19 2017, 5:29 AM

And now:

Undefined symbols for architecture x86_64:
  "__ELM_CTXPOPUP_EVENT_DISMISSED", referenced from:
      __field_clicked_cb in modules_elementary_clock_input_ctxpopup_module_la-clock_input_ctxpopup.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Undefined symbols for architecture x86_64:
  "__ELM_ENTRY_EVENT_ACTIVATED", referenced from:
      _elm_prefs_entry_add in modules_elementary_prefs_module_la-elm_entry.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@jayji thanks very much!

jayji reopened this task as Open.EditedDec 19 2017, 9:16 AM
jayji added a subscriber: raster.

@raster sorry for breaking efl first, but 036cf62cc7bb1c5cb743f6d28f4b6c5fc024a414 broke the build on macOS.

  CCLD     modules/elementary/clock_input_ctxpopup/module.la
Undefined symbols for architecture x86_64:
  "__ELM_CTXPOPUP_EVENT_DISMISSED", referenced from:
      __field_clicked_cb in modules_elementary_clock_input_ctxpopup_module_la-clock_input_ctxpopup.o
ld: symbol(s) not found for architecture x86_64

odd. it works on linux and i use -fvisibility=hidden ... but #including elm_ctxpopup.eo.h in Elementary.h (the public header) is wrong as long as it is not installed:

$ ls /usr/local/include/elementary-1/elm_ctxpopup.eo.h
ls: cannot access '/usr/local/include/elementary-1/elm_ctxpopup.eo.h': No such file or directory

oddly:

$ git grep  ELM_CTXPOPUP_EVENT_DISMISSED
src/lib/elementary/elc_ctxpopup.c:        efl_event_callback_legacy_call(data, ELM_CTXPOPUP_EVENT_DISMISSED, NULL);
src/lib/elementary/elc_ctxpopup.c:   efl_event_callback_legacy_call(data, ELM_CTXPOPUP_EVENT_DISMISSED, NULL);
src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c:      (ctx_mod->ctxpopup, ELM_CTXPOPUP_EVENT_DISMISSED, _ctxpopup_dismissed_cb, ctx_mod);
$ git grep elm_ctxpopup.eo.h
src/lib/elementary/elc_ctxpopup.c:#include "elm_ctxpopup.eo.h"
src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c:#include "elm_ctxpopup.eo.h"

and aaaah...

#undef EAPI
#define EAPI

at end of Elementary.h. that's probably it. because...

...
#include <Elementary.h>
#include "elm_module_helper.h"
#include "elm_widget.h"
#include "efl_ui_clock_private.h"
#include "elm_ctxpopup_item.eo.h"
#include "elm_ctxpopup.eo.h"
...

so the code was already broken since:

commit ad6e3ce3df422751cb1c4524f1ea0b16ce897410
Author: Jean-Philippe Andre <jp.andre@samsung.com>
Date: Wed Aug 9 13:24:48 2017 +0900

elm: Add missing undef EAPI to Elementary.h

This may solve issues on Windows where EAPI can be either dllimport or
dllexport. Anyway keeping EAPI defined is invalid and inconsistent.

Also, change an invalid EO_BETA_API define tag to EFL_BETA_API_SUPPORT
and EFL_EO_API_SUPPORT.

Thanks @vtorri for the report!

Well kind of... broken as some things are and are not exposed properly. so ... see the following commit

ajwillia.ms reopened this task as Open.Dec 20 2017, 12:50 AM

Nope, still not working.

Undefined symbols for architecture x86_64:

"__ELM_CTXPOPUP_EVENT_DISMISSED"

If EAPI is not defined when those symbols are encountered, we are doomed.
In elc_ctxpopup.c for example (which includes elm_ctxpopup.eo.h, and therefore has the first DECLARATION of _ELM_CTXPOPUP_EVENT_DISMISSED) we already are outside of Elementary.h, so that's dead.

We could re-define EAPI outside of Elementary.h for a couple of private headers.

ajwillia.ms reopened this task as Open.Dec 20 2017, 1:22 AM

No change

yargh! i think EWAPI has something to do with it though... as

elm_ctxpopup.eo.h:EWAPI extern const Efl_Event_Description _ELM_CTXPOPUP_EVENT_DISMISSED;
jayji added a comment.Dec 20 2017, 1:48 AM

Yes, when I wrote EAPI, it is because EWAPI expands to EAPI and something else I don't remember.

aaah but it expands WHEN EWAPI is #defined... not later on. so it has to be re #defined again. i just tried that now. remember cpp is dumb. it expands WHEN the token/macro is seen... not later on when "used". :)

ajwillia.ms reopened this task as Open.Dec 20 2017, 2:54 AM

Sorry, still the same :(

yargh... ok. hmmm then why... :/ :\ :|

jayji closed this task as Resolved.Dec 28 2017, 10:49 AM

Fixed by some Christmas magic :)

hhahaha. yay christmas! :) unfortunately i have no macs to test on... for windows i have now set up a cross-compile env for building windows targets. i actually have a windows laptop that i transferred into a vm image (trust me. that took over a day of dumping disk images and so on and it wasn't pretty). i have a freebsd vm. but nothing for osx. so i have to rely on you osx users to pick up those pieces. :(

yeh it worked, built last night ! thanks @jayji

jayji added a comment.Dec 29 2017, 7:58 AM

@netstar this time it is not thanks to me, someone made a fancy patch that happened to fix the build :)