Alexey: okay, I'll put the diffs to Raf's diffs on the contribution page. Truth to tell, Raf did the real work here. Also following your suggestion, here's the summary:
Hello Raf,
Here's the summary. It was a quick hack as you'll see.
I created a file gcc_power_linux.h. It's just a copy of your gcc_power.h with register r0 replaced with register 3. For whatever reason, it seems that the assembler does not recognize "r0" (or "r3") as a valid register name. I had no particular basis for choosing register 3; I know next to nothing about the PowerPC ABI or the g++ conventions wrt to the PowerPC (1 is the stack pointer?)
./include/tbb/machine/gcc_power_linux.h
126,127c126,127
< mnemonic " 3,%1,%3
" /* perform operation */
< "st" X "cx. 3,0,%4
" /* store new_value */
---
> mnemonic " r0,%1,%3
" /* perform operation */
> "st" X "cx. r0,0,%4
" /* store new_value */
131c131
< : "3", "cr0");
---
> : "r0", "cr0");
In tbb_machine.h, if __PPC__ use the new file gcc_power_linux.h.
./include/tbb/tbb_machine.h
495,496d494
< #elif __PPC__
< #include "tbb/machine/gcc_power_linux.h"
In linux.inc, set the architecture.
./build/linux.inc
41,43d40
< ifeq ($(shell uname -m),ppc64)
< export arch:=ppc64
< endif
This is a probably a crude hack here. With the Cell SDK, the g++ compiler to use for the the PPU is ppu-g++. Also want 64-bit.
./build/linux.gcc.inc
42,46c42
< ifeq (ppc64,$(arc
h))
< CPLUS = ppu-g++
< else
< CPLUS = g++
< endif
---
> CPLUS = g++
78,82d73
< ifeq (ppc64,$(arch))
< CPLUS_FLAGS += -m64
< LIB_LINK_FLAGS += -m64
< endif
I think that's it. It's certainly simpler than what I was trying to do with the stock distribution without your patches. And, it passes the tests.