Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | require gcc-configure-common.inc |
| 2 | |
| 3 | LICENSE = "NCSA | MIT" |
| 4 | |
| 5 | LIC_FILES_CHKSUM = "\ |
| 6 | file://libsanitizer/LICENSE.TXT;md5=0249c37748936faf5b1efd5789587909 \ |
| 7 | " |
| 8 | |
| 9 | EXTRA_OECONF_PATHS = "\ |
| 10 | --with-sysroot=/not/exist \ |
| 11 | --with-build-sysroot=${STAGING_DIR_TARGET} \ |
| 12 | " |
| 13 | |
| 14 | do_configure () { |
| 15 | mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` |
| 16 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` |
| 17 | if [ -d ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ]; then |
| 18 | hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B} |
| 19 | fi |
| 20 | |
| 21 | echo "Configuring libsanitizer" |
| 22 | rm -rf ${B}/$target/libsanitizer/ |
| 23 | mkdir -p ${B}/$target/libsanitizer/ |
| 24 | # This is kind of gross, but it's an easy way to make configure happy |
| 25 | # without hacking it up to use the system stdc++ instead of the one it |
| 26 | # expects to be newly built. |
| 27 | rm -rf ${B}/$target/libstdc++-v3/ |
| 28 | mkdir -p ${B}/$target/libstdc++-v3/src/ |
| 29 | ln -s ${STAGING_LIBDIR}/libstdc++.la ${B}/$target/libstdc++-v3/src/ |
| 30 | ln -s ${STAGING_LIBDIR}/libstdc++.so ${B}/$target/libstdc++-v3/src/ |
| 31 | cd ${B}/$target/libsanitizer/ |
| 32 | chmod a+x ${S}/libsanitizer/configure |
| 33 | ${S}/libsanitizer/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} |
| 34 | # Easiest way to stop bad RPATHs getting into the library since we have a |
| 35 | # broken libtool here |
| 36 | sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/$target/libsanitizer/libtool |
| 37 | } |
| 38 | |
| 39 | do_compile () { |
| 40 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` |
| 41 | cd ${B}/$target/libsanitizer/ |
| 42 | oe_runmake MULTIBUILDTOP=${B}/$target/libsanitizer/ |
| 43 | } |
| 44 | |
| 45 | do_install () { |
| 46 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` |
| 47 | cd ${B}/$target/libsanitizer/ |
| 48 | oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/libsanitizer/ install |
| 49 | if [ -d ${D}${infodir} ]; then |
| 50 | rmdir --ignore-fail-on-non-empty -p ${D}${infodir} |
| 51 | fi |
| 52 | chown -R root:root ${D} |
| 53 | } |
| 54 | |
| 55 | INHIBIT_DEFAULT_DEPS = "1" |
| 56 | ALLOW_EMPTY_${PN} = "1" |
| 57 | DEPENDS = "gcc-runtime" |
| 58 | |
| 59 | BBCLASSEXTEND = "nativesdk" |
| 60 | |
| 61 | PACKAGES = "${PN}" |
| 62 | PACKAGES += "libasan libubsan liblsan libtsan" |
| 63 | PACKAGES += "libasan-dev libubsan-dev liblsan-dev libtsan-dev" |
| 64 | PACKAGES += "libasan-dbg libubsan-dbg liblsan-dbg libtsan-dbg" |
| 65 | PACKAGES += "libasan-staticdev libubsan-staticdev liblsan-staticdev libtsan-staticdev" |
| 66 | |
| 67 | RDEPENDS_libasan += "libstdc++" |
| 68 | RDEPENDS_libubsan += "libstdc++" |
| 69 | RDEPENDS_liblsan += "libstdc++" |
| 70 | RDEPENDS_libtsan += "libstdc++" |
| 71 | RDEPENDS_libasan-dev += "${PN}" |
| 72 | RDEPENDS_libubsan-dev += "${PN}" |
| 73 | RDEPENDS_liblsan-dev += "${PN}" |
| 74 | RDEPENDS_libtsan-dev += "${PN}" |
| 75 | RRECOMMENDS_${PN} += "libasan libubsan" |
| 76 | RRECOMMENDS_${PN}_append_x86-64 = " liblsan libtsan" |
| 77 | RRECOMMENDS_${PN}_append_x86 = " liblsan" |
| 78 | |
| 79 | do_package_write_ipk[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata" |
| 80 | do_package_write_deb[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata" |
| 81 | do_package_write_rpm[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata" |
| 82 | |
| 83 | # MIPS, aarch64, and SPARC are broken. |
| 84 | COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm).*-linux' |
| 85 | |
| 86 | FILES_libasan += "${libdir}/libasan.so.*" |
| 87 | FILES_libasan-dbg += "${libdir}/.debug/libasan.so.*" |
| 88 | FILES_libasan-dev += "\ |
| 89 | ${libdir}/libasan_preinit.o \ |
| 90 | ${libdir}/libasan.so \ |
| 91 | ${libdir}/libasan.la \ |
| 92 | " |
| 93 | FILES_libasan-staticdev += "${libdir}/libasan.a" |
| 94 | |
| 95 | FILES_libubsan += "${libdir}/libubsan.so.*" |
| 96 | FILES_libubsan-dbg += "${libdir}/.debug/libubsan.so.*" |
| 97 | FILES_libubsan-dev += "\ |
| 98 | ${libdir}/libubsan.so \ |
| 99 | ${libdir}/libubsan.la \ |
| 100 | " |
| 101 | FILES_libubsan-staticdev += "${libdir}/libubsan.a" |
| 102 | |
| 103 | FILES_liblsan += "${libdir}/liblsan.so.*" |
| 104 | FILES_liblsan-dbg += "${libdir}/.debug/liblsan.so.*" |
| 105 | FILES_liblsan-dev += "\ |
| 106 | ${libdir}/liblsan.so \ |
| 107 | ${libdir}/liblsan.la \ |
| 108 | " |
| 109 | FILES_liblsan-staticdev += "${libdir}/liblsan.a" |
| 110 | |
| 111 | FILES_libtsan += "${libdir}/libtsan.so.*" |
| 112 | FILES_libtsan-dbg += "${libdir}/.debug/libtsan.so.*" |
| 113 | FILES_libtsan-dev += "\ |
| 114 | ${libdir}/libtsan.so \ |
| 115 | ${libdir}/libtsan.la \ |
| 116 | " |
| 117 | FILES_libtsan-staticdev += "${libdir}/libtsan.a" |
| 118 | |
| 119 | FILES_${PN} = "${libdir}/*.spec ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/sanitizer/*.h" |