Re: About compile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 12, 2011 at 04:03:31PM +0200, konica sarker wrote:
> On Thu, May 12, 2011 at 1:46 PM, Axel Freyn <axel-freyn@xxxxxx> wrote:
> > Hi,
> > On Thu, May 12, 2011 at 12:50:23PM +0200, konica sarker wrote:
> >> On Wed, May 11, 2011 at 1:15 PM, konica sarker <konica.sarker@xxxxxxxxx> wrote:
> >> > On Wed, May 11, 2011 at 12:31 PM, Kai Ruottu <kai.ruottu@xxxxxxxxxxx> wrote:
> >> >> 11.5.2011 12:49, konica sarker kirjoitti:
> >> >>>>>
> >> >>>>> I want to compile a program from my personal computer (ubuntu  is
> >> >>>>> running) written for SPU target.
> >> >>>>> Can you tell me the what is the command for this?
> >> >>>>
> >> >>>> Ubuntu should provide a package called 'spu-gcc' and the GCC-driver
> >> >>>> in it being 'spu-gcc'...
> >> >>>>
> >> >>> Yes, I installed that package. now is is identifying the command spu-gcc
> >> >>> but I have compiled a test code (following), and got some error message...
> >> >>> Could you tell me why is this?ie what tzpe of error message is this?
> >> >>>
> >> >>> my code:
> >> >>>
> >> >>> int main(int argc, char *argv[])
> >> >>> {
> >> >>>
> >> >>> int x;
> >> >>> return 0;
> >> >>>
> >> >>> }
> >> >>>
> >> >>> the error message :
> >> >>>
> >> >>> /tmp/ccz6TI1D.s: Assembler messages:
> >> >>> /tmp/ccz6TI1D.s:3: Error: alignment not a power of 2
> >> >>> /tmp/ccz6TI1D.s:7: Error: no such instruction: `stqd $sp,-80($sp)'
> >> >>> /tmp/ccz6TI1D.s:8: Error: no such instruction: `ai $sp,$sp,-80'
> >> >>> /tmp/ccz6TI1D.s:9: Error: no such instruction: `lqd $2,48($sp)'
> >> >>
> >> >> Sounds like you haven't any 'spu-binutils'. That a GCC needs
> >> >> suitable binutils: assembler, linker etc. and most probably
> >> >> also a suitable C library, maybe 'spu-newlib' or something
> >> >> package, was unfortunately not told :(
> >> >>
> >> >> Probably the Ubuntu's "package manager" has a "search" possibility
> >> >> for finding all "spu" related packages..
> >> >>
> >> >
> >> > Ya, it works perfectly....thanks a lot :)
> >> >
> >>
> >> I have another Problem. I have installed spu-binutils, spu-newlib, and
> >> then spu-gcc.(.deb file, downloaded from internet)
> >> Now I can compile my code with "spu-gcc -c test.c " command.
> >> but the problem is, I have made a change in spu.h file, then how do I
> >> rebuild GCC compiler?
> >>
> >> I have given a command >>./configure target=SPU then >> make
> >> but make is giving error.
> >>
> >> so, my target is , I want to modify spu.c and spu.h and after
> >> modifying, how do I recompile the compiler?
> > Probably the easiest (as fully automated...) way is to do it "the Ubuntu
> > way" (I'm using Debian, so I'm not 100% sure the comands are exactly the
> > same on Ubuntu)
> >  - download the source code of the spu-cross-compiler
> >   should be something like "apt-get source spu-gcc"
> >   This will download the complete source code, including all
> >   modifications done by Ubuntu.
> >  - cd' into that new directory and change the spu.h/spu.c files
> >   then create the Ubuntu-packages:
> >   dpkg-buildpackage
> >   (here, dpkg-buildpackage will check that all dependencies are
> >   fullfilled. If something is missing, it will tell you the name of
> >   the Ubuntu-package you have to install).
> >  - now install the locally generated package spu-gcc.versionnumber.deb
> >   using "dpkg -i ..."
> > Then everything should be fine :-)
> >
> > The same is of course possible with the spu-binutils,.. packages, if you
> > want to change there something.
> >
> > HTH,
> >
> > Axel
> >
> 
> apt-get source spu-gcc is not working..is is giving message
> 
> kosarker@bbl1lr32:~/Work/gcc-4.5.0$ sudo apt-get source spu-gcc
> [sudo] password for kosarker:
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> Picking 'cell-gcc' as source package instead of 'spu-gcc'
> E: Unable to find a source package for cell-gcc
> kosarker@bbl1lr32:~/Work/gcc-4.5.0$

That is strange -- in theory apt-get should find the appropriate package
(under the condition that there exists a spu-gcc - package for your
Ubuntu version, and you have an "deb-src ..." entry in your
/etc/apt/sources.list (but if that would be missing, apt-get should give
another error message).
Did you install spu-gcc by aptitude/synaptic, or you downloaded the .deb
directly from the web? For "apt-get source" to work you need an "deb-src
..." entry for the package repository from which you downloaded spu-gcc

> 
> ....so, I have gcc 4.5.0 running, I want to modify spu.c and spu.h
> files inside the gcc folder  and want to see the change affect...do
> you suggest me some way?
OK, if you want to compile it yourself:
That's the official documentation: http://gcc.gnu.org/install/
(on the page http://gcc.gnu.org/install/configure.htm you have specific
comments for building a cross-compiler)
However, if you do that, you have to be careful: 
 - you should NOT install this new, self-compiled compiler in the main
   system, but in some special directory (in order not to create
   conflicts with the package management system of Ubuntu)
 - if you keep the spu-gcc - package installed, you will have TWO
   cross-compilers installed - then you have to define which one to use
   (e.g. you can use the option "--program-suffix" when compiling gcc in
   order to give it a different name)

HTH,

Axel


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux