364 lines
6.0 KiB
HTML
364 lines
6.0 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>GCC compiler</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="PA-RISC/Linux Boot HOWTO"
|
|
HREF="index.html"><LINK
|
|
REL="UP"
|
|
TITLE="Building and installing a custom kernel"
|
|
HREF="vmlinux.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Building and installing a custom kernel"
|
|
HREF="vmlinux.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Kernel configuration"
|
|
HREF="kernelconf.html"></HEAD
|
|
><BODY
|
|
CLASS="sect1"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>PA-RISC/Linux Boot HOWTO</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="vmlinux.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
>Chapter 5. Building and installing a custom kernel</TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="kernelconf.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="sect1"
|
|
><H1
|
|
CLASS="sect1"
|
|
><A
|
|
NAME="gcc"
|
|
></A
|
|
>5.1. GCC compiler</H1
|
|
><DIV
|
|
CLASS="highlights"
|
|
><A
|
|
NAME="AEN1304"
|
|
></A
|
|
><P
|
|
> You can build the kernel directly on your own PA-RISC box (<EM
|
|
>self-hosted</EM
|
|
>
|
|
or <EM
|
|
>native</EM
|
|
> build).
|
|
But on old systems, you may prefer to use another - faster - non PA-RISC computer
|
|
to compile your kernel (<EM
|
|
>cross-compilation</EM
|
|
>). We will see the
|
|
two possibilities.
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="note"
|
|
><P
|
|
></P
|
|
><TABLE
|
|
CLASS="note"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="25"
|
|
ALIGN="CENTER"
|
|
VALIGN="TOP"
|
|
><IMG
|
|
SRC="../images/note.gif"
|
|
HSPACE="5"
|
|
ALT="Note"></TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
><P
|
|
> By the time version 1.0 of this howto was released, only gcc-3.0.X was able
|
|
to build working kernels. There was a bug in more recent versions that made
|
|
the box crash when network activity occurs. It should be fixed by now, so
|
|
using the latest version of gcc should be fine. If ever the above mentioned
|
|
bug occurs, you'll know what's wrong. Anyway, if you want to build
|
|
any kernel after 2.6.12-rc3, you will need at least <B
|
|
CLASS="command"
|
|
>gcc-3.3</B
|
|
>.
|
|
</P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="nativebuild"
|
|
></A
|
|
>5.1.1. Native build</H2
|
|
><P
|
|
> Since Debian was the first distribution to support PA-RISC architecture,
|
|
if you want to use the <EM
|
|
>Super Cow</EM
|
|
> powers,
|
|
you need to have some basic knowledge about the Debian packaging system.
|
|
We will explain here how to quickly get a gcc compiler ready on your PA-RISC box.
|
|
If you are not using Debian, well, we're afraid we can't do much
|
|
for you: you will have to transpose what is said below to your distribution.
|
|
We will assume you know how to use
|
|
</P
|
|
><P
|
|
> If you are using your own PA-RISC box, you only need the good old
|
|
<B
|
|
CLASS="command"
|
|
>GCC</B
|
|
> compiler. You can install the required tools to build a
|
|
kernel by issuing:
|
|
</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> <TT
|
|
CLASS="prompt"
|
|
>[user@machine ~/dir]></TT
|
|
> <B
|
|
CLASS="command"
|
|
>apt-get</B
|
|
> <TT
|
|
CLASS="userinput"
|
|
><B
|
|
>install build-essential libncurses5-dev</B
|
|
></TT
|
|
>
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
> Essentially, this will install everything you need to build a kernel
|
|
(and even a bit more). This boils down to <B
|
|
CLASS="command"
|
|
>binutils</B
|
|
>,
|
|
<B
|
|
CLASS="command"
|
|
>gcc</B
|
|
>, <B
|
|
CLASS="command"
|
|
>libc-dev</B
|
|
>, <B
|
|
CLASS="command"
|
|
>make</B
|
|
>,
|
|
<B
|
|
CLASS="command"
|
|
>fileutils</B
|
|
> and <B
|
|
CLASS="command"
|
|
>libncurses5-dev</B
|
|
>.
|
|
</P
|
|
><P
|
|
>When this is done, you can proceed to the kernel settings.</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="crosscompile"
|
|
></A
|
|
>5.1.2. Cross compiled build</H2
|
|
><P
|
|
> In this kernel build method, everything depends on the architecture
|
|
of your building machine. If you want to compile your own toolchain, there
|
|
is a slightly out-of-date HOWTO (<A
|
|
HREF="biblio.html#bibxc"
|
|
><SPAN
|
|
CLASS="abbrev"
|
|
>O'Donell 2002</SPAN
|
|
></A
|
|
>). Otherwise, we
|
|
assume you can either find a cross-compiler package for your build host, or
|
|
make one by yourself.
|
|
</P
|
|
><DIV
|
|
CLASS="important"
|
|
><P
|
|
></P
|
|
><TABLE
|
|
CLASS="important"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="25"
|
|
ALIGN="CENTER"
|
|
VALIGN="TOP"
|
|
><IMG
|
|
SRC="../images/important.gif"
|
|
HSPACE="5"
|
|
ALT="Important"></TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
><P
|
|
> As there is not yet a 64bit userspace on HP-PA, you have to cross-compile
|
|
64bit kernel even if you are building on a 64bit PA-RISC box. You can get
|
|
unofficial debs for hppa64 compilers and binutils by running for instance:
|
|
<TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> <TT
|
|
CLASS="prompt"
|
|
>[user@machine ~/dir]></TT
|
|
> <B
|
|
CLASS="command"
|
|
>apt-get</B
|
|
> <TT
|
|
CLASS="userinput"
|
|
><B
|
|
>install gcc-3.3-hppa64 binutils-hppa64</B
|
|
></TT
|
|
>
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
>
|
|
See the <A
|
|
HREF="http://www.parisc-linux.org/"
|
|
TARGET="_top"
|
|
>PA-RISC Linux Website</A
|
|
>
|
|
for details.
|
|
</P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="vmlinux.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="kernelconf.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Building and installing a custom kernel</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="vmlinux.html"
|
|
ACCESSKEY="U"
|
|
>Up</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>Kernel configuration</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |