Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | # |
| 2 | # Notes on the way the OE cross toolchain now works |
| 3 | # |
| 4 | # We need a libgcc to build glibc. Tranditionally we therefore built |
| 5 | # a non-threaded and non-shared compiler (gcc-cross-initial), then use |
| 6 | # that to build libgcc-initial which is used to build glibc which we can |
| 7 | # then build gcc-cross and libgcc against. |
| 8 | # |
| 9 | # We were able to drop the glibc dependency from gcc-cross, with two tweaks: |
| 10 | |
| 11 | # a) specify the minimum glibc version to support in a configure option |
| 12 | # b) create a dummy limits.h file so that later when glibc creates one, |
| 13 | # the headers structure has support for it. We can do this with a simple |
| 14 | # empty file |
| 15 | # |
| 16 | # Once gcc-cross is libc independent, we can use it to build both |
| 17 | # libgcc-initial and then later libgcc. |
| 18 | # |
| 19 | # libgcc-initial is tricky as we need to imitate the non-threaded and |
| 20 | # non-shared case. We can do that by hacking the threading mode back to |
| 21 | # "single" even if gcc reports "posix" and disable libc presence for the |
| 22 | # libgcc-intial build. We have to create the dummy limits.h to avoid |
| 23 | # compiler errors from a missing header. |
| 24 | # |
| 25 | # glibc will fail to link with libgcc-initial due to a missing "exception |
| 26 | # handler" capable libgcc (libgcc_eh.a). Since we know glibc doesn't need |
| 27 | # any exception handler, we can safely symlink to libgcc.a. |
| 28 | # |
| 29 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 30 | require libgcc-common.inc |
| 31 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 32 | DEPENDS = "virtual/${TARGET_PREFIX}gcc" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 33 | |
| 34 | LICENSE = "GPL-3.0-with-GCC-exception" |
| 35 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 36 | PACKAGES = "" |
| 37 | |
| 38 | EXTRA_OECONF += "--disable-shared" |
| 39 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 40 | inherit nopackages |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 41 | |
| 42 | # We really only want this built by things that need it, not any recrdeptask |
| 43 | deltask do_build |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 44 | |
| 45 | do_configure_prepend () { |
| 46 | install -d ${STAGING_INCDIR} |
| 47 | touch ${STAGING_INCDIR}/limits.h |
| 48 | sed -i -e 's#INHIBIT_LIBC_CFLAGS =.*#INHIBIT_LIBC_CFLAGS = -Dinhibit_libc#' ${B}/gcc/libgcc.mvars |
| 49 | sed -i -e 's#inhibit_libc = false#inhibit_libc = true#' ${B}/gcc/Makefile |
| 50 | } |
| 51 | |
| 52 | do_configure_append () { |
| 53 | sed -i -e 's#thread_header = .*#thread_header = gthr-single.h#' ${B}/${BPN}/Makefile |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame^] | 54 | sed -i -e '/^libgcc_tm_defines = $/a fp128_dec_funcs =' ${B}/${BPN}/Makefile |
| 55 | sed -i -e '/^libgcc_tm_defines = $/a fp128_decstr_funcs =' ${B}/${BPN}/Makefile |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | do_install_append () { |
| 59 | ln -s libgcc.a ${D}${libdir}/${TARGET_SYS}/${BINV}/libgcc_eh.a |
| 60 | } |