mirror of
https://git.yoctoproject.org/poky
synced 2026-02-05 16:28:43 +01:00
The idea of the base class dependency is to say "yes, I need a C cross compiler" and this was never meant to be gcc specific. Looking at the codebase, whilst we code triplets into this, it does overcomplicate things as there are only ever limited, "target", "sdk" and the class extended versions like mutlilib. After much thought, we can simplify this to virtual/cross-cc and virtual/nativesdk-cross-cc. This lets us remove the "gcc" specific element as well as removing the over complicated triplet usage. At the same time, change the much less widely used "g++" variant to "c++" for similar reasons and remove the triplet from virtual/XXX-binutils too. Backwards compatibility mappings could be left but are just going to confuse things in future so we'll just require users to update. This simplification, whilst disruptive for any toolchain focused layers, will make improved toolchain selection in the future much easier. Since we no longer have overlapping variables, some code for that can just be removed. The class extension code does need to start remapping some variables but not the crosssdk target recipe names. This patch is in two pieces, this one handles the renaming with the functional changes separate in a second for easier review even if this breaks bisection. (From OE-Core rev: 4ccc3bc8266c327bcc18c9a3faf7536210dfb9f0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
59 lines
2.0 KiB
PHP
59 lines
2.0 KiB
PHP
#
|
|
# Notes on the way the OE cross toolchain now works
|
|
#
|
|
# We need a libgcc to build glibc. Tranditionally we therefore built
|
|
# a non-threaded and non-shared compiler (gcc-cross-initial), then use
|
|
# that to build libgcc-initial which is used to build glibc which we can
|
|
# then build gcc-cross and libgcc against.
|
|
#
|
|
# We were able to drop the glibc dependency from gcc-cross, with two tweaks:
|
|
|
|
# a) specify the minimum glibc version to support in a configure option
|
|
# b) create a dummy limits.h file so that later when glibc creates one,
|
|
# the headers structure has support for it. We can do this with a simple
|
|
# empty file
|
|
#
|
|
# Once gcc-cross is libc independent, we can use it to build both
|
|
# libgcc-initial and then later libgcc.
|
|
#
|
|
# libgcc-initial is tricky as we need to imitate the non-threaded and
|
|
# non-shared case. We can do that by hacking the threading mode back to
|
|
# "single" even if gcc reports "posix" and disable libc presence for the
|
|
# libgcc-intial build. We have to create the dummy limits.h to avoid
|
|
# compiler errors from a missing header.
|
|
#
|
|
# glibc will fail to link with libgcc-initial due to a missing "exception
|
|
# handler" capable libgcc (libgcc_eh.a). Since we know glibc doesn't need
|
|
# any exception handler, we can safely symlink to libgcc.a.
|
|
#
|
|
|
|
require libgcc-common.inc
|
|
|
|
DEPENDS = "virtual/cross-cc"
|
|
|
|
LICENSE = "GPL-3.0-with-GCC-exception"
|
|
|
|
PACKAGES = ""
|
|
|
|
EXTRA_OECONF += "--disable-shared"
|
|
|
|
inherit nopackages
|
|
|
|
# We really only want this built by things that need it, not any recrdeptask
|
|
deltask do_build
|
|
|
|
do_configure:prepend () {
|
|
install -d ${STAGING_INCDIR}
|
|
touch ${STAGING_INCDIR}/limits.h
|
|
sed -i -e 's#INHIBIT_LIBC_CFLAGS =.*#INHIBIT_LIBC_CFLAGS = -Dinhibit_libc#' ${B}/gcc/libgcc.mvars
|
|
sed -i -e 's#inhibit_libc = false#inhibit_libc = true#' ${B}/gcc/Makefile
|
|
}
|
|
|
|
do_configure:append () {
|
|
sed -i -e 's#thread_header = .*#thread_header = gthr-single.h#' ${B}/${BPN}/Makefile
|
|
}
|
|
|
|
do_install:append () {
|
|
ln -s libgcc.a ${D}${libdir}/${TARGET_SYS}/${BINV}/libgcc_eh.a
|
|
}
|