Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ps3 - gcc-4.3.1 (-mcpu=cell), crossdev, toolchain & more...
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
hal2050
n00b
n00b


Joined: 19 Jul 2008
Posts: 33

PostPosted: Sat Jul 19, 2008 11:30 pm    Post subject: ps3 - gcc-4.3.1 (-mcpu=cell), crossdev, toolchain & more Reply with quote

hello ppc/cell-friends, :)

i've got a couple of questions regarding gentoo@ps3, gcc 4.3.1 (-mcpu cell), crossdev and toolchain. ok then, let's start... ^^

1. gcc and crossdev
i followed the guide on http://overlays.gentoo.org/proj/cell to get a running gentoo system on my ps3. i decided to use the available stage4 at http://gentoo.osuosl.org/experimental/ppc64/livecd/, using a 64bit kernel / 32bit userland. everything went fine so far. after finishing the installationprocess i started to customize the system to my needs.
while editing my make.conf, i regognized that "-mcpu=970" was set. in accordance to http://gentoo-wiki.com/Safe_Cflags#PowerPC_970_.28G5.29 the recommendation is to use "-mcpu=cell" for a better performance on cell based machines. condition for an use of "-mcpu=cell" is an upgrade from gcc-4.1.2 to gcc-4.3.1. i ran the upgrade to the latest gcc (4.3.1) together with upgrades to the latest versions of glibc, linux-headers and binuntils. afterwards i executed the needed "emerge -e system" followed by a "emerge -e world". no problem so far, aside from some packages that wouldn't emerge, but also upgrading them to the latest versions worked for me. these are the following ebuilds:

Code:
sys-apps/net-tools  >> upgrade to 1.60_p20071202044231-r1
sys-libs/gpm-1.20.1-r6  >> upgrade to 1.2.0.5
net-misc/netkit-rsh-0.17-r8 >> upgrade to 0.17-r9
dev-libs/elfutils-0.127 >> updrade to 0.131-r2
sys-auth/consolekit-0.2.3 >> upgrade to 0.2.10


so right now, my entire system was recompiled using the make.conf given below:

Code:
cat /etc/make.conf
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /etc/make.conf.example for a more detailed example.

CFLAGS="-O2 -pipe -mcpu=cell -mabi=altivec"
CXXFLAGS="-O2 -pipe -mcpu=cell -mabi=altivec"

# This should not be changed unless you know exactly what you are doing.  You
# should probably be using a different stage, instead.
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing it.

CHOST="powerpc-unknown-linux-gnu"

USE="alsa altivec avahi bash-completion dbus fbcon nls nptl nptlonly unicode X -arts -cups -debug -doc -ipv6 -ldap -qt3 -qt4 -selinux"

MAKEOPTS="-j2"
FEATURES="candy ccache fixpackages parallel-fetch userfetch"
CCACHE_SIZE="2G"
PORTAGE_NICENESS="-10"
CCACHE_DIR="/root/.ccache"

VIDEO_CARDS="fbdev"
LINGUAS="de"

GENTOO_MIRRORS="http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/"
source /usr/local/portage/layman/make.conf


ok so far so good. now my gentoo-system should consist of cell-optimized binaries. isn't it? please correct me if i'm wrong...
ah wait, there is one more little thing to recompile, the kernel itself. "ok not much trouble..." i thought, "...just recompile the kernel using the new installed gcc-4.3.1." i should tell "make" to use crossdev for compiling the kernel. i did like i thought by adding the following line to "usr/src/linux/Makefile":

Code:
CROSS_COMPILE   ?= powerpc64-unknown-linux-gnu-


that works without a problem, but i am of the opinion, that crossdev is using gcc-4.2.1 instead of gcc-4.3.1.

Code:
gcc-config -l
 [1] powerpc64-unknown-linux-gnu-4.1.2 *

 [2] powerpc-unknown-linux-gnu-4.1.2
 [3] powerpc-unknown-linux-gnu-4.3.1 *


well, how can i tell crossdev to upgrade the crossdev-environment to the latest gcc? i never used crossdev before. therefore i tried to gather information from http://www.gentoo.org/proj/en/base/embedded/handbook/?part=1 and http://psas.pdx.edu/GentooCrossCompilerHowto/
as far as i understood, it's satisfying to execute the following command:

