From 62b7308b8c4d2b439a15a4f7cbc6f823077bb0be Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 19 Dec 2018 00:09:14 +0000 Subject: 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. Signed-off-by: Richard Purdie --- meta/recipes-core/glibc/glibc.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'meta/recipes-core/glibc') diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc index 43e71337ee..de692fbfd7 100644 --- a/meta/recipes-core/glibc/glibc.inc +++ b/meta/recipes-core/glibc/glibc.inc @@ -15,7 +15,7 @@ python () { bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN'), opt_effective)) } -DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial libgcc-initial linux-libc-headers" +DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc-initial linux-libc-headers" PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc" PROVIDES += "virtual/libintl virtual/libiconv" @@ -33,6 +33,9 @@ CACHED_CONFIGUREVARS += " \ libc_cv_ssp=no \ " +# ifunc doesn't appear to work on mips, casuses libbfd assertion failures +CACHED_CONFIGUREVARS_append_mipsarch = " libc_cv_ld_gnu_indirect_function=no" + GLIBC_EXTRA_OECONF ?= "" GLIBC_EXTRA_OECONF_class-nativesdk = "" INHIBIT_DEFAULT_DEPS = "1" -- cgit 1.2.3-korg