Php – Compiling PHP on Solaris

PHPphp-fpmsolarissparc

I'm compiling PHP with --enable-fpm on Solaris 10 (sun4v sparc SUNW,Sun-Fire-T1000) and it stops at

#error Sparc v8 and predecessors are not and will not be supported (see bug report 53310)

Following the error, the CPU I have is a v9 ? Why is the error occurring? How should the compilation be signaled to include a -mcpu=v9 ? Would that help?

Edit:

I've tried compiling both 5.3.8 and the latest 5.4.7 – and the error appears for both. PHP and PHP-CGI compiles fine.

Edit2:

The configure flag is –

./configure –enable-fpm

Best Answer

It usually boils down to the compare-and-swap instruction, which isn't available in v8, but is available in v8+ and newer processors.

It's hard to tell what's wrong, because you didn't show your ./configure invocation, relevant environment variables, nor the exact place where it fails (configuration stage? compilation stage?). Sometimes there's a test that checks for v8+ but is badly written and misfires.

It's not obvious why does the error fire, because compilers default to v8+ these days, and not to v8. If you didn't set anything, you should get a v8+ binary (for a 32-bit build) and v9 binary (for a 64-bit build).

If you want to signal the build that you want -mcpu=v9, export that in the CFLAGS environment variable.