Code:
crossdev -t powerpc64-unknown-linux-gnu-gcc


i also tried

Code:
crossdev --b 2.18-r3 --g 4.3.1 --k 2.6.25-r4 --l 2.8_p20080602 --target powerpc64-unknown-linux-gnu-gcc


to define the versions exactly. but both attempts ended up as shown below:

Code:
crossdev --b 2.18-r3 --g 4.3.1 --k 2.6.25-r4 --l 2.8_p20080602 --target powerpc64-unknown-linux-gnu
---------------------------------------------------------------------------------------------------------------
 * Host Portage ARCH:     ppc
 * Target Portage ARCH:   ppc64
 * Target System:         powerpc64-unknown-linux-gnu
 * Stage:                 4 (C/C++ compiler)

 * binutils:              binutils-2.18-r3
 * gcc:                   gcc-4.3.1
 * headers:               linux-headers-2.6.25-r4
 * libc:                  glibc-2.8_p20080602

 * PORTDIR_OVERLAY:       /usr/local/portage/layman/cell
 * PORT_LOGDIR:           /var/log/portage
 * PKGDIR:                /usr/portage/packages/cross/powerpc64-unknown-linux-gnu
 * PORTAGE_TMPDIR:        /var/tmp/cross/powerpc64-unknown-linux-gnu
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -
 * Forcing the latest versions of {binutils,gcc}-config/gnuconfig ...                                                                                                                                                                [ ok ]
 * Log: /var/log/portage/cross-powerpc64-unknown-linux-gnu-binutils.log
 * Emerging cross-binutils ...                                                                                                                                                                                                       [ ok ]
 * Log: /var/log/portage/cross-powerpc64-unknown-linux-gnu-linux-headers-quick.log
 * Emerging cross-linux-headers-quick ...                                                                                                                                                                                            [ ok ]
 * Log: /var/log/portage/cross-powerpc64-unknown-linux-gnu-glibc-headers.log
 * Emerging cross-glibc-headers ...

 * glibc failed :(
 * If you file a bug, please attach the following logfiles:
 * /var/log/portage/cross-powerpc64-unknown-linux-gnu-info.log
 * /var/log/portage/cross-powerpc64-unknown-linux-gnu-glibc-headers.log


/var/log/portage/cross-powerpc64-unknown-linux-gnu-glibc-headers.log:

Code:
checking installed Linux kernel header files... TOO OLD!
configure: error: GNU libc requires kernel header files from
Linux 2.0.10 or later to be installed before configuring.
The kernel header files are found usually in /usr/include/asm and
/usr/include/linux; make sure these directories use files from
Linux 2.0.10 or later.  This check uses <linux/version.h>, so
make sure that file was built correctly when installing the kernel header
files.  To use kernel headers not from /usr/include/linux, use the
configure option --with-headers.
 *
 * ERROR: cross-powerpc64-unknown-linux-gnu/glibc-2.8_p20080602 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 3753:  Called eblit-run 'src_compile'
 *             environment, line 1151:  Called eblit-glibc-src_compile
 *       src_compile.eblit, line  155:  Called toolchain-glibc_headers_compile
 *       src_compile.eblit, line  150:  Called die
 * The specific snippet of code:
 *      CC=gcc \
 *      CFLAGS="-O1 -pipe" \
 *      "${S}"/configure ${myconf} || die "failed to configure glibc"
 *  The die message:
 *   failed to configure glibc
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/cross/powerpc64-unknown-linux-gnu/portage/cross-powerpc64-unknown-linux-gnu/glibc-2.8_p20080602/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/cross/powerpc64-unknown-linux-gnu/portage/cross-powerpc64-unknown-linux-gnu/glibc-2.8_p20080602/temp/environment'.
 * This ebuild is from an overlay: '/usr/local/portage/layman/cell/'
 *


hm the log shows up with a message complaining about linux header files. the seem to bei too old. but portage tells me, that the latest versions are already installed:

Code:
* sys-kernel/linux-headers
      Latest version available: 2.6.25-r4
      Latest version installed: 2.6.25-r4
      Size of files: 3,791 kB
      Homepage:      http://www.kernel.org/ http://www.gentoo.org/
      Description:   Linux system headers
      License:       GPL-2

* cross-powerpc64-unknown-linux-gnu/linux-headers
      Latest version available: 2.6.25-r4
      Latest version installed: 2.6.25-r4
      Size of files: 3,791 kB
      Homepage:      http://www.kernel.org/ http://www.gentoo.org/
      Description:   Linux system headers
      License:       GPL-2


so what am i doing wrong here?

2. toolchain
i found several tutorials/howtos that deal with the installation of the cell toolchain.
e.g.:

- http://overlays.gentoo.org/proj/cell/wiki/InstallToolchain
- http://www.daniel.jp/joomla/info/ps3/creating-ps3-toolchains-on-gentoo.html
- http://masqserv.serpe-net.it:81/mirko/blog/comments.php?y=07&m=11&entry=entry071120-000622
- http://gentoo-wiki.com/HOWTO_spu-elf-gcc_toolchain

since i'm not a developer, i'm not quite sure what this toolchain is used for. do i need it to get a cell optimized system? or is it rather for developing optimized software for the cell architecture?

3. spufs
is it a must to compile spufs as module or is it safe to compile spufs directly into the kernel?
how is it about other modules like wifi, bluetooth, ethernet?
in general i personally prefer a monolithic kernel instead of using a modularized one...

4. performance - 32bit/64bit
i always read that people use either a 64bit kernel / 64bit ul or a 64bit kernel / 32bit ul. i think the choice of a 32bit ul is based on compatibility reasons. but what about the overall performance? are there any good references out in the web, that compare these two different scenarios on a ps3?
what about the performance of a 32bit kernel / 32bit ul system? a friend of mine told me he read somewhere that this combination should give the best performance. but i couldn't find any references, that are concerned with this topic.

5. fbsplash?
ah one more thing, i'd like to know, about what i couldn't gather any information on the web. is it possible to use fbsplash on cell based systems together with kboot or a bootparameter within the kernel (ps3-sources)? i didn't find appropriate options in the kernel. therefore i guess that i have to patch the kernel manually. any experience?

best regards && thanks in advance,
hal2050
Back to top
View user's profile Send private message
corsair
Retired Dev
Retired Dev


Joined: 06 Oct 2003
Posts: 451
Location: Aachen, Germany

PostPosted: Sun Jul 20, 2008 9:21 am    Post subject: Reply with quote

try the stable glibc-2.7-r2 please. glibc-2.8 changed many header files and does not play nice with other stable versions, yet.
Back to top
View user's profile Send private message
hal2050
n00b
n00b


Joined: 19 Jul 2008
Posts: 33

PostPosted: Sun Jul 20, 2008 1:14 pm    Post subject: Reply with quote

thanks for your reply. i'm going to try that immediately. but do you mean to use glibc-2.7-r2 within the crossdev environment or in general?
Back to top
View user's profile Send private message
Pseudonimo
Guru
Guru


Joined: 10 Mar 2007
Posts: 393

PostPosted: Sun Jul 20, 2008 5:54 pm    Post subject: Reply with quote

Hi,

You should use the same version in the ps3 as in the system with crossdev cross-compiling.

The answer to your question, what is the toolchain, is :
http://www.gentoo.org/proj/en/base/embedded/handbook/index.xml?part=1&chap=1#doc_chap2

Where are you compiling the kernel?
_________________
Please search *well* before posting, look for bugs (check all status), use google syntax and *please* read the man pages and think. All obvious steps, frequently ignored. Add [solved] when finished.
Back to top
View user's profile Send private message
hal2050
n00b
n00b


Joined: 19 Jul 2008
Posts: 33

PostPosted: Sun Jul 20, 2008 6:01 pm    Post subject: Reply with quote

thanks for the link.

i'm compiling the kernel directly on the ps3. but i assume that i'm using gcc-4.2.1 for that.
to get compiling the kernel started, i added the following line to /usr/src/linux/Makefile:

Code:
CROSS_COMPILE   ?= powerpc64-unknown-linux-gnu-


so i get a 64bit kernel, at least i think so... :)

