From: Jim Freeman <jfree@sovereign.org>
To: Dan Kegel <dank@kegel.com>
Cc: Stephen Warren <SWarren@nvidia.com>,
crossgcc <crossgcc@sources.redhat.com>,
linuxppc-embedded@ozlabs.org
Subject: Re: FW: NPTL support on PPC32 (MPC5200) ?
Date: Wed, 13 Oct 2004 19:55:41 -0600 [thread overview]
Message-ID: <20041014015541.GC16252@sovereign.org> (raw)
In-Reply-To: <416BF876.4020606@kegel.com>
[-- Attachment #1: Type: text/plain, Size: 1880 bytes --]
The attached script (wrapper/setup to crosstool.sh) gets me
a toolchain sufficient to build the default-config ppc kernel
(2.6.8.1, NPTL, gcc-3.4.2, glibc-2.3.3).
It tweaks the patch Dan references below for a ppc-ism,
then adds a patch (thanks Google!) to mask an issue that
gcc-3.4.2 has with inline functions calling setjmp() ( see
http://mirrors.mathematik.uni-bielefeld.de/pub/linux/suse/ftp.suse.com/pub/projects/powerpc/ftp.linuxppc64.org/pub/people/janis/old/README.20040130
)
The toolchain build fails near the end while linking
build-glibc/elf/sln with undefined references to
`_Unwind_Resume' and `__gcc_personality_v0' (which Google
hints is/was a popular problem, but I don't have time to
track it down). In any case, 'sln' isn't needed for kernel
building, so it's good enough for me for now.
...jfree
========
On Tue, Oct 12, 2004 at 08:29:58AM -0700, Dan Kegel wrote:
> Hi Stephen,
> to build NPTL, you need to apply
> contrib/crosstool-0.28-rc34-nptl_fixes.patch
> Then see demo-x86_64-nptl.sh
>
> Enough people need this that I've been intending for two weeks to merge it
> asap,
> but I haven't gotten around to it.
>
> That patch was only tested for x86, but ppc32 shouldn't be any
> harder, right? :-)
> - Dan
>
> Stephen Warren wrote:
> >Hi. I'm attempting to use your crosstool to build a NPTL capable GLIBC
> >and toolchain for a 32-bit PowerPC target.
...
> >Thanks for any pointers at all!
> >
> >------------------------------------------------------------------------
> >
> >Subject: NPTL support on PPC32 (MPC5200) ?
> >From: "Stephen Warren" <SWarren@nvidia.com>
...
> >My question is - can anybody tell me, or point me at a website that
> >definitively tells me:
> >
> >1) Is NPTL available on PPC at all? I assume so, since I found one of
> >the original announcement of NPTL, which mentions performance on a large
> >SMP PPC system.
...
[-- Attachment #2: xgcc-booke --]
[-- Type: text/plain, Size: 2863 bytes --]
#!/bin/bash
set -x
# http://kegel.com/crosstool/
# http://sources.redhat.com/ml/binutils/2003-10/msg00448.html
# http://sources.redhat.com/ml/crossgcc/2004-03/msg00162.html
# http://sources.redhat.com/ml/binutils/2001-10/msg00186.html
## http://mirrors.mathematik.uni-bielefeld.de/pub/linux/suse/ftp.suse.com/pub/projects/powerpc/ftp.linuxppc64.org/pub/people/janis/old/README.20040130
## http://mirrors.mathematik.uni-bielefeld.de/pub/linux/suse/ftp.suse.com/pub/projects/powerpc/ftp.linuxppc64.org/pub/people/janis/old/glibc.patch.20040121 ;
[ ! -f crosstool-0.28-rc37.tar.gz ] && \
wget http://kegel.com/crosstool/crosstool-0.28-rc37.tar.gz || true
tar xzf crosstool-0.28-rc37.tar.gz
cd crosstool-0.28-rc37
pwd
## NPTL patch: when ARCH=ppc, dirname needs to be "powerpc"
## patch the patch ...
patch -p 0 <<HERE
--- contrib/crosstool-0.28-rc34-nptl_fixes.patch 2004/10/13 04:48:11 1.1
+++ contrib/crosstool-0.28-rc34-nptl_fixes.patch 2004/10/13 04:48:45
@@ -164,7 +164,7 @@
+ # will have to manually be copied from under the tree of the desired
+ # target pthread implementation.
+ cp \${GLIBC_DIR}/nptl/sysdeps/pthread/pthread.h \$HEADERDIR/pthread.h
-+ cp \${GLIBC_DIR}/nptl/sysdeps/unix/sysv/linux/\${ARCH}/bits/pthreadtypes.h \$HEADERDIR/bits/pthreadtypes.h
++ cp \${GLIBC_DIR}/nptl/sysdeps/unix/sysv/linux/\${ARCH/ppc/powerpc}/bits/pthreadtypes.h \$HEADERDIR/bits/pthreadtypes.h
+
+ # On s390, powerpc and sparc we also require bits/wordsize.h.
+ case \$TARGET in
HERE
# now apply the patch ...
patch -p 1 < contrib/crosstool-0.28-rc34-nptl_fixes.patch
## gcc3.4.2 disallows setjmp() in inline functions:
## http://mirrors.mathematik.uni-bielefeld.de/pub/linux/suse/ftp.suse.com/pub/projects/powerpc/ftp.linuxppc64.org/pub/people/janis/old/README.20040130
## then fixup to only use first part of patch (and doctor for "patch -p1") ...
( cd patches/glibc-2.3.3;
wget http://mirrors.mathematik.uni-bielefeld.de/pub/linux/suse/ftp.suse.com/pub/projects/powerpc/ftp.linuxppc64.org/pub/people/janis/old/glibc.patch.20040121 ;
ed glibc.patch.20040121 <<HERE
/Makefile
.,\$d
,s#sysdeps#foo/sysdeps#g
wq
HERE
)
TARBALLS_DIR=`pwd`/.. \
TARGET=powerpc-8540-linux-gnu \
TARGET_CFLAGS="-O -msoft-float -mno-string -Wa,-me500" \
GCC_EXTRA_CONFIG="" \
GCC_LANGUAGES="c" \
GLIBC_EXTRA_CONFIG="--without-fp" \
GLIBC_ADDON_NPTL=1 \
BINUTILS_DIR=binutils-2.15 \
GCC_DIR=gcc-3.4.2 \
GLIBC_DIR=glibc-2.3.3 \
LINUX_DIR=linux-2.6.8.1 \
./all.sh --testlinux
# now,
# cd build/powerpc-8540-linux-gnu/gcc-3.4.2-glibc-2.3.3/linux-2.6.8.1
# ( or wherever your kernel of interest lives )
# make V=1 ARCH=ppc CROSS_COMPILE=/work/src/crosstool-0.28-rc37/result/powerpc-8540-linux-gnu/gcc-3.4.2-glibc-2.3.3/bin/powerpc-8540-linux-gnu-
prev parent reply other threads:[~2004-10-14 1:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <DBFABB80F7FD3143A911F9E6CFD477B0021B045A@hqemmail02.nvidia.com>
2004-10-12 15:29 ` FW: NPTL support on PPC32 (MPC5200) ? Dan Kegel
2004-10-13 5:18 ` Jim Freeman
2004-10-13 5:42 ` Jim Freeman
2004-10-14 1:55 ` Jim Freeman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041014015541.GC16252@sovereign.org \
--to=jfree@sovereign.org \
--cc=SWarren@nvidia.com \
--cc=crossgcc@sources.redhat.com \
--cc=dank@kegel.com \
--cc=linuxppc-embedded@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.