aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Heiko Becker <heirecka@exherbo.org> 2016-08-28 15:11:32 +0200
committerAvatar Heiko Becker <heirecka@exherbo.org> 2016-09-10 13:28:30 +0200
commit8f2c0358ab81190686b5703aab0d3ccdcb84ddcd (patch)
tree7bc8675812c378abf481e0221908b9d759fa23ba
parent6fe8f46d8f75f6b249857c8cad0f9b3b9c49660d (diff)
downloaddocs-8f2c0358ab81190686b5703aab0d3ccdcb84ddcd.tar.gz
docs-8f2c0358ab81190686b5703aab0d3ccdcb84ddcd.tar.xz
Add documentation about adding a new target
This is basically a reduced version of the multiarch migration guide. Change-Id: I5a897fac06693e906a56c51561c11ad527d52cbf Reviewed-on: https://galileo.mailstation.de/gerrit/6949 Reviewed-by: Jenkins <wk@mailstation.de> Reviewed-by: Heiko Becker <heirecka@exherbo.org>
-rw-r--r--index.mkd1
-rw-r--r--multiarch/multiarch-new-target.mkd134
2 files changed, 135 insertions, 0 deletions
diff --git a/index.mkd b/index.mkd
index c751a10..6540759 100644
--- a/index.mkd
+++ b/index.mkd
@@ -37,6 +37,7 @@ CSS: /css/main.css
* [Install Guide](install-guide.html)
* [KDE on Exherbo](kde.html)
* [Multiarch Migration Guide](multiarch/multiarch.html)
+* [Multiarch: Adding another target architecture](multiarch/multiarch-new-target.html)
* [Paludis-FAQ](http://paludis.exherbo.org/faq/index.html)
* [Systemd HowTo](systemd.html)
* [Unavailable repository](//ciaranm.wordpress.com/2008/06/12/dealing-with-lots-of-repositories/)
diff --git a/multiarch/multiarch-new-target.mkd b/multiarch/multiarch-new-target.mkd
new file mode 100644
index 0000000..e368cf7
--- /dev/null
+++ b/multiarch/multiarch-new-target.mkd
@@ -0,0 +1,134 @@
+Title: Multiarch: Adding another target
+CSS: /css/main.css
+
+#{include head}
+
+# Multiarch: Adding another target architecture
+
+This is a short guide on how to enable another target architecture using the
+`armv7-unknown-linux-gnueabihf` architecture as an example. You can see all
+currently supported targets by looking at target options reported by
+
+ # cave show gcc::arbor
+
+If you expect you'll need a different set of options for the new target,
+consider adding it in a another paludis environment.
+
+1. Configure the target suboption in `/etc/paludis/options.conf`
+
+ * /etc/paludis/options.conf *
+
+ */* targets: armv7-unknown-linux-gnueabihf
+
+ Make sure not to remove your native target, i.e. the one matching your CHOST.
+
+
+2. Setup `*FLAGSS` in `/etc/paludis/bashrc`
+
+ * /etc/paludis/bashrc *
+
+ armv7_unknown_linux_gnueabihf_CFLAGS="-pipe -O2 -march=armv7-a -mtune=cortex-a9 -mfloat-abi=hard -mfpu=vfpv3"
+ armv7_unknown_linux_gnueabihf_CXXFLAGS="-pipe -O2 march=armv7-a -mtune=cortex-a9 -mfloat-abi=hard -mfpu=vfpv3"
+
+ These flags are just a suggestion and you most certainly want to
+ change them to match your hardware (the ones above are suitable for a TI
+ OMAP4).
+ [gcc's documentation](https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html)
+ lists possible options.
+
+
+3. Add a config file for the target's installed repository
+
+ `tool_prefix` is the prefix for the toolchain components which is being used
+ to generate the binaries for the target platform,
+ `armv7-unknown-linux-gnueabihf-` in our case.
+
+ `split_debug_location` is the location where the split debug information is
+ stored for the packages that are installed.
+
+ `cross_compile_host` is the target host on which the binaries will run.
+
+ * /etc/paludis/repositories/armv7-unknown-linux-gnueabihf.conf *
+
+ format = exndbam
+ location = ${root}/var/db/paludis/repositories/cross-installed/armv7-unknown-linux-gnueabihf
+ name = armv7-unknown-linux-gnueabihf
+ split_debug_location = /usr/armv7-unknown-linux-gnueabihf/lib/debug
+ tool_prefix = armv7-unknown-linux-gnueabihf-
+ cross_compile_host = armv7-unknown-linux-gnueabihf
+
+ The directory specified by the location option above needs to be created:
+
+ # mkdir /var/db/paludis/repositories/cross-installed/armv7-unknown-linux-gnueabihf
+
+
+4. Build `binutils` with the new target
+
+ # cave resolve --preserve-world binutils
+
+
+5. Build `gcc[-threads]`
+
+ * /etc/paludis/options.conf *
+
+ sys-devel/gcc -threads
+
+ # cave resolve sys-devel/gcc
+
+ This will also pull in eclectic-gcc.
+
+
+6. Cross compile `linux-headers` and `glibc`
+
+ # cave resolve --preserve-world --make cross-compile sys-kernel/linux-headers
+ # cave resolve --preserve-world --make cross-compile sys-libs/glibc
+
+ If you have more than one cross compilation target in the same
+ environment you'll need to specify
+ `--cross-host armv7-unknown-linux-gnueabihf` additionally.
+
+
+7. Cross compile language runtimes (take 1 of 2)
+
+ # cave resolve --make cross-compile libatomic libgcc libstdc++
+
+
+8. Build `gcc[threads]`
+
+ Enable gcc's threads option again by removing the previously added
+ temporary `sys-devel/gcc -threads` from `/etc/paludis/options.conf`
+ (it's set by our profiles) and rebuild `sys-devel/gcc` afterwards:
+
+ # cave resolve --preserve-world gcc --no-follow-installed-dependencies
+
+
+9. Cross compile language runtimes (take 2 of 2)
+
+ # cave resolve --make cross-compile libatomic libgcc libstdc++
+
+
+10. Rebuild other packages having a targets suboption
+
+ pkg-config/pkg-conf also have a `targets` suboption and also need a
+ rebuild. There are more packages, like clang for example, which also offer
+ said option. You can use cave to find out and rebuild them or fine-tune
+ your targets for these packages.
+
+ # cave resolve --complete installed-slots
+
+
+11. Start cross compiling other packages
+
+ Now that the toolchain is built and installed you can start building the
+ packages you're interested in for the new target:
+
+ # cave resolve --make cross-compile <foo>
+
+
+--
+Copyright 2016 Heiko Becker
+
+#{include CC_3.0_Attribution_ShareAlike}
+#{include foot}
+
+<!-- vim: set et ft=mkd spell spelllang=en sts=4 sw=4 ts=8 : -->