p.s. i've got a working splash screen during boot up. i'm going to post the parameters for kboot later this evening, since my girlfriend is playing games now...

edit1: how can i downgrade glibc? portage refuses to downgrade...

edit2: i took a look at your link, pseudonimo. i guess i expressed myself in a wrong way. :) in general in know what a toolchain is, but i'm not quite sure why i would need the spu-toolchain (e.g. http://overlays.gentoo.org/proj/cell/wiki/binary). would i need it to optimize my gentoo a bit more for cell and its spu or would i need it for developing new software that supports natively the spu? aside from that, would i need the spu-toolchain (cross-spu-elf/binutils cross-spu-elf/gcc cross-spu-elf/newlib
) if i already upgraded my system's toolchain itself to the latest versions (gcc-4.3.1, glibc-2.7/2.8,...)?
Back to top
View user's profile Send private message
Pseudonimo
Guru
Guru


Joined: 10 Mar 2007
Posts: 393

PostPosted: Mon Jul 21, 2008 1:43 am    Post subject: Reply with quote

I don't know all the answers for your post.

What error do you get when downgrading? Never tried..

Your system's toolchain and spu-toolchain are independent toolchains. Actually when one builds the cell toolchain (in crossdev for example) one gets nothing less than the ppu and spu toolchains. So, what you did probably was updating the ppu toolchain (which runs the OS), you probably should have the spu toolchain in the same version.

