diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/libgcc-initial.inc')
-rw-r--r-- | meta/recipes-devtools/gcc/libgcc-initial.inc | 52 |
1 files changed, 45 insertions, 7 deletions
diff --git a/meta/recipes-devtools/gcc/libgcc-initial.inc b/meta/recipes-devtools/gcc/libgcc-initial.inc index 950ad861e7..06bf224f73 100644 --- a/meta/recipes-devtools/gcc/libgcc-initial.inc +++ b/meta/recipes-devtools/gcc/libgcc-initial.inc | |||
@@ -1,20 +1,58 @@ | |||
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 | |||
1 | require libgcc-common.inc | 30 | require libgcc-common.inc |
2 | 31 | ||
3 | DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial" | 32 | DEPENDS = "virtual/${TARGET_PREFIX}gcc" |
4 | 33 | ||
5 | LICENSE = "GPL-3.0-with-GCC-exception" | 34 | LICENSE = "GPL-3.0-with-GCC-exception" |
6 | 35 | ||
7 | STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}" | ||
8 | STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}" | ||
9 | PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:" | ||
10 | |||
11 | PACKAGES = "" | 36 | PACKAGES = "" |
12 | 37 | ||
13 | EXTRA_OECONF += "--disable-shared" | 38 | EXTRA_OECONF += "--disable-shared" |
14 | 39 | ||
15 | COMPILERINITIAL = "-initial" | ||
16 | |||
17 | inherit nopackages | 40 | inherit nopackages |
18 | 41 | ||
19 | # We really only want this built by things that need it, not any recrdeptask | 42 | # We really only want this built by things that need it, not any recrdeptask |
20 | deltask do_build | 43 | deltask do_build |
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 | ||
54 | } | ||
55 | |||
56 | do_install_append () { | ||
57 | ln -s libgcc.a ${D}${libdir}/${TARGET_SYS}/${BINV}/libgcc_eh.a | ||
58 | } | ||