hi,

On Wed, Nov 25, 2015 at 3:43 PM, Andone, Bogdan <bogdan.and...@intel.com>
wrote:

> Hi Dmitry,
>
>
>
> Here is a PR trying to solve the problem:
> https://github.com/php/php-src/pull/1650
>
> Let me know if I missed something.
>

Yeah. This approach should work.

Using non-PIC object files instead of PIC for linking executable programs
make it about 2% faster on Linux x86_64.
I have no idea about disadvantages. May be ASLR.
For some reason libtool always use PIC objects, and even don't provide a
simple way to switch to non-PIC.

Nikita, are you familiar with libtool hacking?
May be we have some experts on @internals?

Thanks. Dmitry.


>
>
> Kind Regards,
>
> Bogdan
>
>
>
> *From:* Andone, Bogdan
> *Sent:* Tuesday, November 24, 2015 1:29 PM
> *To:* 'Dmitry Stogov'
> *Cc:* jit-project
> *Subject:* RE: libtool builds CLI/CGI php from PIC object files
>
>
>
> *From:* Dmitry Stogov [mailto:dmi...@zend.com <dmi...@zend.com>]
> *Sent:* Tuesday, November 24, 2015 1:00 PM
> *To:* Andone, Bogdan
> *Cc:* jit-project
> *Subject:* Re: libtool builds CLI/CGI php from PIC object files
>
>
>
>
>
>
>
> On Tue, Nov 24, 2015 at 12:16 PM, Andone, Bogdan <bogdan.and...@intel.com>
> wrote:
>
> Hi Dmitry,
>
>
>
> I spent some time for understanding how auto tools work on PHP and I have
> some ideas on how to tweak libtool and Makefile for using static objects on
> x86 executables builds on linux.
>
>
>
> It seems it should be quite easy to switch to non-PIC objects modifying
> sapi/cli/config.m4.
>
> "darwin" already uses non-PIC objects and we may creae similar case for
> X86_64.
>
> But I don't know if this is 100% safe.
>
>
>
> *[BA] *The solution I was thinking involves two parts:
>
> -        Tweak acinclude.m4 for not inhibiting anymore static object
> compiling with libtool (as libtool compiles by default both PIC and non PIC
> versions); in this way we get both shared and static objects; shared
> objects will always be needed for linking libphp7, I think.
>
> -        Rework the Makefile for using .o instead of .lo objects for
> php-fpm, php-cgi and php-cli (this will touch config.m4 files and also
> configure.in)
>
>
>
> Kind Regards,
>
> Bogdan
>
> My current concerns are related to the fact that I am not sure how these
> tweaks will impact the diversity of possible PHP configurations on the
> multitude of platforms.
>
>
>
> I tried to get some feedback on the topic on the internals discussion list
> but I didn’t get any reply; I assume people are highly focused on releasing
> PHP7 and low energy for unrelated subjects.
>
>
> I afraid, nobody in PHP community know this.
>
> This is more a question to "libtool" developers.
>
> It tried to find information in Internet (why they use PIC objects to
> build executables, and even don't provide an option to use non-PIC ones),
> but without success. :(
>
>
>
> Thanks. Dmitry.
>
>
>
>
> It would be good to have a contact person knowing the history of
> libtool/autoconf. Otherwise, I will probably use the trial and error hard
> way: provide a proposal and see who reacts J.
>
>
>
> Thanks,
>
> Bogdan
>
>
>
> *From:* Dmitry Stogov [mailto:dmi...@zend.com]
> *Sent:* Monday, November 23, 2015 11:23 PM
> *To:* Andone, Bogdan; jit-project
> *Subject:* libtool builds CLI/CGI php from PIC object files
>
>
>
> Hi,
>
> I just verified Bogdan's research related to CLI/CGI build on x86_64.
>
> libtools really builds programs from PIC object files.
>
> I tried to manually rebuild them using non-PIC objects for Zend/* files
> and got 2% improvement on bench.php and Wordpress.
>
> BTW I didn't find a standard way to tell "libtools" not to use PIC files.
>
> On x86 it's possible to use '--without-pic' configure option, but it can't
> work on x86_64 if we build any shared libraries.
>
>
>
> Thanks. Dmitry.
>
>
>
>
>

Reply via email to