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