diff options
| -rw-r--r-- | meta/conf/distro/include/security_flags.inc | 1 | ||||
| -rw-r--r-- | meta/conf/distro/include/tcmode-default.inc | 2 | ||||
| -rw-r--r-- | meta/recipes-devtools/gcc/gcc-sanitizers.inc | 111 | ||||
| -rw-r--r-- | meta/recipes-devtools/gcc/gcc-sanitizers_4.8.bb | 2 | ||||
| -rw-r--r-- | meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb | 2 |
5 files changed, 118 insertions, 0 deletions
diff --git a/meta/conf/distro/include/security_flags.inc b/meta/conf/distro/include/security_flags.inc index d6f7e9c8cc..f996184b25 100644 --- a/meta/conf/distro/include/security_flags.inc +++ b/meta/conf/distro/include/security_flags.inc | |||
| @@ -29,6 +29,7 @@ SECURITY_CFLAGS_pn-glibc-initial = "" | |||
| 29 | SECURITY_CFLAGS_pn-enchant = "${SECURITY_NO_PIE_CFLAGS}" | 29 | SECURITY_CFLAGS_pn-enchant = "${SECURITY_NO_PIE_CFLAGS}" |
| 30 | SECURITY_CFLAGS_pn-flac = "${SECURITY_NO_PIE_CFLAGS}" | 30 | SECURITY_CFLAGS_pn-flac = "${SECURITY_NO_PIE_CFLAGS}" |
| 31 | SECURITY_CFLAGS_pn-gcc-runtime = "${SECURITY_NO_PIE_CFLAGS}" | 31 | SECURITY_CFLAGS_pn-gcc-runtime = "${SECURITY_NO_PIE_CFLAGS}" |
| 32 | SECURITY_CFLAGS_pn-gcc-sanitizers = "${SECURITY_NO_PIE_CFLAGS}" | ||
| 32 | SECURITY_CFLAGS_pn-gdb = "${SECURITY_NO_PIE_CFLAGS}" | 33 | SECURITY_CFLAGS_pn-gdb = "${SECURITY_NO_PIE_CFLAGS}" |
| 33 | SECURITY_CFLAGS_pn-gmp = "${SECURITY_NO_PIE_CFLAGS}" | 34 | SECURITY_CFLAGS_pn-gmp = "${SECURITY_NO_PIE_CFLAGS}" |
| 34 | SECURITY_CFLAGS_pn-gnutls = "${SECURITY_NO_PIE_CFLAGS}" | 35 | SECURITY_CFLAGS_pn-gnutls = "${SECURITY_NO_PIE_CFLAGS}" |
diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc index 2b4109053b..b4c3c70823 100644 --- a/meta/conf/distro/include/tcmode-default.inc +++ b/meta/conf/distro/include/tcmode-default.inc | |||
| @@ -36,8 +36,10 @@ PREFERRED_VERSION_gcc-crosssdk-${SDK_ARCH} ?= "${SDKGCCVERSION}" | |||
| 36 | PREFERRED_VERSION_gcc-crosssdk-initial-${SDK_ARCH} ?= "${SDKGCCVERSION}" | 36 | PREFERRED_VERSION_gcc-crosssdk-initial-${SDK_ARCH} ?= "${SDKGCCVERSION}" |
| 37 | PREFERRED_VERSION_gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "${GCCVERSION}" | 37 | PREFERRED_VERSION_gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "${GCCVERSION}" |
| 38 | PREFERRED_VERSION_gcc-runtime ?= "${GCCVERSION}" | 38 | PREFERRED_VERSION_gcc-runtime ?= "${GCCVERSION}" |
| 39 | PREFERRED_VERSION_gcc-sanitizers ?= "${GCCVERSION}" | ||
| 39 | PREFERRED_VERSION_gcc-source ?= "${GCCVERSION}" | 40 | PREFERRED_VERSION_gcc-source ?= "${GCCVERSION}" |
| 40 | PREFERRED_VERSION_nativesdk-gcc-runtime ?= "${SDKGCCVERSION}" | 41 | PREFERRED_VERSION_nativesdk-gcc-runtime ?= "${SDKGCCVERSION}" |
| 42 | PREFERRED_VERSION_nativesdk-gcc-sanitizers ?= "${GCCVERSION}" | ||
| 41 | PREFERRED_VERSION_libgcc ?= "${GCCVERSION}" | 43 | PREFERRED_VERSION_libgcc ?= "${GCCVERSION}" |
| 42 | PREFERRED_VERSION_libgcc-initial ?= "${GCCVERSION}" | 44 | PREFERRED_VERSION_libgcc-initial ?= "${GCCVERSION}" |
| 43 | PREFERRED_VERSION_nativesdk-libgcc ?= "${SDKGCCVERSION}" | 45 | PREFERRED_VERSION_nativesdk-libgcc ?= "${SDKGCCVERSION}" |
diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers.inc b/meta/recipes-devtools/gcc/gcc-sanitizers.inc new file mode 100644 index 0000000000..892dfe0476 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-sanitizers.inc | |||
| @@ -0,0 +1,111 @@ | |||
| 1 | require gcc-configure-common.inc | ||
| 2 | |||
| 3 | EXTRA_OECONF_PATHS = "\ | ||
| 4 | --with-sysroot=/not/exist \ | ||
| 5 | --with-build-sysroot=${STAGING_DIR_TARGET} \ | ||
| 6 | " | ||
| 7 | |||
| 8 | do_configure () { | ||
| 9 | mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` | ||
| 10 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` | ||
| 11 | hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B} | ||
| 12 | |||
| 13 | echo "Configuring libsanitizer" | ||
| 14 | rm -rf ${B}/$target/libsanitizer/ | ||
| 15 | mkdir -p ${B}/$target/libsanitizer/ | ||
| 16 | # This is kind of gross, but it's an easy way to make configure happy | ||
| 17 | # without hacking it up to use the system stdc++ instead of the one it | ||
| 18 | # expects to be newly built. | ||
| 19 | rm -rf ${B}/$target/libstdc++-v3/ | ||
| 20 | mkdir -p ${B}/$target/libstdc++-v3/src/ | ||
| 21 | ln -s ${STAGING_LIBDIR}/libstdc++.la ${B}/$target/libstdc++-v3/src/ | ||
| 22 | ln -s ${STAGING_LIBDIR}/libstdc++.so ${B}/$target/libstdc++-v3/src/ | ||
| 23 | cd ${B}/$target/libsanitizer/ | ||
| 24 | chmod a+x ${S}/libsanitizer/configure | ||
| 25 | ${S}/libsanitizer/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} | ||
| 26 | # Easiest way to stop bad RPATHs getting into the library since we have a | ||
| 27 | # broken libtool here | ||
| 28 | sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/$target/libsanitizer/libtool | ||
| 29 | } | ||
| 30 | |||
| 31 | do_compile () { | ||
| 32 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` | ||
| 33 | cd ${B}/$target/libsanitizer/ | ||
| 34 | oe_runmake MULTIBUILDTOP=${B}/$target/libsanitizer/ | ||
| 35 | } | ||
| 36 | |||
| 37 | do_install () { | ||
| 38 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` | ||
| 39 | cd ${B}/$target/libsanitizer/ | ||
| 40 | oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/libsanitizer/ install | ||
| 41 | if [ -d ${D}${infodir} ]; then | ||
| 42 | rmdir --ignore-fail-on-non-empty -p ${D}${infodir} | ||
| 43 | fi | ||
| 44 | chown -R root:root ${D} | ||
| 45 | } | ||
| 46 | |||
| 47 | INHIBIT_DEFAULT_DEPS = "1" | ||
| 48 | ALLOW_EMPTY_${PN} = "1" | ||
| 49 | DEPENDS = "gcc-runtime" | ||
| 50 | |||
| 51 | BBCLASSEXTEND = "nativesdk" | ||
| 52 | |||
| 53 | PACKAGES = "${PN}" | ||
| 54 | PACKAGES += "libasan libubsan liblsan libtsan" | ||
| 55 | PACKAGES += "libasan-dev libubsan-dev liblsan-dev libtsan-dev" | ||
| 56 | PACKAGES += "libasan-dbg libubsan-dbg liblsan-dbg libtsan-dbg" | ||
| 57 | PACKAGES += "libasan-staticdev libubsan-staticdev liblsan-staticdev libtsan-staticdev" | ||
| 58 | |||
| 59 | RDEPENDS_libasan += "libstdc++" | ||
| 60 | RDEPENDS_libubsan += "libstdc++" | ||
| 61 | RDEPENDS_liblsan += "libstdc++" | ||
| 62 | RDEPENDS_libtsan += "libstdc++" | ||
| 63 | RDEPENDS_libasan-dev += "${PN}" | ||
| 64 | RDEPENDS_libubsan-dev += "${PN}" | ||
| 65 | RDEPENDS_liblsan-dev += "${PN}" | ||
| 66 | RDEPENDS_libtsan-dev += "${PN}" | ||
| 67 | RRECOMMENDS_${PN} += "libasan libubsan" | ||
| 68 | RRECOMMENDS_${PN}_append_x86-64 = " liblsan libtsan" | ||
| 69 | RRECOMMENDS_${PN}_append_x86 = " liblsan" | ||
| 70 | |||
| 71 | do_package_write_ipk[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata" | ||
| 72 | do_package_write_deb[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata" | ||
| 73 | do_package_write_rpm[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata" | ||
| 74 | |||
| 75 | # MIPS, aarch64, and SPARC are broken. | ||
| 76 | COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm).*-linux' | ||
| 77 | |||
| 78 | FILES_libasan += "${libdir}/libasan.so.*" | ||
| 79 | FILES_libasan-dbg += "${libdir}/.debug/libasan.so.*" | ||
| 80 | FILES_libasan-dev += "\ | ||
| 81 | ${libdir}/libasan_preinit.o \ | ||
| 82 | ${libdir}/libasan.so \ | ||
| 83 | ${libdir}/libasan.la \ | ||
| 84 | " | ||
| 85 | FILES_libasan-staticdev += "${libdir}/libasan.a" | ||
| 86 | |||
| 87 | FILES_libubsan += "${libdir}/libubsan.so.*" | ||
| 88 | FILES_libubsan-dbg += "${libdir}/.debug/libubsan.so.*" | ||
| 89 | FILES_libubsan-dev += "\ | ||
| 90 | ${libdir}/libubsan.so \ | ||
| 91 | ${libdir}/libubsan.la \ | ||
| 92 | " | ||
| 93 | FILES_libubsan-staticdev += "${libdir}/libubsan.a" | ||
| 94 | |||
| 95 | FILES_liblsan += "${libdir}/liblsan.so.*" | ||
| 96 | FILES_liblsan-dbg += "${libdir}/.debug/liblsan.so.*" | ||
| 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.*" | ||
| 104 | FILES_libtsan-dbg += "${libdir}/.debug/libtsan.so.*" | ||
| 105 | FILES_libtsan-dev += "\ | ||
| 106 | ${libdir}/libtsan.so \ | ||
| 107 | ${libdir}/libtsan.la \ | ||
| 108 | " | ||
| 109 | FILES_libtsan-staticdev += "${libdir}/libtsan.a" | ||
| 110 | |||
| 111 | FILES_${PN} = "${libdir}/*.spec ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/sanitizer/*.h" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers_4.8.bb b/meta/recipes-devtools/gcc/gcc-sanitizers_4.8.bb new file mode 100644 index 0000000000..601f666023 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-sanitizers_4.8.bb | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | require recipes-devtools/gcc/gcc-${PV}.inc | ||
| 2 | require gcc-sanitizers.inc | ||
diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb b/meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb new file mode 100644 index 0000000000..601f666023 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | require recipes-devtools/gcc/gcc-${PV}.inc | ||
| 2 | require gcc-sanitizers.inc | ||
