I have some troubles in order to compile a simple stand-alone program for SPU.
I work on Yellow Dog Linux YDL 6.0 for PS3. All compilators are installed and updated.
This is the code of the "Hello World" program I would to test if the installation is complete :
#include <stdio.h>
int main()
{
printf("Hello World !");
return 0;
}
I type in the command-line : spu-gcc -o test test.c
And I have the following message :
/usr/lib/gcc/spu/4.1.1/../../../../spu/bin/ld: skipping incompatible /usr/lib/gcc/spu/4.1.1/../../../../spu/lib/libc.a when searching for -lc
/usr/lib/gcc/spu/4.1.1/../../../../spu/bin/ld: skipping incompatible /usr/spu/bin/../lib/libc.a when searching for -lc
/usr/lib/gcc/spu/4.1.1/../../../../spu/bin/ld: skipping incompatible /usr/spu/lib/libc.a when searching for -lc
/usr/lib/gcc/spu/4.1.1/../../../../spu/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
/usr/bin/elfspe-register: line 6: /proc/sys/fs/binfmt_misc/register: No such file or directory
error: %post(elfspe2-2.2.0-91.ppc) scriptlet failed, exit status 1
It makes sense that this error disturbe the linking.
I don't know why elspe2 requires this, but if "/proc/sys/binfmt_misc/register" is the problem, then it's your kernel not supporting "Misc" exec format (as in "Executable file formats -> Kernel support for MISC binaries").
Do you use a stock kernel from YDL or a self-compiled one?
According to the IBM guidelines, all spe programs must be spawned by ppe kernel threads. Many preparations (locate spe, loading text and data to LS, start execution, arrange communications, stop execution, etc) should be done before you can use the spe. If you are trying to code stand-alone spu programs, maybe you can try CTK projects.