mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2024-12-24 15:06:42 +00:00
binutils: add frontends for building to run on the build machine
In canadian-cross, we need binutils running on the build machine to be able to build the target C library. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
This commit is contained in:
parent
2e3cc45633
commit
518a1ff137
scripts/build/binutils
@ -15,6 +15,26 @@ do_binutils_extract() {
|
||||
CT_Patch "binutils" "${CT_BINUTILS_VERSION}"
|
||||
}
|
||||
|
||||
# Build binutils for build -> target
|
||||
do_binutils_for_build() {
|
||||
local -a binutils_opts
|
||||
|
||||
case "${CT_TOOLCHAIN_TYPE}" in
|
||||
native|cross) return 0;;
|
||||
esac
|
||||
|
||||
CT_DoStep INFO "Installing binutils for build"
|
||||
CT_mkdir_pushd "${CT_BUILD_DIR}/build-binutils-build-${CT_BUILD}"
|
||||
|
||||
binutils_opts+=( "host=${CT_BUILD}" )
|
||||
binutils_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
|
||||
|
||||
do_binutils_backend "${binutils_opts[@]}"
|
||||
|
||||
CT_Popd
|
||||
CT_EndStep
|
||||
}
|
||||
|
||||
# Build binutils for host -> target
|
||||
do_binutils_for_host() {
|
||||
local -a binutils_tools
|
||||
|
@ -6,6 +6,7 @@
|
||||
# Default: do nothing
|
||||
do_elf2flt_get() { :; }
|
||||
do_elf2flt_extract() { :; }
|
||||
do_elf2flt_for_build() { :; }
|
||||
do_elf2flt_for_host() { :; }
|
||||
|
||||
if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
|
||||
@ -25,6 +26,27 @@ do_elf2flt_extract() {
|
||||
CT_Patch "elf2flt-cvs" "${CT_ELF2FLT_VERSION}"
|
||||
}
|
||||
|
||||
# Build elf2flt for build -> target
|
||||
do_elf2flt_for_build() {
|
||||
local -a elf2flt_opts
|
||||
|
||||
case "${CT_TOOLCHAIN_TYPE}" in
|
||||
native|cross) return 0;;
|
||||
esac
|
||||
|
||||
CT_DoStep INFO "Installing elf2flt for build"
|
||||
CT_mkdir_pushd "${CT_BUILD_DIR}/build-elf2flt-build-${CT_BUILD}"
|
||||
|
||||
elf2flt_opts+=( "host=${CT_BUILD}" )
|
||||
elf2flt_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
|
||||
elf2flt_opts+=( "binutils_bld=${CT_BUILD_DIR}/build-binutils-build-${CT_HOST}" )
|
||||
|
||||
do_elf2flt_backend "${elf2flt_opts[@]}"
|
||||
|
||||
CT_Popd
|
||||
CT_EndStep
|
||||
}
|
||||
|
||||
# Build elf2flt for host -> target
|
||||
do_elf2flt_for_host() {
|
||||
local -a elf2flt_opts
|
||||
@ -36,6 +58,7 @@ do_elf2flt_for_host() {
|
||||
elf2flt_opts+=( "prefix=${CT_PREFIX_DIR}" )
|
||||
elf2flt_opts+=( "static_build=${CT_STATIC_TOOLCHAIN}" )
|
||||
elf2flt_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
|
||||
elf2flt_opts+=( "binutils_bld=${CT_BUILD_DIR}/build-binutils-host-${CT_HOST}" )
|
||||
|
||||
do_elf2flt_backend "${elf2flt_opts[@]}"
|
||||
|
||||
@ -75,14 +98,14 @@ do_elf2flt_backend() {
|
||||
local prefix
|
||||
local static_build
|
||||
local cflags
|
||||
local binutils_bld
|
||||
local binutils_src
|
||||
local arg
|
||||
|
||||
for arg in "$@"; do
|
||||
eval "${arg// /\\ }"
|
||||
done
|
||||
|
||||
elf2flt_opts=
|
||||
binutils_bld="${CT_BUILD_DIR}/build-binutils-host-${CT_HOST}"
|
||||
binutils_src="${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}"
|
||||
|
||||
CT_DoLog EXTRA "Configuring elf2flt"
|
||||
|
Loading…
Reference in New Issue
Block a user