blob: ace706dbf4ddbdd6cec036d4e560d4f4bb9328a1 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001require gcc-configure-common.inc
2
Patrick Williamsc0f7c042017-02-23 20:41:17 -06003SUMMARY = "Runtime libraries from GCC"
4
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05005# Over-ride the LICENSE set by gcc-${PV}.inc to remove "& GPLv3"
6# All gcc-runtime packages are now covered by the runtime exception.
7LICENSE = "GPL-3.0-with-GCC-exception"
8
9CXXFLAGS_remove = "-fvisibility-inlines-hidden"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050010
11EXTRA_OECONF_PATHS = "\
12 --with-gxx-include-dir=${includedir}/c++/${BINV} \
13 --with-sysroot=/not/exist \
14 --with-build-sysroot=${STAGING_DIR_TARGET} \
15"
16
17EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
Brad Bishop19323692019-04-05 15:28:33 -040018EXTRA_OECONF_append = " --cache-file=${B}/config.cache"
Andrew Geissler82c905d2020-04-13 13:39:40 -050019EXTRA_OECONF_append_libc-newlib = " --with-newlib"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050020
Brad Bishop08902b02019-08-20 09:16:51 -040021# Disable ifuncs for libatomic on arm conflicts -march/-mcpu
22EXTRA_OECONF_append_arm = " libat_cv_have_ifunc=no "
Andrew Geissler82c905d2020-04-13 13:39:40 -050023EXTRA_OECONF_append_armeb = " libat_cv_have_ifunc=no "
24
25DISABLE_STATIC_class-nativesdk ?= ""
26
27# Newlib does not support symbol versioning on libsdtcc++
28SYMVERS_CONF_libc-newlib = ""
Brad Bishop08902b02019-08-20 09:16:51 -040029
30# Building with thumb enabled on armv6t fails
31ARM_INSTRUCTION_SET_armv6 = "arm"
32
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050033RUNTIMELIBITM = "libitm"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080034RUNTIMELIBITM_arc = ""
Brad Bishop6e60e8b2018-02-01 10:27:11 -050035RUNTIMELIBITM_mipsarch = ""
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050036RUNTIMELIBITM_nios2 = ""
37RUNTIMELIBITM_microblaze = ""
Brad Bishop00111322018-04-01 22:23:53 -040038RUNTIMELIBITM_riscv32 = ""
39RUNTIMELIBITM_riscv64 = ""
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080040RUNTIMELIBSSP ?= ""
41RUNTIMELIBSSP_mingw32 ?= "libssp"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050042
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080043RUNTIMETARGET = "${RUNTIMELIBSSP} libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050044 ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \
45"
Andrew Geissler82c905d2020-04-13 13:39:40 -050046# Only build libstdc++ for newlib
47RUNTIMETARGET_libc-newlib = "libstdc++-v3"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050048
Patrick Williamsc124f4f2015-09-15 14:41:29 -050049# libiberty
50# libmudflap
51# libgfortran needs separate recipe due to libquadmath dependency
52
Brad Bishop316dfdd2018-06-25 12:45:53 -040053SLIB = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
54SLIB_NEW = "/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}"
55
56DEBUG_PREFIX_MAP_class-target = " \
57 -fdebug-prefix-map=${WORKDIR}/recipe-sysroot= \
58 -fdebug-prefix-map=${WORKDIR}/recipe-sysroot-native= \
59 -fdebug-prefix-map=${SLIB}=${SLIB_NEW} \
60 -fdebug-prefix-map=${SLIB}/include=${SLIB_NEW}/libstdc++-v3/../include \
61 -fdebug-prefix-map=${SLIB}/libiberty=${SLIB_NEW}/libstdc++-v3/../libiberty \
62 -fdebug-prefix-map=${B}=${SLIB_NEW} \
63 "
64
Patrick Williamsc124f4f2015-09-15 14:41:29 -050065do_configure () {
66 export CXX="${CXX} -nostdinc++ -nostdlib++"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050067 for d in libgcc ${RUNTIMETARGET}; do
68 echo "Configuring $d"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050069 rm -rf ${B}/${TARGET_SYS}/$d/
70 mkdir -p ${B}/${TARGET_SYS}/$d/
71 cd ${B}/${TARGET_SYS}/$d/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050072 chmod a+x ${S}/$d/configure
Brad Bishop6e60e8b2018-02-01 10:27:11 -050073 relpath=${@os.path.relpath("${S}/$d", "${B}/${TARGET_SYS}/$d")}
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050074 $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
Brad Bishopd7bf8c12018-02-25 22:55:05 -050075 if [ "$d" = "libgcc" ]; then
76 (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
77 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050078 done
79}
Brad Bishop6e60e8b2018-02-01 10:27:11 -050080EXTRACONFFUNCS += "extract_stashed_builddir"
81do_configure[depends] += "${COMPILERDEP}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050082
83do_compile () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050084 for d in libgcc ${RUNTIMETARGET}; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050085 cd ${B}/${TARGET_SYS}/$d/
86 oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050087 done
88}
89
90do_install () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050091 for d in ${RUNTIMETARGET}; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050092 cd ${B}/${TARGET_SYS}/$d/
93 oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
Patrick Williamsc124f4f2015-09-15 14:41:29 -050094 done
Brad Bishop08902b02019-08-20 09:16:51 -040095 if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then
96 install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include
97 mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include
98 rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include
99 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500100 rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500101 rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500102 rm -rf ${D}${infodir}/libquadmath.info ${D}${infodir}/dir
103 if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then
104 rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
105 fi
106 if [ -d ${D}${infodir} ]; then
107 rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
108 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600109}
110
111do_install_append_class-target () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500112 if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
113 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
114 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600115
116 if [ "${TARGET_OS}" = "linux-gnun32" ]; then
Brad Bishopf3fd2882019-06-21 08:06:37 -0400117 if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
118 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux
119 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux/32
120 elif [ "${MULTILIB_VARIANTS}" != "" ]; then
121 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
122 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux/32
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600123 else
124 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
125 fi
Brad Bishopf3fd2882019-06-21 08:06:37 -0400126 elif [ "${TARGET_OS}" = "linux-gnux32" ]; then
127 if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
128 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux
129 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux/x32
130 elif [ "${MULTILIB_VARIANTS}" != "" ]; then
131 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
132 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux/32
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600133 else
134 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
135 fi
Brad Bishopf3fd2882019-06-21 08:06:37 -0400136 elif [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
Brad Bishopc8f47122019-06-24 09:36:18 -0400137 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}
Brad Bishopf3fd2882019-06-21 08:06:37 -0400138 ln -s ../${TARGET_SYS}/bits ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}/bits
139 ln -s ../${TARGET_SYS}/ext ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}/ext
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600140 fi
141
142 if [ "${TCLIBC}" != "glibc" ]; then
143 case "${TARGET_OS}" in
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500144 "linux-musl" | "linux-*spe") extra_target_os="linux";;
145 "linux-musleabi") extra_target_os="linux-gnueabi";;
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600146 *) extra_target_os="linux";;
147 esac
148 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os
149 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500150 chown -R root:root ${D}
151}
152
153INHIBIT_DEFAULT_DEPS = "1"
Brad Bishop19323692019-04-05 15:28:33 -0400154DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc virtual/${MLPREFIX}libc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500155PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
156
157BBCLASSEXTEND = "nativesdk"
158
159PACKAGES = "\
160 ${PN}-dbg \
161 libstdc++ \
162 libstdc++-precompile-dev \
163 libstdc++-dev \
164 libstdc++-staticdev \
165 libg2c \
166 libg2c-dev \
167 libssp \
168 libssp-dev \
169 libssp-staticdev \
170 libmudflap \
171 libmudflap-dev \
172 libmudflap-staticdev \
173 libquadmath \
174 libquadmath-dev \
175 libquadmath-staticdev \
176 libgomp \
177 libgomp-dev \
178 libgomp-staticdev \
179 libatomic \
180 libatomic-dev \
181 libatomic-staticdev \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500182 libitm \
183 libitm-dev \
184 libitm-staticdev \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500185"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500186# The base package doesn't exist, so we clear the recommends.
187RRECOMMENDS_${PN}-dbg = ""
188
189# include python debugging scripts
190FILES_${PN}-dbg += "\
Andrew Geissler82c905d2020-04-13 13:39:40 -0500191 ${libdir}/libstdc++.*-gdb.py \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500192 ${datadir}/gcc-${BINV}/python/libstdcxx \
193"
194
195FILES_libg2c = "${target_libdir}/libg2c.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600196SUMMARY_libg2c = "Companion runtime library for g77"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500197FILES_libg2c-dev = "\
198 ${libdir}/libg2c.so \
199 ${libdir}/libg2c.a \
200 ${libdir}/libfrtbegin.a \
201"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600202SUMMARY_libg2c-dev = "Companion runtime library for g77 - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500203
204FILES_libstdc++ = "${libdir}/libstdc++.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600205SUMMARY_libstdc++ = "GNU standard C++ library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500206FILES_libstdc++-dev = "\
207 ${includedir}/c++/ \
208 ${libdir}/libstdc++.so \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500209 ${libdir}/libstdc++*.la \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500210 ${libdir}/libsupc++.la \
211"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600212SUMMARY_libstdc++-dev = "GNU standard C++ library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500213FILES_libstdc++-staticdev = "\
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500214 ${libdir}/libstdc++*.a \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500215 ${libdir}/libsupc++.a \
216"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600217SUMMARY_libstdc++-staticdev = "GNU standard C++ library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500218
219FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600220SUMMARY_libstdc++-precompile-dev = "GNU standard C++ library - precompiled header files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500221
222FILES_libssp = "${libdir}/libssp.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600223SUMMARY_libssp = "GNU stack smashing protection library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500224FILES_libssp-dev = "\
225 ${libdir}/libssp*.so \
226 ${libdir}/libssp*_nonshared.a \
227 ${libdir}/libssp*.la \
Brad Bishop08902b02019-08-20 09:16:51 -0400228 ${libdir}/${TARGET_SYS}/${BINV}/include/ssp \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500229"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600230SUMMARY_libssp-dev = "GNU stack smashing protection library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500231FILES_libssp-staticdev = "${libdir}/libssp*.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600232SUMMARY_libssp-staticdev = "GNU stack smashing protection library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500233
234FILES_libquadmath = "${libdir}/libquadmath*.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600235SUMMARY_libquadmath = "GNU quad-precision math library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500236FILES_libquadmath-dev = "\
Brad Bishop08902b02019-08-20 09:16:51 -0400237 ${libdir}/${TARGET_SYS}/${BINV}/include/quadmath* \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500238 ${libdir}/libquadmath*.so \
239 ${libdir}/libquadmath.la \
240"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600241SUMMARY_libquadmath-dev = "GNU quad-precision math library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500242FILES_libquadmath-staticdev = "${libdir}/libquadmath.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600243SUMMARY_libquadmath-staticdev = "GNU quad-precision math library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500244
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600245# NOTE: mudflap has been removed as of gcc 4.9 and has been superseded by the address sanitiser
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500246FILES_libmudflap = "${libdir}/libmudflap*.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600247SUMMARY_libmudflap = "Pointer debugging library for gcc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500248FILES_libmudflap-dev = "\
249 ${libdir}/libmudflap*.so \
250 ${libdir}/libmudflap.la \
251"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600252SUMMARY_libmudflap-dev = "Pointer debugging library for gcc - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500253FILES_libmudflap-staticdev = "${libdir}/libmudflap.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600254SUMMARY_libmudflap-staticdev = "Pointer debugging library for gcc - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500255
256FILES_libgomp = "${libdir}/libgomp*${SOLIBS}"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600257SUMMARY_libgomp = "GNU OpenMP parallel programming library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500258FILES_libgomp-dev = "\
259 ${libdir}/libgomp*${SOLIBSDEV} \
260 ${libdir}/libgomp*.la \
261 ${libdir}/libgomp.spec \
Brad Bishop08902b02019-08-20 09:16:51 -0400262 ${libdir}/${TARGET_SYS}/${BINV}/include/omp.h \
263 ${libdir}/${TARGET_SYS}/${BINV}/include/openacc.h \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500264"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600265SUMMARY_libgomp-dev = "GNU OpenMP parallel programming library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500266FILES_libgomp-staticdev = "${libdir}/libgomp*.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600267SUMMARY_libgomp-staticdev = "GNU OpenMP parallel programming library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500268
269FILES_libatomic = "${libdir}/libatomic.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600270SUMMARY_libatomic = "GNU C++11 atomics support library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500271FILES_libatomic-dev = "\
272 ${libdir}/libatomic.so \
273 ${libdir}/libatomic.la \
274"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600275SUMMARY_libatomic-dev = "GNU C++11 atomics support library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500276FILES_libatomic-staticdev = "${libdir}/libatomic.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600277SUMMARY_libatomic-staticdev = "GNU C++11 atomics support library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500278
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500279FILES_libitm = "${libdir}/libitm.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600280SUMMARY_libitm = "GNU transactional memory support library"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500281FILES_libitm-dev = "\
282 ${libdir}/libitm.so \
283 ${libdir}/libitm.la \
284 ${libdir}/libitm.spec \
285"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600286SUMMARY_libitm-dev = "GNU transactional memory support library - development files"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500287FILES_libitm-staticdev = "${libdir}/libitm.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600288SUMMARY_libitm-staticdev = "GNU transactional memory support library - static development files"
Brad Bishop79641f22019-09-10 07:20:22 -0400289
290require gcc-testsuite.inc
291
292EXTRA_OEMAKE_prepend_task-check = "${PARALLEL_MAKE} "
293
294MAKE_CHECK_TARGETS ??= "check-gcc ${@" ".join("check-target-" + i for i in d.getVar("RUNTIMETARGET").split())}"
295# prettyprinters and xmethods require gdb tooling
296MAKE_CHECK_IGNORE ??= "prettyprinters.exp xmethods.exp"
297MAKE_CHECK_RUNTESTFLAGS ??= "${MAKE_CHECK_BOARDARGS} --ignore '${MAKE_CHECK_IGNORE}'"
298
299# specific host and target dependencies required for test suite running
300do_check[depends] += "dejagnu-native:do_populate_sysroot expect-native:do_populate_sysroot"
301do_check[depends] += "virtual/libc:do_populate_sysroot"
302# only depend on qemu if targeting linux user execution
303do_check[depends] += "${@'qemu-native:do_populate_sysroot' if "user" in d.getVar('TOOLCHAIN_TEST_TARGET') else ''}"
304# extend the recipe sysroot to include the built libraries (for qemu usermode)
305do_check[prefuncs] += "extend_recipe_sysroot"
306do_check[prefuncs] += "check_prepare"
307do_check[dirs] = "${WORKDIR}/dejagnu ${B}"
308do_check[nostamp] = "1"
309do_check() {
310 export DEJAGNU="${WORKDIR}/dejagnu/site.exp"
311
312 # HACK: this works around the configure setting CXX with -nostd* args
313 sed -i 's/-nostdinc++ -nostdlib++//g' $(find ${B} -name testsuite_flags | head -1)
Brad Bishop79641f22019-09-10 07:20:22 -0400314
315 if [ "${TOOLCHAIN_TEST_TARGET}" = "user" ]; then
316 # qemu user has issues allocating large amounts of memory
317 export G_SLICE=always-malloc
318 # no test should need more that 10G of memory, this prevents tests like pthread7-rope from leaking memory
319 ulimit -m 4194304
320 ulimit -v 10485760
321 fi
322
323 oe_runmake -i ${MAKE_CHECK_TARGETS} RUNTESTFLAGS="${MAKE_CHECK_RUNTESTFLAGS}"
324}
325addtask check after do_compile do_populate_sysroot
326