summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-cross-initial.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-cross-initial.inc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-initial.inc81
1 files changed, 81 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial.inc b/meta/recipes-devtools/gcc/gcc-cross-initial.inc
new file mode 100644
index 0000000000..81845386f9
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-cross-initial.inc
@@ -0,0 +1,81 @@
1DEPENDS = "virtual/${TARGET_PREFIX}binutils ${NATIVEDEPS}"
2PROVIDES = "virtual/${TARGET_PREFIX}gcc-initial"
3PACKAGES = ""
4
5INHIBIT_AUTOTOOLS_DEPS = "1"
6INHIBIT_DEFAULT_DEPS = "1"
7
8CROSS_TARGET_SYS_DIR_append = ".${PN}"
9
10# This is intended to be a -very- basic config
11# sysroot is needed in case we use libc-initial
12EXTRA_OECONF = "--with-newlib \
13 --without-headers \
14 --disable-shared \
15 --disable-threads \
16 --disable-multilib \
17 --disable-__cxa_atexit \
18 --enable-languages=c \
19 ${OPTSPACE} \
20 --program-prefix=${TARGET_PREFIX} \
21 --with-sysroot=${STAGING_DIR_TARGET} \
22 --with-build-sysroot=${GCCCROSS_BUILDSYSROOT} \
23 ${EXTRA_OECONF_INITIAL} \
24 ${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '--with-ld=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}ld.bfd', '', d)} \
25 ${EXTRA_OECONF_FPU}"
26
27EXTRA_OECONF += " --with-native-system-header-dir=${SYSTEMHEADERS} "
28
29GCCCROSS_BUILDSYSROOT = "${B}/tmpsysroot"
30
31do_configure_prepend () {
32 sysr=${GCCCROSS_BUILDSYSROOT}${target_includedir}
33 mkdir -p $sysr
34 for t in linux asm asm-generic; do
35 rm -f $sysr/$t
36 ln -s ${STAGING_DIR_TARGET}${target_includedir}/$t $sysr/
37 done
38}
39
40do_compile () {
41 oe_runmake all-gcc all-target-libgcc
42}
43do_install () {
44 oe_runmake 'DESTDIR=${D}' install-gcc install-target-libgcc
45
46 # We don't really need this (here shares/ contains man/, info/, locale/).
47 rm -rf ${D}${datadir}/
48
49 # We use libiberty from binutils
50 find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f
51 find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f
52
53 # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
54 # found. These need to be relative paths so they work in different locations.
55 dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
56 install -d $dest
57 for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
58 ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
59 done
60 # fixed limits.h infact includes the so called real limits.h
61 # which should come from libc but when we build libc-initial
62 # then bunch of configure tests include fixed limits.h which in turn
63 # includes real limits.h but this real limits.h is not staged yet
64 # so we overwirte the generated include-fixed/limits.h for gcc-cross-initial
65 # to get rid references to real limits.h
66 cp gcc/include-fixed/limits.h ${D}${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed/limits.h
67}
68#
69# Override the default sysroot staging copy since this won't look like a target system
70#
71sysroot_stage_all() {
72 sysroot_stage_dir ${D} ${SYSROOT_DESTDIR}
73 install -d ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_base_libdir}/
74 install -d ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_libdir}/
75 mv ${SYSROOT_DESTDIR}${target_base_libdir}/* ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_base_libdir}/ || true
76 mv ${SYSROOT_DESTDIR}${target_libdir}/* ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_libdir}/ || true
77}
78
79do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_HOST}/ ${SYSROOT_DESTDIR}/${STAGING_DIR_TARGET}/${target_base_libdir}/"
80do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_HOST}/ ${STAGING_DIR_TCBOOTSTRAP}/${target_base_libdir}/"
81