1

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

RedNax
  • 121
  • 5
  • What compiler are you using? – mghocke Sep 27 '12 at 19:04
  • You nailed it, thanks - # gcc -v Reading specs from /opt/csw/lib/gcc/sparc-sun-solaris2.10/4.6.3/specs COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/opt/csw/libexec/gcc/sparc-sun-solaris2.10/4.6.3/lto-wrapper Target: sparc-sun-solaris2.10 Configured with: /home/maciej/src/opencsw/pkg/gcc4/trunk/work/solaris10-sparc/build-isa-sparcv8plus/gcc-4.6.3/configure – RedNax Oct 01 '12 at 08:18
  • Well, the compiling still breaks. – RedNax Oct 02 '12 at 10:25

2 Answers2

1

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.

automaciej
  • 426
  • 1
  • 6
  • 11
1

Finally got it running.

Needed to compile with the following settings.

export CC=gcc
export CFLAGS="-m64"
export CXX=gcc
export CXXFLAGS="-m64"
export LDFLAGS="-m64 -L/lib/64 -L/usr/sfw/lib/64"
export LD_LIBRARY_PATH="/usr/local/lib/sparcv9/:/usr/local/lib:/usr/local/apache2/lib:/usr/sfw/lib/sparcv9:/usr/local/lib/sparcv9:/usr/lib/sparcv9"
export LDFLAGS="-lrt"
RedNax
  • 121
  • 5