Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | DEPENDS = "virtual/${TARGET_PREFIX}binutils ${NATIVEDEPS}" |
| 2 | PROVIDES = "virtual/${TARGET_PREFIX}gcc-initial" |
| 3 | PACKAGES = "" |
| 4 | |
| 5 | INHIBIT_AUTOTOOLS_DEPS = "1" |
| 6 | INHIBIT_DEFAULT_DEPS = "1" |
| 7 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 8 | # We still need gnu-config-native |
| 9 | DEPENDS_prepend = "gnu-config-native autoconf-native " |
| 10 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 11 | PN = "gcc-cross-initial-${TARGET_ARCH}" |
| 12 | |
| 13 | CROSS_TARGET_SYS_DIR_append = ".${PN}" |
| 14 | |
| 15 | # This is intended to be a -very- basic config |
| 16 | # sysroot is needed in case we use libc-initial |
| 17 | EXTRA_OECONF = "\ |
| 18 | --with-newlib \ |
| 19 | --without-headers \ |
| 20 | --disable-shared \ |
| 21 | --disable-threads \ |
| 22 | --disable-multilib \ |
| 23 | --disable-__cxa_atexit \ |
| 24 | --enable-languages=c \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | --program-prefix=${TARGET_PREFIX} \ |
| 26 | --with-sysroot=/not/exist \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 27 | --with-build-sysroot=${STAGING_DIR_TARGET} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | ${EXTRA_OECONF_INITIAL} \ |
| 29 | ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--with-ld=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}ld.bfd', '', d)} \ |
| 30 | ${EXTRA_OECONF_GCC_FLOAT} \ |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 31 | ${@get_gcc_ppc_plt_settings(bb, d)} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 32 | " |
| 33 | |
| 34 | EXTRA_OECONF += "--with-native-system-header-dir=${SYSTEMHEADERS}" |
| 35 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 36 | do_compile () { |
| 37 | oe_runmake all-gcc configure-target-libgcc |
| 38 | } |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 39 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 40 | do_install () { |
| 41 | ( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h ) |
| 42 | oe_runmake 'DESTDIR=${D}' install-gcc |
| 43 | |
| 44 | # We don't really need this (here shares/ contains man/, info/, locale/). |
| 45 | rm -rf ${D}${datadir}/ |
| 46 | |
| 47 | # We use libiberty from binutils |
| 48 | find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f |
| 49 | find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f |
| 50 | |
| 51 | # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are |
| 52 | # found. These need to be relative paths so they work in different locations. |
| 53 | dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/ |
| 54 | install -d $dest |
| 55 | useld=${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '.bfd', '', d)} |
| 56 | ln -sf ${BINRELPATH}/${TARGET_PREFIX}ld${useld} ${dest}ld |
| 57 | for t in ar as 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/limits.h |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 67 | } |
| 68 | # |
| 69 | # Override the default sysroot staging copy since this won't look like a target system |
| 70 | # |
| 71 | sysroot_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 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 79 | do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_HOST}/" |
| 80 | do_populate_sysroot[sstate-outputdirs] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/${PN}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 81 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 82 | inherit nopackages |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 83 | |
| 84 | COMPILERINITIAL = "-initial" |
| 85 | |
| 86 | |
| 87 | # We really only want this built by things that need it, not any recrdeptask |
| 88 | deltask do_build |