summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-cross.inc
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-19 00:09:14 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-26 11:19:54 +0000
commit0afd3ac3ada35dd986aaf3be41d7177dc6b71ade (patch)
treea2339ca7d7a6a6a40a6baa853980c7559f1246c2 /meta/recipes-devtools/gcc/gcc-cross.inc
parentded63d68334044e79b15b814216fab02c70ad94f (diff)
downloadpoky-0afd3ac3ada35dd986aaf3be41d7177dc6b71ade.tar.gz
gcc: Drop gcc-cross-initial and use gcc-cross instead
We need a libgcc to build glibc. Tranditionally we therefore build 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. Firstly, we can drop the glibc dependency from gcc-cross, *if* we make two changes: 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. With those changes, gcc-cross can be used in all places and we only need one build of gcc for each architecture. For some reason ifunc was being disabled on mips prior to these changes but afterwards became enabled but caused assertion failures. This is therefore disabled until we can debug that. (From OE-Core rev: 62b7308b8c4d2b439a15a4f7cbc6f823077bb0be) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-cross.inc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross.inc8
1 files changed, 7 insertions, 1 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index 89b19684be..63a196e2e9 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -2,7 +2,7 @@ inherit cross
2 2
3INHIBIT_DEFAULT_DEPS = "1" 3INHIBIT_DEFAULT_DEPS = "1"
4EXTRADEPENDS = "" 4EXTRADEPENDS = ""
5DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc ${EXTRADEPENDS} ${NATIVEDEPS}" 5DEPENDS = "virtual/${TARGET_PREFIX}binutils ${EXTRADEPENDS} ${NATIVEDEPS}"
6PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++" 6PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
7python () { 7python () {
8 if d.getVar("TARGET_OS").startswith("linux"): 8 if d.getVar("TARGET_OS").startswith("linux"):
@@ -44,6 +44,12 @@ EXTRA_OECONF_PATHS = "\
44 44
45ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}" 45ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
46 46
47
48do_configure_prepend () {
49 install -d ${RECIPE_SYSROOT}${target_includedir}
50 touch ${RECIPE_SYSROOT}${target_includedir}/limits.h
51}
52
47do_compile () { 53do_compile () {
48 export CC="${BUILD_CC}" 54 export CC="${BUILD_CC}"
49 export AR_FOR_TARGET="${TARGET_SYS}-ar" 55 export AR_FOR_TARGET="${TARGET_SYS}-ar"