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/ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 24 | cd ${B}/$target/libsanitizer/ |
| 25 | chmod a+x ${S}/libsanitizer/configure |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 26 | relpath=${@os.path.relpath("${S}/libsanitizer", "${B}/$target/libsanitizer")} |
| 27 | $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | # Easiest way to stop bad RPATHs getting into the library since we have a |
| 29 | # broken libtool here |
| 30 | sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/$target/libsanitizer/libtool |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 31 | # Link to the sysroot's libstdc++ instead of one gcc thinks it just built |
| 32 | sed -i -e '/LIBSTDCXX_RAW_CXX_\(CXXFLAGS\|LDFLAGS\)\s*=/d' ${B}/$target/libsanitizer/*/Makefile |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 33 | } |
| 34 | |
| 35 | do_compile () { |
| 36 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` |
| 37 | cd ${B}/$target/libsanitizer/ |
| 38 | oe_runmake MULTIBUILDTOP=${B}/$target/libsanitizer/ |
| 39 | } |
| 40 | |
| 41 | do_install () { |
| 42 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` |
| 43 | cd ${B}/$target/libsanitizer/ |
| 44 | oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/libsanitizer/ install |
| 45 | if [ -d ${D}${infodir} ]; then |
| 46 | rmdir --ignore-fail-on-non-empty -p ${D}${infodir} |
| 47 | fi |
| 48 | chown -R root:root ${D} |
| 49 | } |
| 50 | |
| 51 | INHIBIT_DEFAULT_DEPS = "1" |
| 52 | ALLOW_EMPTY_${PN} = "1" |
| 53 | DEPENDS = "gcc-runtime" |
| 54 | |
| 55 | BBCLASSEXTEND = "nativesdk" |
| 56 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 57 | PACKAGES = "${PN} ${PN}-dbg" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 58 | PACKAGES += "libasan libubsan liblsan libtsan" |
| 59 | PACKAGES += "libasan-dev libubsan-dev liblsan-dev libtsan-dev" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 60 | PACKAGES += "libasan-staticdev libubsan-staticdev liblsan-staticdev libtsan-staticdev" |
| 61 | |
| 62 | RDEPENDS_libasan += "libstdc++" |
| 63 | RDEPENDS_libubsan += "libstdc++" |
| 64 | RDEPENDS_liblsan += "libstdc++" |
| 65 | RDEPENDS_libtsan += "libstdc++" |
| 66 | RDEPENDS_libasan-dev += "${PN}" |
| 67 | RDEPENDS_libubsan-dev += "${PN}" |
| 68 | RDEPENDS_liblsan-dev += "${PN}" |
| 69 | RDEPENDS_libtsan-dev += "${PN}" |
| 70 | RRECOMMENDS_${PN} += "libasan libubsan" |
| 71 | RRECOMMENDS_${PN}_append_x86-64 = " liblsan libtsan" |
| 72 | RRECOMMENDS_${PN}_append_x86 = " liblsan" |
| 73 | |
| 74 | do_package_write_ipk[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata" |
| 75 | do_package_write_deb[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata" |
| 76 | do_package_write_rpm[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata" |
| 77 | |
| 78 | # MIPS, aarch64, and SPARC are broken. |
| 79 | COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm).*-linux' |
| 80 | |
| 81 | FILES_libasan += "${libdir}/libasan.so.*" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 82 | FILES_libasan-dev += "\ |
| 83 | ${libdir}/libasan_preinit.o \ |
| 84 | ${libdir}/libasan.so \ |
| 85 | ${libdir}/libasan.la \ |
| 86 | " |
| 87 | FILES_libasan-staticdev += "${libdir}/libasan.a" |
| 88 | |
| 89 | FILES_libubsan += "${libdir}/libubsan.so.*" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 90 | FILES_libubsan-dev += "\ |
| 91 | ${libdir}/libubsan.so \ |
| 92 | ${libdir}/libubsan.la \ |
| 93 | " |
| 94 | FILES_libubsan-staticdev += "${libdir}/libubsan.a" |
| 95 | |
| 96 | FILES_liblsan += "${libdir}/liblsan.so.*" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 97 | FILES_liblsan-dev += "\ |
| 98 | ${libdir}/liblsan.so \ |
| 99 | ${libdir}/liblsan.la \ |
| 100 | " |
| 101 | FILES_liblsan-staticdev += "${libdir}/liblsan.a" |
| 102 | |
| 103 | FILES_libtsan += "${libdir}/libtsan.so.*" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 104 | FILES_libtsan-dev += "\ |
| 105 | ${libdir}/libtsan.so \ |
| 106 | ${libdir}/libtsan.la \ |
| 107 | " |
| 108 | FILES_libtsan-staticdev += "${libdir}/libtsan.a" |
| 109 | |
| 110 | FILES_${PN} = "${libdir}/*.spec ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/sanitizer/*.h" |