crazywhalecc / static-php-cli

Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.
https://static-php.dev
MIT License
1.26k stars 217 forks source link

Proposal: use same compilation flags as the Docker images #515

Open dunglas opened 1 month ago

dunglas commented 1 month ago

For improved security, what do you think about using by default the same flags as the Docker image? https://github.com/docker-library/php/blob/master/8.3/alpine3.20/zts/Dockerfile#L53-L55

crazywhalecc commented 1 month ago

It's useful to improve security, and now that the -fPIE flag is set, I think the only thing to consider is to keep -Os.

But I don't have a performance and security test plan at the moment, and these compilation parameters may also affect phpmicro. It would be better if there were more comprehensive tests on these flags.