[FE training-materials-updates] Elaborate on how to set ARCH and CROSS_COMPILE
Michael Opdenacker
michael.opdenacker at free-electrons.com
Wed Oct 3 07:58:53 CEST 2012
Repository : git://git.free-electrons.com/training-materials.git
On branch : master
Link : http://git.free-electrons.com/training-materials/commit/?id=aedbe78eeeeaae1936ce279444859605df3f230e
>---------------------------------------------------------------
commit aedbe78eeeeaae1936ce279444859605df3f230e
Author: Michael Opdenacker <michael.opdenacker at free-electrons.com>
Date: Wed Oct 3 06:44:57 2012 +0200
Elaborate on how to set ARCH and CROSS_COMPILE
>---------------------------------------------------------------
aedbe78eeeeaae1936ce279444859605df3f230e
.../sysdev-linux-intro-cross-compilation.tex | 41 ++++++++++++++------
1 file changed, 29 insertions(+), 12 deletions(-)
diff --git a/slides/sysdev-linux-intro-cross-compilation/sysdev-linux-intro-cross-compilation.tex b/slides/sysdev-linux-intro-cross-compilation/sysdev-linux-intro-cross-compilation.tex
index 2a4d94a..a643a2b 100644
--- a/slides/sysdev-linux-intro-cross-compilation/sysdev-linux-intro-cross-compilation.tex
+++ b/slides/sysdev-linux-intro-cross-compilation/sysdev-linux-intro-cross-compilation.tex
@@ -18,8 +18,8 @@
\end{itemize}
\end{frame}
-\begin{frame}[fragile]
- \frametitle{Specifying cross-compilation}
+\begin{frame}
+ \frametitle{Specifying cross-compilation (1)}
The CPU architecture and cross-compiler prefix are defined through
the \code{ARCH} and \code{CROSS_COMPILE} variables in the toplevel
@@ -28,21 +28,38 @@
\begin{itemize}
\item \code{ARCH} is the name of the architecture. It is defined by
the name of the subdirectory in \code{arch/} in the kernel sources
+ \begin{itemize}
+ \item Example: \code{arm} if you want to compile a kernel for
+ the \code{arm} architecture.
+ \end{itemize}
\item \code{CROSS_COMPILE} is the prefix of the cross compilation
tools
\begin{itemize}
\item Example: \code{arm-linux-} if your compiler is \code{arm-linux-gcc}
\end{itemize}
- \item Two solutions
- \begin{itemize}
- \item Pass \code{ARCH} and \code{CROSS_COMPILE} on the \code{make}
- command line
- \item Define \code{ARCH} and \code{CROSS_COMPILE} as environment
- variables
- \item Don't forget to have the values properly set at all steps,
- otherwise the kernel configuration and build system gets
- confused
- \end{itemize}
+ \end{itemize}
+\end{frame}
+
+\begin{frame}
+ \frametitle{Specifying cross-compilation (2)}
+
+ Two solutions to define \code{ARCH} and \code{CROSS_COMPILE}:
+
+ \begin{itemize}
+ \item Pass \code{ARCH} and \code{CROSS_COMPILE} on the \code{make}
+ command line: \\
+ \code{make ARCH=arm CROSS_COMPILE=arm-linux- ...} \\
+ Not recommended, because you can screw up your build and
+ configuration if you ever forget to pass these variables when
+ you run any \code{make} command.
+ \item Define \code{ARCH} and \code{CROSS_COMPILE} as environment
+ variables: \\
+ \code{export ARCH=arm} \\
+ \code{export CROSS_COMPILE=arm-linux-} \\
+ Recommended solution, but it only works inside the current
+ shell or terminal. You may put these settings in your
+ \code{~/.bashrc} file to make them permanent and visible from
+ anywhere.
\end{itemize}
\end{frame}
More information about the training-materials-updates
mailing list