SPU compilation stand-alone program troubles

Investigation into how Linux on the PS3 might lead to homebrew development.

Moderators: cheriff, emoon

Post Reply
exbutterfly
Posts: 3
Joined: Mon May 12, 2008 8:16 pm

SPU compilation stand-alone program troubles

Post by exbutterfly »

Hi,

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 :

Code: Select all

#include <stdio.h>

int main&#40;&#41;
&#123;
    printf&#40;"Hello World !"&#41;;
    return 0;
&#125;
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
Any suggestions ?

Thanks for your help
Radamantis
Posts: 4
Joined: Mon Apr 14, 2008 7:00 pm
Location: Caserta - Italy
Contact:

Post by Radamantis »

Hi exbutterfly...

Looking at the source everything seems fine... maybe it's a problem with environment variables...
Radamantis, the greatest caution
exbutterfly
Posts: 3
Joined: Mon May 12, 2008 8:16 pm

Post by exbutterfly »

Hi Radamantis.

Thanks for your answer.

Can you tell me the normal minimal content of environment variables LD_LIBRARY_PATH or others variables implied in the linking.

Maybe, it is an error in the config file of ld ?
Radamantis
Posts: 4
Joined: Mon Apr 14, 2008 7:00 pm
Location: Caserta - Italy
Contact:

Post by Radamantis »

Have you included in your $PATH the directory /opt/cell/sdk/usr/include ?
Radamantis, the greatest caution
exbutterfly
Posts: 3
Joined: Mon May 12, 2008 8:16 pm

Post by exbutterfly »

I think i found the origin of the problem. But I have no solution.

In the installation of the RPM package elfspe with yum, an error had occured :

Code: Select all

/usr/bin/elfspe-register&#58; line 6&#58; /proc/sys/fs/binfmt_misc/register&#58; No such file or directory
error&#58; %post&#40;elfspe2-2.2.0-91.ppc&#41; scriptlet failed, exit status 1
It makes sense that this error disturbe the linking.

If someone have any suggestions
_Razorblade_
Posts: 1
Joined: Wed May 14, 2008 6:50 am

Post by _Razorblade_ »

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?
leonhong
Posts: 10
Joined: Wed Jan 09, 2008 6:38 pm

Re: SPU compilation stand-alone program troubles

Post by leonhong »

Dear exbutterfly:

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.

Best regards
Post Reply