update documentation with better instructions, added presets

This commit is contained in:
Rich Felker 2015-11-18 22:50:22 +00:00
parent 8878510198
commit ea4a0ce03b
4 changed files with 63 additions and 17 deletions

View File

@ -2,31 +2,45 @@ musl-cross-make
=============== ===============
This is a quick and simple makefile-based alternative for producing This is a quick and simple makefile-based alternative for producing
musl-based cross compilers. In addition to the build system, it musl-based cross compilers. The current focus is on SH2/J2 Core
provides a number of patches, including: targets and NOMMU (where PIE or FDPIC is mandatory) since these are
not adequately supported by other musl cross-compiler toolchain build
systems, but all musl-supported targets are intended to work.
In addition to the build system, musl-cross-make provides a number of
patches, including:
- Updated versions of the musl target patches going into upstream GCC - Updated versions of the musl target patches going into upstream GCC
- Static-PIE support and optionally defaulting to PIE
- Static-PIE support and enabling PIE as default
- Fixes for SH-specific bugs and bitrot in GCC - Fixes for SH-specific bugs and bitrot in GCC
- Support for J2 Core CPU target in GCC & binutils - Support for J2 Core CPU target in GCC & binutils
- SH/FDPIC ABI support
Most of these patches are integrated in gcc trunk/binutils master.
They should also be usable with Gregor's original musl-cross or other
build systems, if desired.
Some functionality (SH/FDPIC, and support for J2 specific features) is
presently only available with gcc 5.2.0 and binutils 2.25.1.
The current focus is on SH2/J2 Core targets and NOMMU (where PIE is
mandatory) since these are not adequately supported by other musl
cross-compiler toolchain build systems.
Usage Usage
----- -----
To build, copy the provided config.mak.dist to config.mak and edit The build system make be configured by providing a config.mak file in
then run make. Parallel builds are supported. The host needs to have the top-level directory. The only mandatory variable is TARGET, which
suitable gmp/mpfr/mpc libraries installed in the standard library should contain a gcc target tuple (such as sh2eb-linux-musl), but many
path, or you can add the appropriate --with options to GCC_CONFIG. more options are available. The top-level config.mak.dist file shows
examples, and several full configurations are available in presets/*.
At present only GCC 5.2.0 and Binutils 2.25.1 are supported. For recent gcc versions that need gmp/mpfr/mpc, suitable versions need
Backporting of patches is needed to support other versions. to be installed in the default library path, or the appropriate --with
configure options need to be added to GCC_CONFIG in config.mak so that
the gcc configure process can find them.
The included patches should also be usable with Gregor's original After setting up config.mak, simply run make. Parallel builds are
musl-cross or other build systems, if desired. supported.
The resulting toolchain will be placed ./output by default, or the
OUTPUT directory specified in config.mak. It is sysrooted and can be
freely moved to a different location.

View File

@ -1,6 +1,10 @@
OUTPUT = $(PWD)/output OUTPUT = $(PWD)/output
TARGET = sh2eb-linux-musl TARGET = sh2eb-linux-musl
# See the patches directory for supported versions. Versions
# without patches should not be expected to work until gcc 6.
# Older versions may have known bugs or limited functionality.
BINUTILS_VER = 2.25.1 BINUTILS_VER = 2.25.1
GCC_VER = 5.2.0 GCC_VER = 5.2.0

14
presets/j2-fdpic Normal file
View File

@ -0,0 +1,14 @@
OUTPUT = $(PWD)/output
TARGET = sh2eb-linux-muslfdpic
BINUTILS_VER = 2.25.1
GCC_VER = 5.2.0
COMMON_CONFIG += --disable-nls
COMMON_CONFIG += MAKEINFO=/bin/false
GCC_CONFIG += --enable-languages=c,c++
GCC_CONFIG += --disable-libquadmath --disable-decimal-float
GCC_CONFIG += --disable-multilib
GCC_CONFIG += --with-cpu=mj2
GCC_CONFIG += --enable-fdpic

14
presets/j2-pie-gplv2 Normal file
View File

@ -0,0 +1,14 @@
OUTPUT = $(PWD)/output
TARGET = sh2eb-linux-musl
GCC_VER = 4.2.1
BINUTILS_VER = 397a64b3
BINUTILS_SITE = http://landley.net/aboriginal/mirror
COMMON_CONFIG += --disable-nls
BINUTILS_CONFIG += MAKEINFO=/bin/false
GCC_CONFIG += --enable-languages=c,c++
GCC_CONFIG += --disable-libquadmath --disable-decimal-float
GCC_CONFIG += --disable-multilib
GCC_CONFIG += --enable-default-pie