I don't know if there are already applications in portage that would make use of it, but there are in the web, so you should keep both.
_________________
Please search *well* before posting, look for bugs (check all status), use google syntax and *please* read the man pages and think. All obvious steps, frequently ignored. Add [solved] when finished.
Back to top
View user's profile Send private message
hal2050
n00b
n00b


Joined: 19 Jul 2008
Posts: 33

PostPosted: Tue Jul 22, 2008 2:27 pm    Post subject: Reply with quote

Quote:
What error do you get when downgrading? Never tried..

portage just tries to keep me off to do bad things... :)
Code:
* checking ebuild checksums ;-) ...                                                                                                                                                                                                [ok ]
 * checking auxfile checksums ;-) ...                                                                                                                                                                                                [ ok ]
 * checking miscfile checksums ;-) ...                                                                                                                                                                                               [ ok ]
 * checking glibc-2.7.tar.bz2 ;-) ...                                                                                                                                                                                                [ ok ]
 * checking glibc-libidn-2.7.tar.bz2 ;-) ...                                                                                                                                                                                         [ ok ]
 * checking glibc-ports-2.7.tar.bz2 ;-) ...                                                                                                                                                                                          [ ok ]
 * checking glibc-2.7-patches-1.7.tar.bz2 ;-) ...                                                                                                                                                                                    [ ok ]
 * Sanity check to keep you from breaking your system:
 *  Downgrading glibc is not supported and a sure way to destruction
 *
 * ERROR: sys-libs/glibc-2.7-r2 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called pkg_setup
 *     glibc-2.7-r2.ebuild, line  198:  Called die
 * The specific snippet of code:
 *            die "aborting to save your system"
 *  The die message:
 *   aborting to save your system
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/sys-libs/glibc-2.7-r2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-libs/glibc-2.7-r2/temp/die.env'.
 *


Quote:
Your system's toolchain and spu-toolchain are independent toolchains. Actually when one builds the cell toolchain (in crossdev for example) one gets nothing less than the ppu and spu toolchains. So, what you did probably was updating the ppu toolchain (which runs the OS), you probably should have the spu toolchain in the same version.


ok.
is it possible to have more than two toolchains? atm i've got a 32bit toolchain (os) because of the 32bit ul. and a 64bit toolchain in crossdev for compiling a 64bit kernel. the third one could possibly be the spu-toolchain.
Back to top
View user's profile Send private message
Pseudonimo
Guru
Guru


Joined: 10 Mar 2007
Posts: 393

PostPosted: Fri Aug 01, 2008 10:07 am    Post subject: Reply with quote

I believe it's sys-devel/kgcc64 you're looking for?

edit: I don't have access to my ps3 untill tomorrow so can't check, just have been researching the net :)
edit2: removed incorrect link
_________________
Please search *well* before posting, look for bugs (check all status), use google syntax and *please* read the man pages and think. All obvious steps, frequently ignored. Add [solved] when finished.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum