Hello again,

I have submitted some changes to Elementary, reviewed by Cedric, so blame
him if everything is broken now :)
The following commits remove elementary_testql, simplify the build logic
based on PIE and even simplify execution of quicklaunch programs (by
extending the searched paths):
https://git.enlightenment.org/core/elementary.git/commit/?id=876f8bccc7fed2f8511c9bdbe1c0e21be30290ca
https://git.enlightenment.org/core/elementary.git/commit/?id=97264f434d88af38aead65426d67236c7f89ffc0


I'll remove the now useless #ifdef ELM_LIB_QUICKLAUNCH in elementary.


Btw, I forgot to add that the linker needs -rdynamic -pie and not just -pie
:)


Best regards,



2013/11/4 Jean-Philippe André <[email protected]>

> 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é
>
>


-- 
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to