You are not logged in.

#1 2006-12-30 00:54:46

XazZ
Member
From: Munich, Germany
Registered: 2006-12-30
Posts: 72

Help needed: making a psptoolchain package for arch

Hi....
I'm very new to archlinux (now using it for 3 weeks), but I really like it big_smile
Now I tried to make a archlinux package for the psptoolchain (PSP's are so nice wink )
I already got a working package for the psp-gcc and the psp-binutils (wrote my own PKGBUILD's) which came with the psptoolchain.
But now I got stuck with psp-newlib and pspsdk.
At the moment I'm building all the packages separately, but later I'll try to make one package for the whole psptoolchain....

So here comes my problem with psp-newlib and pspsdk...

...
psp-gcc  -march=i686 -O2 -pipe -G0 -Wall -I../../src/base -I../../src/kernel -c sceAtrac3plus.S
sceAtrac3plus.S:0: error: bad value (i686) for -march
Assembler messages:
Error: Bad value (i686) for -march
make[3]: *** [sceAtrac3plus.o] Error 1
make[3]: Leaving directory `/mnt/data/archlinux/packages/psptoolchain/pspsdk/src/pspsdk/src/atrac3'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/mnt/data/archlinux/packages/psptoolchain/pspsdk/src/pspsdk/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/data/archlinux/packages/psptoolchain/pspsdk/src/pspsdk'
make: *** [all] Error 2
==> ERROR: Build Failed.  Aborting...

And here comes my PKGBUILD for psp-newlib:

# Contributor: xazz.xazz@googlemail.com

pkgname=newlib
pkgver=1.13.0
pkgrel=1
pkgdesc="GCC for psp-devel"
url="http://ps2dev.org/psp/Tools/Toolchain/"
depends=()
makedepends=()
source=(ftp://sources.redhat.com/pub/newlib/$pkgname-$pkgver.tar.gz)
md5sums=('3d07cc367a22b78c44227456b0d3b7dc')

build() {
  export PSPDEV="/usr/local/pspdev"
  export PATH="$PATH:$PSPDEV/bin" 
  cp $startdir/newlib-1.13.0.patch /$startdir/src/$pkgname-$pkgver
  cd $startdir/src/$pkgname-$pkgver
  cat newlib-1.13.0.patch | patch -p1 
  cd /$startdir/src/$pkgname-$pkgver
  BUILDDIR="/tmp/pspdev" PSPDEV="/usr/local/pspdev" ./configure --prefix=/usr/local/pspdev --target=psp
   make || return 1 
   make DESTDIR=$startdir/pkg install 
}

I know, using newlib as pkgname is bad, but later I'll change it to psp-newlib and I'll replace the $pkgname's with newlib (I hope this idea isn't too bad)

One last thing: psp-binutils and psp-gcc are installed in "/usr/local/pspdev"

I hope you can help me
thanks, and have a nice day
XazZ

Offline

#2 2006-12-30 15:15:07

hightower
Member
Registered: 2006-04-02
Posts: 182

Re: Help needed: making a psptoolchain package for arch

Are you trying to compile for your PSP or for your PC? Apparently the program doesn't like march=i686. Perhaps removing march in /etc/makepkg.conf might help.

Possible values: http://gcc.gnu.org/onlinedocs/gcc-3.2.3 … tions.html

hightower

Offline

#3 2006-12-30 18:32:12

XazZ
Member
From: Munich, Germany
Registered: 2006-12-30
Posts: 72

Re: Help needed: making a psptoolchain package for arch

Hi,
thanks for your help but this couldn't solve my problem sad.
I've edited /etc/makepkg.conf and changed all i686 to i386 - then I got this error:

...
../../../.././newlib/libc/argz/dummy.c:1: error: bad value (i386) for -march
Assembler messages:
Error: Bad value (i386) for -march
make[4]: *** [dummy.o] Error 1
...

Then I added " -march=i386 -mcpu=i386" to the PKGBUILD, and now it looks like this:

# Contributor: xazz.xazz@googlemail.com

pkgname=pspsdk
pkgrel=1
pkgdesc="GCC for psp-devel"
url="http://ps2dev.org/psp/Tools/Toolchain/"
depends=()
makedepends=()

build() {
  export PSPDEV="/usr/local/pspdev"
  export PATH="$PATH:$PSPDEV/bin" 
  cd $startdir/src
  svn co svn://svn.pspdev.org/psp/trunk/pspsdk
  cd /$startdir/src/$pkgname
  ./bootstrap
  BUILDDIR="/tmp/pspdev" PSPDEV="/usr/local/pspdev" ./configure 
--prefix=/usr/local/pspdev --with-pspdev=/usr/local/pspdev -march=i386 -mcpu=i386
   make || return 1 
   make DESTDIR=$startdir/pkg install 
}

with this PKGBUILD I'm getting the same error as above.

I know, depencies are missing, but I only want one package (the whole psptoolchain). So if all apps are in one PKGBUILD I'll add the depencies.

Thanks for your help!
XazZ

Offline

#4 2006-12-30 20:54:06

hightower
Member
Registered: 2006-04-02
Posts: 182

Re: Help needed: making a psptoolchain package for arch

Does leaving out the options completely change anything?

hightower

Offline

#5 2006-12-30 21:53:14

XazZ
Member
From: Munich, Germany
Registered: 2006-12-30
Posts: 72

Re: Help needed: making a psptoolchain package for arch

hightower wrote:

Does leaving out the options completely change anything?

You mean if I only change the makepkg.conf?
Then I get the error posted above.

I also edited my PKGBUILD and the makepkg.conf, but then I get the error shown above too.

Leaving makepkg.conf original and just adding -march=i386 -mcpu=i386 will result the following error:

sceAtrac3plus.S
sceAtrac3plus.S:0: error: bad value (i686) for -march
Assembler messages:
Error: Bad value (i686) for -march
make[3]: *** [sceAtrac3plus.o] Error 1

Oh: I should say that the errors appear on psp-newlib and on pspsdk.
If you like, you can get the psptoolchain at http://ps2dev.org/psp/Tools/Toolchain/

One more thing: you've sent me a link to the manual of gcc-3.2.3, but the psptoolchain uses gcc-4.0.2 (I just took a look at 4.0.3's manual and it said that I can use mtune instead of march - I tried that but it resulted in the errors shown above.)

thanks for your time
I'm sure that we can find a solution
XazZ smile

Offline

#6 2006-12-31 09:16:15

hightower
Member
Registered: 2006-04-02
Posts: 182

Re: Help needed: making a psptoolchain package for arch

i sent yout his page in order to show up other options for march. No, I mean deleting the march flag put of the PKGBUILD AND the makepkg.conf.

hightower

Offline

#7 2006-12-31 13:38:44

XazZ
Member
From: Munich, Germany
Registered: 2006-12-30
Posts: 72

Re: Help needed: making a psptoolchain package for arch

[Here was a problem - but I fixed it! - But there is a new problem!]

So here comes the description of my new problem:
OK... I managed to build newlib. gcc and pspsdk and pspsdk-headers...
now it is time to build gcc-c++
I tried that but it didn't work properly (ok.. it failed)
The output is *VERY* long so I decided to put it on phpfi.com
Here it is: http://phpfi.com/193121 (not the whole output - just the part with errors...)

btw: here is the important part of my /etc/makepkg.conf:

#########################################################################
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
export CARCH="i686"
export CHOST="i686-pc-linux-gnu"
#-- Exclusive: ill only run on i686 or higher (P6, Athlon)
export CFLAGS="-march=i686 -O2 -pipe"
export CXXFLAGS="-march=i686 -O2 -pipe"
#-- Optimized: will run on any x86, but optimized for i686
###export CFLAGS="-mcpu=i686 -O2 -pipe"
###export CXXFLAGS="-mcpu=i686 -O2 -pipe"
#-- Make Flags: change this for DistCC/SMP systems
#export MAKEFLAGS="-j2"

I hope someone can help me
Have a nice day
XazZ

Offline

#8 2007-01-18 18:50:57

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,922

Re: Help needed: making a psptoolchain package for arch

../../../libiberty/regex.c:57:25: error: sys/types.h: No such file or directory
../../../libiberty/regex.c:136: warning: conflicting types for built-in function 'malloc'
../../../libiberty/regex.c:164:25: error: strings.h: No such file or directory

Looks like your missing some header files.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#9 2007-01-18 19:47:44

XazZ
Member
From: Munich, Germany
Registered: 2006-12-30
Posts: 72

Re: Help needed: making a psptoolchain package for arch

Lone_Wolf wrote:

../../../libiberty/regex.c:57:25: error: sys/types.h: No such file or directory
../../../libiberty/regex.c:136: warning: conflicting types for built-in function 'malloc'
../../../libiberty/regex.c:164:25: error: strings.h: No such file or directory

Looks like your missing some header files.

big_smile
Thank you!
I've rebuilded pspsdk headers... and it works...
I also used another makepkg.conf (I don't know if this matters)

#########################################################################
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
###export CARCH="i686"
###export CHOST="i686-pc-linux-gnu"
#-- Exclusive: ill only run on i686 or higher (P6, Athlon)
###export CFLAGS="-march=i686 -O2 -pipe"
###export CXXFLAGS="-march=i686 -O2 -pipe"
#-- Optimized: will run on any x86, but optimized for i686
###export CFLAGS="-mcpu=i686 -O2 -pipe"
###export CXXFLAGS="-mcpu=i686 -O2 -pipe"
#-- Make Flags: change this for DistCC/SMP systems
#export MAKEFLAGS="-j2"

Thank you!
XazZ

Offline

#10 2007-04-05 00:06:22

XazZ
Member
From: Munich, Germany
Registered: 2006-12-30
Posts: 72

Re: Help needed: making a psptoolchain package for arch

After a long break I decided to work on the PKGBUILD again.
Now I got two PKGBUILD's: one for the psptoolchain and one for pspsdk (pspsdk gets updated very often, so I decided to create an extra PKGBUILD).
I'm not sure if my PKGBUILD's fit the PKGBUILD-standard hmm
First thing before I post my PKGBUILD's: I'm not finished with adding all required fields (as license and so on)!

Here comes the one for psptoolchain:

pkgname=psptoolchain
pkgver=2211
pkgrel=1
pkgdesc="A collection of tools to create executables for the Sony PSP"
url="http://ps2dev.org/psp/Tools/Toolchain/"
depends=('subversion' 'texinfo')
makedepends=()
license=('GPL')
source=(ftp://ftp.gnu.org/pub/gnu/binutils/binutils-2.16.1.tar.bz2 ftp://ftp.gnu.org/pub/gnu/gcc/gcc-4.0.2/gcc-4.0.2.tar.bz2 ftp://sources.redhat.com/pub/newlib/newlib-1.15.0.tar.gz)
md5sums=('6a9d529efb285071dad10e1f3d2b2967'
          'a659b8388cac9db2b13e056e574ceeb0'
          '4020004b1b7a56ca4cf7f6d35b40a4cb')
sha1sums=('5c80fd5657da47efc16a63fdd93ef7395319fbbf'
          'f1b714c6398393d8f7f4ad5be933b462a95b075d'
          'f6860b36e48fb831a30bab491230bbc7ce2669a2')
arch=('i686')

_svntrunk=svn://svn.pspdev.org/psp/trunk/psptoolchain
_svnmod=psptoolchain
_svntrunk1=svn://svn.pspdev.org/psp/trunk/pspsdk
_svnmod1=pspsdk

build() {
    cd $startdir/src
    svn co $_svntrunk $_svnmod
    cd psptoolchain
    cp binutils-2.16.1.patch $startdir/src/binutils-2.16.1/
    cp gcc-4.0.2.patch $startdir/src/gcc-4.0.2/
    cp newlib-1.15.0.patch $startdir/src/newlib-1.15.0

      export PSPDEV="$startdir/pkg/usr/local/pspdev"
      export PATH="$PATH:$PSPDEV/bin" 

msg "patching and building binutils..."

      cd $startdir/src/binutils-2.16.1
      cat binutils-2.16.1.patch | patch -p1 
    ./configure --prefix=/usr/local/pspdev --target=psp --enable-install-libbfd 
       make clean || return 1
       make || return 1 
       make DESTDIR=$startdir/pkg install 

msg "building and patching binutils finished"
msg ""
msg "patching and building gcc..."
    cd $startdir/src/gcc-4.0.2
      cat gcc-4.0.2.patch | patch -p1 
    mkdir objdir
    cd $startdir/src/gcc-4.0.2/objdir
    ../configure --prefix=$startdir/pkg/usr/local/pspdev --target=psp --enable-languages="c" --with-newlib --without-headers
       make || return 1 
       make DESTDIR=/ install 

msg "building and patching gcc finished"
msg ""
msg "building pspsdk-headers - we'll only need them temporary"
    cd $startdir/src/
    svn co $_svntrunk1 $_svnmod1
    cd $_svnmod1/
    ./bootstrap
    ./configure --prefix=/usr/local/pspdev -with-pspdev=/usr/local/pspdev 
    make clean || return 1
    make DESTDIR=$startdir/pkg install-data 
msg "building pspsdk-headers finished"
msg ""
msg "patching and building newlib-psp"
    cd $startdir/src/newlib-1.15.0
      cat newlib-1.15.0.patch | patch -p1 
    ./configure --prefix=$startdir/pkg/usr/local/pspdev --target=psp
       make || return 1 
       make DESTDIR=/ install
msg "building newlib-psp finished"
msg ""
msg "building gcc-c++"
      cd $startdir/src/gcc-4.0.2
      mkdir build-psp-c++
      cd $startdir/src/gcc-4.0.2/build-psp-c++
    ../configure --prefix=$startdir/pkg/usr/local/pspdev --target=psp --enable-languages="c,c++" --with-newlib --enable-cxx-flags="-G0"
    make clean || return 1
       make CFLAGS_FOR_TARGET="-G0"
       make || return 1 
       make DESTDIR=/ install 
msg "building gcc-c++ finished"
msg ""
msg "removing unnecessary code"
    cd $startdir/pkg/usr/local/pspdev/psp
    rm -rf sdk
msg "Now you need to build and install pspsdk!"
}

And here the one for pspsdk:

pkgname=pspsdk
pkgver=2209
pkgrel=1
pkgdesc="A collection of Open Source tools and libraries written for the Sony Playstation Portable (PSP)."
url="http://ps2dev.org/psp/Tools/Toolchain/"
depends=('psptoolchain')
makedepends=()
arch=('i686')
license="custom"

_svntrunk=svn://svn.pspdev.org/psp/trunk/pspsdk
_svnmod=pspsdk

build() {
  export PSPDEV="/usr/local/pspdev"
  export PATH="$PATH:$PSPDEV/bin" 
  cd $startdir/src
  svn co $_svntrunk $_svnmod
  cd $_svnmod/
  ./bootstrap
  ./configure --prefix=/usr/local/pspdev -with-pspdev=/usr/local/pspdev 
   make clean || return 1
   make DESTDIR=$startdir/pkg install-data 
   make clean || return 1
  ./configure --prefix=$startdir/pkg/usr/local/pspdev -with-pspdev=/usr/local/pspdev 
   make || return 1 
   make DESTDIR=$startdir/pkg install
}

Some explanation: I've used this one very often: --prefix=$startdir/pkg/usr/local/pspdev
Explanation: When I wanted to create only one PKGBUILD for the psptoolchain, some dependences were in $startdir/pkg. If you take  --prefix=/usr/local/pspdev he won't get some depencies (mostly header files), which means I had to create single PKGBUILD's for every part of the psptoolchain (that would be 6 single parts).

Those --prefix-changes don't stop my psp environment from working! (tested it myself - I comiled almos all sample apps which were included in the pspsdk - and all compiled well)

I hope we can find a better solution than mine.
Thanks in advance
XazZ

Offline

#11 2007-04-19 16:00:23

XazZ
Member
From: Munich, Germany
Registered: 2006-12-30
Posts: 72

Re: Help needed: making a psptoolchain package for arch

Hi everyone...

I've read a bit through the forums again...
I think I've found another method to fix my problem, but I don't know if it's a good idea..
The magic word is: sed
But I'm not sure if hacking the makefile is the best solution...

Thanks in advance
XazZ

Offline

#12 2007-04-26 17:11:12

loserMcloser
Member
From: Canada
Registered: 2004-12-15
Posts: 130

Re: Help needed: making a psptoolchain package for arch

If you don't already know about it, the Cross LFS documentation might be useful in trying to build a cross-compiling toolchain. I don't know anything about cross-compiling for PSP though, so maybe there's nothing there for you.

http://trac.cross-lfs.org/

Offline

#13 2007-04-26 17:31:23

XazZ
Member
From: Munich, Germany
Registered: 2006-12-30
Posts: 72

Re: Help needed: making a psptoolchain package for arch

loserMcloser wrote:

If you don't already know about it, the Cross LFS documentation might be useful in trying to build a cross-compiling toolchain. I don't know anything about cross-compiling for PSP though, so maybe there's nothing there for you.

http://trac.cross-lfs.org/

Hi...
Thanks for your reply, but my problem is not compiling software for psp...
My problem is that I got some trouble with making a pacman-package for the psptoolchain...

But thanks for your post...
XazZ

Offline

Board footer

Powered by FluxBB