Hello,

TL;DR: I want to get rid of the quicklaunch complex wrapper + lib system
and compile apps with -fPIC and link with -pie instead. Little to no
changes required in elementary.


As was pointed out recentely on this very mailing list, it is possible to
make .so files that are runnable. The mail pointed to:
http://rachid.koucha.free.fr/tech_corner/executable_lib.html

This is IMO a pretty hacky solution (especially the part where we need to
point directly to ld-linux-2.so). It's not very portable as it already
won't run on x64 (need to change the ld library path). Also, I could not
manage to get proper argc, argv in main (only the program name).

Instead of that, we can compile apps with -fPIC (or -fpic or -fpie or
-fPIE) and link with -pie. This will make linkable executables, instead of
executable shared libraries :)


Now, as you know, we have this Quicklaunch system that will load a library
containing the application's code and run elm_main from there. The
associated executable is then just a wrapper linked to that library and
that calls elm_quicklaunch_fallback().

I see a few drawbacks to this model:
- Compilation requires to take care of Quicklaunch, enabling #define flags
as well as adding specific instructions in Makefiles to generate the lib
and wrapper.
- A program needs to be installed in order to be run by elementary_run
(looks into ../lib folder)
- There are two files instead of one (lib + wrapper)


All of this seems a bit confusing to me, especially considering it is
pretty easy to render an executable linkable by dlopen/dlsym, by using
-fpie and -pie.
I believe we can consider the performance hit minimal in normal use cases.


For legacy support, we need to keep some stuff around, but I believe we
should get rid of -DELM_LIB_QUICKLAUNCH and advise to compile PIE instead.
Should we go as far as adding a #warning if ELM_LIB_QUICKLAUNCH is defined?
:)


Best regards,

-- 
Jean-Philippe André
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to