Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 240005 Details for
Bug 302129
Gentoo Embedded Handbook: Chapter 1: General Improvement Patches
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Rebased 005 and 006 patches
rebased-005-and-006.patch (text/plain), 13.29 KB, created by
Jacob Godserv
on 2010-07-24 15:29:00 UTC
(
hide
)
Description:
Rebased 005 and 006 patches
Filename:
MIME Type:
Creator:
Jacob Godserv
Created:
2010-07-24 15:29:00 UTC
Size:
13.29 KB
patch
obsolete
>diff -ru handbook/cross-compiler.xml handbook_new/cross-compiler.xml >--- handbook/cross-compiler.xml 2010-04-13 14:45:31.000000000 -0400 >+++ handbook/cross-compiler.xml 2010-07-24 11:22:54.655923716 -0400 >@@ -152,24 +152,61 @@ > </p> > > <pre caption="Using SH4 cross-compiler"> >-$ <i>sh4-unknown-linux-gnu-gcc --version</i> >+# <i>sh4-unknown-linux-gnu-gcc --version</i> > sh4-unknown-linux-gnu-gcc (GCC) 4.2.0 (Gentoo 4.2.0 p1.4) > Copyright (C) 2007 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. >-$ <i>echo 'int main(){return 0;}' > sh4-test.c</i> >-$ <i>sh4-unknown-linux-gnu-gcc -Wall sh4-test.c -o sh4-test</i> >-$ <i>file sh4-test</i> >+# <i>echo 'int main(){return 0;}' > sh4-test.c</i> >+# <i>sh4-unknown-linux-gnu-gcc -Wall sh4-test.c -o sh4-test</i> >+# <i>file sh4-test</i> > sh4-test: ELF 32-bit LSB executable, Renesas SH, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), not stripped > </pre> > > <p> >-If the crossdev command failed, you have the log file which you can review to >+If the crossdev command failed, you are told the log file which you can review to > see if the problem is local. If you're unable to fix the issue, you're welcome > to file a bug in our bugzilla. See the <uri > link="communication.xml">Communication page</uri> for more information. > </p> > >+<p> >+To find out which tuple you should use, look over the output from the following >+command: >+</p> >+ >+<pre caption="crossdev Tuples"> >+# <i>crossdev -t help</i> >+</pre> >+ >+<p> >+You can now find a newly compiled cross-compiler in the sysroot at >+<path>/usr/CTARGET/</path>. It's a good idea to create pre-built binary packages >+so you don't end up waiting another two to three hours every time you want to >+reinstall this toolchain. >+</p> >+ >+<pre caption="Create binpkgs"> >+# <i>quickpkg --include-unmodified-config=y cross-sh4-unknown-linux-gnu/gcc</i> >+# <i>quickpkg --include-unmodified-config=y cross-sh4-unknown-linux-gnu/glibc</i> >+# <i>quickpkg --include-unmodified-config=y cross-sh4-unknown-linux-gnu/binutils</i> >+# <i>quickpkg --include-unmodified-config=y cross-sh4-unknown-linux-gnu/linux-headers</i> >+</pre> >+ >+<note> >+If quickpkg warns you about excluded files, please follow its prompts to include >+all files. >+</note> >+ >+<p> >+In the future you can reinstall your sysroot by executing the following simple >+portage command: >+</p> >+ >+<pre caption="Emerge binpkgs"> >+# <i>emerge -k cross-sh4-unknown-linux-gnu/gcc cross-sh4-unknown-linux-gnu/glibc cross-sh4-unknown-linux-gnu/binutils cross-sh4-unknown-linux-gnu/linux-headers</i> >+</pre> >+ > </body> > </subsection> > >@@ -179,8 +216,8 @@ > > <p> > To uninstall a toolchain, simply use the <c>--clean</c> option. If you modified >-the sysroot by hand, you'll be prompted to delete things inside of it, so you >-may want to pipe <c>yes |</c> into the command. >+the sysroot by hand, you'll be prompted to delete every file inside, so you will >+want to prepend <c>yes |</c> to this command <b>if</b> you are sure. > </p> > > <pre caption="Uninstalling cross-compiler"> >@@ -194,17 +231,6 @@ > > </body> > </subsection> >-<subsection> >-<title>Options</title> >-<body> >- >-<p> >-Obviously crossdev can do a lot more, so to find out more, simply run >-<c>crossdev --help</c>. >-</p> >- >-</body> >-</subsection> > </section> > > <section> >@@ -220,16 +246,20 @@ > meant to cover/document/whatever the myriad of build failures you are likely > to see along the way. If you need such help, see the > <uri link="the-more-you-know.xml">Beyond section</uri> in the handbook for >-some pointers. You certainly should not bug me or anyone else in Gentoo. >+some pointers. > </warn> > > <warn> >+Let's be very clear: we do <b>not</b> support toolchains which are built by hand! >+</warn> >+ >+<note> > If you're still reading, you should really check out the crosstool project > (refer to the <uri link="the-more-you-know.xml">Beyond section</uri>) as > that provides a distribution independent method for generating cross-compilers. > While it does kind of suck (imo), it is certainly the best (and really only) > option out there for creating cross-compilers. >-</warn> >+</note> > </body> > </subsection> > >@@ -349,13 +379,13 @@ > </p> > > <pre caption="configure and build binutils"> >-$ <i>./configure \ >+# <i>./configure \ > --target=$CTARGET \ > --prefix=/usr \ > --with-sysroot=/usr/$CTARGET \ > --disable-werror</i> >-$ <i>make</i> >-$ <i>make install DESTDIR=$PWD/install-root</i> >+# <i>make</i> >+# <i>make install DESTDIR=$PWD/install-root</i> > </pre> > > <p> >@@ -366,7 +396,7 @@ > </p> > > <pre caption="cleaning binutils"> >-$ <i>rm -rf install-root/usr/{info,lib,man,share}</i> >+# <i>rm -rf install-root/usr/{info,lib,man,share}</i> > </pre> > > <p> >@@ -395,7 +425,7 @@ > </note> > > <pre caption="building/installing unsanitized headers"> >-$ <i>yes "" | make ARCH=$ARCH oldconfig prepare</i> >+# <i>yes "" | make ARCH=$ARCH oldconfig prepare</i> > # <i>mkdir -p /usr/$CTARGET/usr/include</i> > # <i>cp -a include/linux include/asm-generic /usr/$CTARGET/usr/include/</i> > # <i>cp -a include/asm-$ARCH /usr/$CTARGET/usr/include/asm</i> >@@ -416,9 +446,9 @@ > </p> > > <pre caption="building/installing glibc headers"> >-$ <i>mkdir build</i> >-$ <i>cd build</i> >-$ <i>../configure \ >+# <i>mkdir build</i> >+# <i>cd build</i> >+# <i>../configure \ > --host=$CTARGET \ > --prefix=/usr \ > --with-headers=/usr/$CTARGET/usr/include \ >@@ -455,9 +485,9 @@ > </p> > > <pre caption="building gcc stage 1"> >-$ <i>mkdir build</i> >-$ <i>cd build</i> >-$ <i>../configure \ >+# <i>mkdir build</i> >+# <i>cd build</i> >+# <i>../configure \ > --target=$CTARGET \ > --prefix=/usr \ > --with-sysroot=/usr/$CTARGET \ >@@ -468,8 +498,8 @@ > --disable-libmudflap \ > --disable-libssp \ > --disable-libgomp</i> >-$ <i>make</i> >-$ <i>make install DESTDIR=$PWD/install-root</i> >+# <i>make</i> >+# <i>make install DESTDIR=$PWD/install-root</i> > </pre> > > <p> >@@ -477,7 +507,7 @@ > </p> > > <pre caption="cleaning gcc stage 1"> >-$ <i>rm -rf install-root/usr/{info,include,lib/libiberty.a,man,share}</i> >+# <i>rm -rf install-root/usr/{info,include,lib/libiberty.a,man,share}</i> > </pre> > > <p> >@@ -499,14 +529,14 @@ > </p> > > <pre caption="building/installing glibc"> >-$ <i>rm -rf build</i> >-$ <i>mkdir build</i> >-$ <i>cd build</i> >-$ <i>../configure \ >+# <i>rm -rf build</i> >+# <i>mkdir build</i> >+# <i>cd build</i> >+# <i>../configure \ > --host=$CTARGET \ > --prefix=/usr \ > --without-cvs</i> >-$ <i>make</i> >+# <i>make</i> > # <i>make install install_root=/usr/$CTARGET</i> > </pre> > </body> >@@ -521,7 +551,7 @@ > </p> > > <pre caption="building/installing gcc stage 2"> >-$ <i>./configure \ >+# <i>./configure \ > --target=$CTARGET \ > --prefix=/usr \ > --with-sysroot=/usr/$CTARGET \ >@@ -529,7 +559,7 @@ > --enable-shared \ > --disable-checking \ > --disable-werror</i> >-$ <i>make</i> >+# <i>make</i> > # <i>make install</i> > </pre> > </body> >diff -ru handbook/cross-compiling-packages.xml handbook_new/cross-compiling-packages.xml >--- handbook/cross-compiling-packages.xml 2010-03-04 14:50:38.000000000 -0500 >+++ handbook/cross-compiling-packages.xml 2010-07-24 11:15:43.307806513 -0400 >@@ -60,12 +60,20 @@ > <body> > > <p> >-Cross-compiling a system generally involves two directory trees. The first is >-where all development files are normally installed. This is your sysroot. The >-other tree is where only your runtime files are installed. You emerge all of >-your fun packages into your sysroot (without trimming down any files), and then >-either install via binary packages or copying files by hand all the stuff you >-need in your runtime tree. >+Cross-compiling a system generally involves two directory trees. The differences >+between them can be difficult to understand, but they are important concepts to >+cross-compiling. >+</p> >+ >+<p> >+The first tree to consider is sysroot. Please read the >+<uri link="intro.xml">Introduction</uri> chapter for the sysroot definition. >+</p> >+ >+<p> >+The second tree is real root. This one is much simpler to understand: it's >+where you're trying to create a bootable stage3-like installation of Gentoo >+that you can copy to your target device. > </p> > > <p> >@@ -73,12 +81,26 @@ > sysroot as the include/library directories in this tree are already encoded > into the gcc cross-compiler for searching. You could use another directory > and then add custom -I/-L paths to your CPPFLAGS/LDFLAGS, but this has >-historically proven to be problematic. Yes, it works most of the time, but >-the corner cases are why this method is discouraged. In the embedded handbook, >-we'll assume you're using the sysroot as your development ROOT. >+historically proven to be problematic in enough corner cases to be discouraged >+for practical use. > </p> > > <p> >+A less common convention, but common nonetheless, is to set <c>ROOT</c> and >+<c>SYSROOT</c> to exactly the same thing. This seems odd, given the definitions >+and differences of <c>ROOT</c> and <c>SYSROOT</c>. Remember from the >+<uri link="intro.xml">Introduction</uri> chapter that the cross-compiler >+sometimes wants libraries preinstalled to <c>SYSROOT</c> first before they're >+used in <c>ROOT</c>, which often is enough aggravation to cause some to install >+everything to <c>SYSROOT</c>. What ends up happening is a mixed, somewhat messy >+<c>ROOT</c>/<c>SYSROOT</c> tree is installed to <c>SYSROOT</c>. However, as >+long as you're generating binary packages, you can later ignore the >+<c>SYSROOT</c>/<c>ROOT</c> directories entirely and install a new <c>ROOT</c> >+elsewhere using those binary packages. >+</p> >+ >+<!-- The following section needs more information about "why" and "how", if it's desired at all >+<p> > For your runtime system, you'll need a much slimmer/trimmed-down setup. The > files you remove from a normal installed package is why this tree is not > suitable for compiling against. If you build binary packages while installing >@@ -86,6 +108,7 @@ > the <c>INSTALL_MASK</c> variable to trim out most things. See <c>man > make.conf</c> for more information. > </p> >+--> > > </body> > </section> >@@ -106,6 +129,11 @@ > # <i>emerge crossdev</i> > </pre> > >+<warn> >+crossdev's wrappers automatically configure <c>CBUILD</c> and <c>CHOST</c>. >+Do not set these by hand in your environment! >+</warn> >+ > <p> > We can use these tools for both installing into your development root > (sysroot) and into your runtime root. For the latter, simply specify >@@ -126,7 +154,7 @@ > </p> > > <p> >-By default the wrappers will link to the generic embedded profile. This >+By default crossdev will link to the generic embedded profile. This > is done to simpilify things, but the user may wish to use a more > advanced targeted profile. In order to do that we can update the profile symlink. > </p> >@@ -136,8 +164,9 @@ > </pre> > > <p> >-And naturally to change settings for the target system like USE flags, >-FEATURES, and VIDEO_CARDS. We would edit the standard portage config files. >+To change settings for the target system like USE flags, FEATURES, and >+VIDEO_CARDS, edit the standard portage config files, wherever >+<c>PORTAGE_CONFIGROOT</c> points. > </p> > > <pre caption="${SYSROOT}/etc/make.conf"> >@@ -145,16 +174,18 @@ > </pre> > > <p> >-Sometimes there are some additional tests we need override for configure >-scripts. To do this the wrappers export a few variables to force the test to get >-the answer it should. This will help prevent bloat in packages which add local >-functions to workaround issues it assumes your system has because it could not >-run the test. From time to time you may find you need to add additional >-variables to these files in <path>/usr/share/crossdev/include/site/</path> to >-get a package to compile. To figure out the variable you need to add, it's often >-as simple as greping the configure script for the autoconf variable and adding >-it to the appropriate target file. This becomes obvious after the first few >-times of doing it. >+Sometimes there are some additional, cross-compile-incomplatible tests we >+need override for configure scripts. To do this crossdev exports a few variables >+to force the test to get the answer it should. This will help prevent bloat >+in packages which add local functions to workaround issues it assumes your >+<e>target</e> system has because it could not run the test while cross-compiling >+(because, of course, it's not running on the target system). From time to >+time you may find you need to add additional variables to these files in >+<path>/usr/share/crossdev/include/site/</path> to get a package to compile. >+To figure out the variable you need to add, it's often as simple as greping >+the configure script for the autoconf variable (which often begins with "ac_") >+and adding it to the appropriate target file. This becomes easy once you >+know what you're looking for. > </p> > > </body> >diff -ru handbook/intro.xml handbook_new/intro.xml >--- handbook/intro.xml 2010-04-13 14:45:31.000000000 -0400 >+++ handbook/intro.xml 2010-07-24 11:24:19.740172352 -0400 >@@ -176,8 +176,12 @@ > > <dt><c>sysroot: system root</c></dt> > <dd> >- The root directory a compiler uses to find its standard headers and >- libraries >+ This is where all the cross-compiler libraries and headers are installed. >+ In other words, every library and header the cross-compiler needs to generate >+ cross-compiled binaries are put here. In theory, this means the toolchain >+ is good enough. In practice, the cross-compiler often wants some of a >+ packages's library dependancies, such as ncurses, installed into sysroot >+ first. > </dd> > > <dt><c>hardfloat</c></dt>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 302129
:
217350
|
217352
|
217354
|
217356
|
217358
|
217359
|
217360
|
217361
|
217363
| 240005