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 () { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 15 | rm -rf ${B}/${TARGET_SYS}/libsanitizer/ |
| 16 | mkdir -p ${B}/${TARGET_SYS}/libsanitizer/ |
| 17 | cd ${B}/${TARGET_SYS}/libsanitizer/ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 18 | chmod a+x ${S}/libsanitizer/configure |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 19 | relpath=${@os.path.relpath("${S}/libsanitizer", "${B}/${TARGET_SYS}/libsanitizer")} |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 20 | $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 21 | # Easiest way to stop bad RPATHs getting into the library since we have a |
| 22 | # broken libtool here |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 23 | sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/${TARGET_SYS}/libsanitizer/libtool |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 24 | # Link to the sysroot's libstdc++ instead of one gcc thinks it just built |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 25 | sed -i -e '/LIBSTDCXX_RAW_CXX_\(CXXFLAGS\|LDFLAGS\)\s*=/d' ${B}/${TARGET_SYS}/libsanitizer/*/Makefile |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 26 | } |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 27 | EXTRACONFFUNCS += "extract_stashed_builddir" |
| 28 | do_configure[depends] += "${COMPILERDEP}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 29 | |
| 30 | do_compile () { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 31 | cd ${B}/${TARGET_SYS}/libsanitizer/ |
| 32 | oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/libsanitizer/ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 33 | } |
| 34 | |
| 35 | do_install () { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 36 | cd ${B}/${TARGET_SYS}/libsanitizer/ |
| 37 | oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/libsanitizer/ install |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 38 | if [ -d ${D}${infodir} ]; then |
| 39 | rmdir --ignore-fail-on-non-empty -p ${D}${infodir} |
| 40 | fi |
| 41 | chown -R root:root ${D} |
| 42 | } |
| 43 | |
| 44 | INHIBIT_DEFAULT_DEPS = "1" |
| 45 | ALLOW_EMPTY_${PN} = "1" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 46 | DEPENDS = "virtual/crypt gcc-runtime virtual/${TARGET_PREFIX}gcc" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 47 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 48 | # used to fix ../../../../../../../../../work-shared/gcc-8.3.0-r0/gcc-8.3.0/libsanitizer/libbacktrace/../../libbacktrace/elf.c:772:21: error: 'st.st_mode' may be used uninitialized in this function [-Werror=maybe-uninitialized] |
| 49 | DEBUG_OPTIMIZATION_append = " -Wno-error" |
| 50 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 51 | BBCLASSEXTEND = "nativesdk" |
| 52 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 53 | PACKAGES = "${PN} ${PN}-dbg" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 54 | PACKAGES += "libasan libubsan liblsan libtsan" |
| 55 | PACKAGES += "libasan-dev libubsan-dev liblsan-dev libtsan-dev" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 56 | PACKAGES += "libasan-staticdev libubsan-staticdev liblsan-staticdev libtsan-staticdev" |
| 57 | |
| 58 | RDEPENDS_libasan += "libstdc++" |
| 59 | RDEPENDS_libubsan += "libstdc++" |
| 60 | RDEPENDS_liblsan += "libstdc++" |
| 61 | RDEPENDS_libtsan += "libstdc++" |
| 62 | RDEPENDS_libasan-dev += "${PN}" |
| 63 | RDEPENDS_libubsan-dev += "${PN}" |
| 64 | RDEPENDS_liblsan-dev += "${PN}" |
| 65 | RDEPENDS_libtsan-dev += "${PN}" |
| 66 | RRECOMMENDS_${PN} += "libasan libubsan" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 67 | RRECOMMENDS_${PN}_append_x86 = " liblsan" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 68 | RRECOMMENDS_${PN}_append_x86-64 = " liblsan libtsan" |
| 69 | RRECOMMENDS_${PN}_append_powerpc64 = " liblsan libtsan" |
| 70 | RRECOMMENDS_${PN}_append_aarch64 = " liblsan libtsan" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 71 | |
| 72 | do_package_write_ipk[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata" |
| 73 | do_package_write_deb[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata" |
| 74 | do_package_write_rpm[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata" |
| 75 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 76 | # Only x86, powerpc, sparc, s390, arm, and aarch64 are supported |
| 77 | COMPATIBLE_HOST = '(x86_64|i.86|powerpc|sparc|s390|arm|aarch64).*-linux' |
| 78 | # musl is currently broken entirely |
| 79 | COMPATIBLE_HOST_libc-musl = 'null' |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 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 \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 100 | ${libdir}/liblsan_preinit.o \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 101 | " |
| 102 | FILES_liblsan-staticdev += "${libdir}/liblsan.a" |
| 103 | |
| 104 | FILES_libtsan += "${libdir}/libtsan.so.*" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 105 | FILES_libtsan-dev += "\ |
| 106 | ${libdir}/libtsan.so \ |
| 107 | ${libdir}/libtsan.la \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 108 | ${libdir}/libtsan_*.o \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 109 | " |
| 110 | FILES_libtsan-staticdev += "${libdir}/libtsan.a" |
| 111 | |
| 112 | FILES_${PN} = "${libdir}/*.spec ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/sanitizer/*.h" |