blob: 64b6168ba76e27fb7e35ae647166d21b55457461 [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
Andrew Geisslerd5838332022-05-27 11:33:10 -05005# Over-ride the LICENSE set by gcc-${PV}.inc to remove "& GPLv3"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05006# All gcc-runtime packages are now covered by the runtime exception.
7LICENSE = "GPL-3.0-with-GCC-exception"
8
Patrick Williams213cb262021-08-07 19:21:33 -05009CXXFLAGS: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
Patrick Williams213cb262021-08-07 19:21:33 -050017EXTRA_OECONF:append:linuxstdbase = " --enable-clocale=gnu"
18EXTRA_OECONF:append = " --cache-file=${B}/config.cache"
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050019EXTRA_OECONF:append:libc-newlib = " --with-newlib --with-target-subdir"
20EXTRA_OECONF:append:libc-baremetal = " --with-target-subdir"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021
Brad Bishop08902b02019-08-20 09:16:51 -040022# Disable ifuncs for libatomic on arm conflicts -march/-mcpu
Patrick Williams213cb262021-08-07 19:21:33 -050023EXTRA_OECONF:append:arm = " libat_cv_have_ifunc=no "
24EXTRA_OECONF:append:armeb = " libat_cv_have_ifunc=no "
Andrew Geissler82c905d2020-04-13 13:39:40 -050025
Patrick Williams213cb262021-08-07 19:21:33 -050026DISABLE_STATIC:class-nativesdk ?= ""
Andrew Geissler82c905d2020-04-13 13:39:40 -050027
28# Newlib does not support symbol versioning on libsdtcc++
Patrick Williams213cb262021-08-07 19:21:33 -050029SYMVERS_CONF:libc-newlib = ""
Brad Bishop08902b02019-08-20 09:16:51 -040030
31# Building with thumb enabled on armv6t fails
Patrick Williams213cb262021-08-07 19:21:33 -050032ARM_INSTRUCTION_SET:armv6 = "arm"
Brad Bishop08902b02019-08-20 09:16:51 -040033
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050034RUNTIMELIBITM = "libitm"
Patrick Williams213cb262021-08-07 19:21:33 -050035RUNTIMELIBITM:arc = ""
36RUNTIMELIBITM:mipsarch = ""
37RUNTIMELIBITM:nios2 = ""
38RUNTIMELIBITM:microblaze = ""
39RUNTIMELIBITM:riscv32 = ""
40RUNTIMELIBITM:riscv64 = ""
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050041RUNTIMELIBITM:loongarch64 = ""
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080042RUNTIMELIBSSP ?= ""
Patrick Williams213cb262021-08-07 19:21:33 -050043RUNTIMELIBSSP:mingw32 ?= "libssp"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050044
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080045RUNTIMETARGET = "${RUNTIMELIBSSP} libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050046 ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \
47"
Andrew Geissler82c905d2020-04-13 13:39:40 -050048# Only build libstdc++ for newlib
Patrick Williams213cb262021-08-07 19:21:33 -050049RUNTIMETARGET:libc-newlib = "libstdc++-v3"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050050
Patrick Williamsc124f4f2015-09-15 14:41:29 -050051# libiberty
Patrick Williamsc124f4f2015-09-15 14:41:29 -050052# libgfortran needs separate recipe due to libquadmath dependency
53
54do_configure () {
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000055 export CXX="${CXX} -nostdinc++ -L${WORKDIR}/dummylib"
56 # libstdc++ isn't built yet so CXX would error not able to find it which breaks stdc++'s configure
57 # tests. Create a dummy empty lib for the purposes of configure.
58 mkdir -p ${WORKDIR}/dummylib
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050059 ${CC} -x c /dev/null -c -o ${WORKDIR}/dummylib/dummylib.o
60 ${AR} rcs ${WORKDIR}/dummylib/libstdc++.a ${WORKDIR}/dummylib/dummylib.o
Patrick Williamsc124f4f2015-09-15 14:41:29 -050061 for d in libgcc ${RUNTIMETARGET}; do
62 echo "Configuring $d"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050063 rm -rf ${B}/${TARGET_SYS}/$d/
64 mkdir -p ${B}/${TARGET_SYS}/$d/
65 cd ${B}/${TARGET_SYS}/$d/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050066 chmod a+x ${S}/$d/configure
Patrick Williams92b42cb2022-09-03 06:53:57 -050067 ${S}/$d/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
Brad Bishopd7bf8c12018-02-25 22:55:05 -050068 if [ "$d" = "libgcc" ]; then
69 (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
70 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050071 done
72}
Brad Bishop6e60e8b2018-02-01 10:27:11 -050073EXTRACONFFUNCS += "extract_stashed_builddir"
74do_configure[depends] += "${COMPILERDEP}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050075
76do_compile () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050077 for d in libgcc ${RUNTIMETARGET}; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050078 cd ${B}/${TARGET_SYS}/$d/
79 oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050080 done
81}
82
83do_install () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050084 for d in ${RUNTIMETARGET}; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050085 cd ${B}/${TARGET_SYS}/$d/
86 oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
Patrick Williamsc124f4f2015-09-15 14:41:29 -050087 done
Brad Bishop08902b02019-08-20 09:16:51 -040088 if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then
89 install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include
90 mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include
91 rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include
92 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050093 rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050094 rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir
Patrick Williamsc124f4f2015-09-15 14:41:29 -050095 rm -rf ${D}${infodir}/libquadmath.info ${D}${infodir}/dir
96 if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then
97 rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
98 fi
99 if [ -d ${D}${infodir} ]; then
100 rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
101 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600102}
103
Patrick Williams213cb262021-08-07 19:21:33 -0500104do_install:append:class-target () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500105 if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
106 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
107 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600108
109 if [ "${TARGET_OS}" = "linux-gnun32" ]; then
Brad Bishopf3fd2882019-06-21 08:06:37 -0400110 if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
111 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux
112 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux/32
113 elif [ "${MULTILIB_VARIANTS}" != "" ]; then
114 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
115 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux/32
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600116 else
117 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
118 fi
Brad Bishopf3fd2882019-06-21 08:06:37 -0400119 elif [ "${TARGET_OS}" = "linux-gnux32" ]; then
120 if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
121 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux
122 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux/x32
123 elif [ "${MULTILIB_VARIANTS}" != "" ]; then
124 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
125 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux/32
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600126 else
127 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
128 fi
Brad Bishopf3fd2882019-06-21 08:06:37 -0400129 elif [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
Brad Bishopc8f47122019-06-24 09:36:18 -0400130 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}
Brad Bishopf3fd2882019-06-21 08:06:37 -0400131 ln -s ../${TARGET_SYS}/bits ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}/bits
132 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 -0600133 fi
134
Andrew Geissler5082cc72023-09-11 08:41:39 -0400135 if [ "${TARGET_ARCH}" = "x86_64" -a "${MULTILIB_VARIANTS}" != "" ];then
Andrew Geissler635e0e42020-08-21 15:58:33 -0500136 ln -sf ../${X86ARCH32}${TARGET_VENDOR}-${TARGET_OS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}/32
137 fi
138
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600139 if [ "${TCLIBC}" != "glibc" ]; then
140 case "${TARGET_OS}" in
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500141 "linux-musl" | "linux-*spe") extra_target_os="linux";;
142 "linux-musleabi") extra_target_os="linux-gnueabi";;
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600143 *) extra_target_os="linux";;
144 esac
145 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os
146 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500147 chown -R root:root ${D}
148}
149
150INHIBIT_DEFAULT_DEPS = "1"
Brad Bishop19323692019-04-05 15:28:33 -0400151DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc virtual/${MLPREFIX}libc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500152PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
153
154BBCLASSEXTEND = "nativesdk"
155
156PACKAGES = "\
157 ${PN}-dbg \
158 libstdc++ \
159 libstdc++-precompile-dev \
160 libstdc++-dev \
161 libstdc++-staticdev \
162 libg2c \
163 libg2c-dev \
164 libssp \
165 libssp-dev \
166 libssp-staticdev \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500167 libquadmath \
168 libquadmath-dev \
169 libquadmath-staticdev \
170 libgomp \
171 libgomp-dev \
172 libgomp-staticdev \
173 libatomic \
174 libatomic-dev \
175 libatomic-staticdev \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500176 libitm \
177 libitm-dev \
178 libitm-staticdev \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500179"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500180# The base package doesn't exist, so we clear the recommends.
Patrick Williams213cb262021-08-07 19:21:33 -0500181RRECOMMENDS:${PN}-dbg = ""
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500182
183# include python debugging scripts
Patrick Williams213cb262021-08-07 19:21:33 -0500184FILES:${PN}-dbg += "\
Andrew Geissler82c905d2020-04-13 13:39:40 -0500185 ${libdir}/libstdc++.*-gdb.py \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500186 ${datadir}/gcc-${BINV}/python/libstdcxx \
187"
188
Patrick Williams213cb262021-08-07 19:21:33 -0500189FILES:libg2c = "${target_libdir}/libg2c.so.*"
190SUMMARY:libg2c = "Companion runtime library for g77"
191FILES:libg2c-dev = "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500192 ${libdir}/libg2c.so \
193 ${libdir}/libg2c.a \
194 ${libdir}/libfrtbegin.a \
195"
Patrick Williams213cb262021-08-07 19:21:33 -0500196SUMMARY:libg2c-dev = "Companion runtime library for g77 - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500197
Patrick Williams213cb262021-08-07 19:21:33 -0500198FILES:libstdc++ = "${libdir}/libstdc++.so.*"
199SUMMARY:libstdc++ = "GNU standard C++ library"
200FILES:libstdc++-dev = "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500201 ${includedir}/c++/ \
202 ${libdir}/libstdc++.so \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500203 ${libdir}/libstdc++*.la \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500204 ${libdir}/libsupc++.la \
205"
Patrick Williams213cb262021-08-07 19:21:33 -0500206SUMMARY:libstdc++-dev = "GNU standard C++ library - development files"
207FILES:libstdc++-staticdev = "\
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500208 ${libdir}/libstdc++*.a \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500209 ${libdir}/libsupc++.a \
210"
Patrick Williams213cb262021-08-07 19:21:33 -0500211SUMMARY:libstdc++-staticdev = "GNU standard C++ library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500212
Patrick Williams213cb262021-08-07 19:21:33 -0500213FILES:libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
214SUMMARY:libstdc++-precompile-dev = "GNU standard C++ library - precompiled header files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500215
Patrick Williams213cb262021-08-07 19:21:33 -0500216FILES:libssp = "${libdir}/libssp.so.*"
217SUMMARY:libssp = "GNU stack smashing protection library"
218FILES:libssp-dev = "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500219 ${libdir}/libssp*.so \
220 ${libdir}/libssp*_nonshared.a \
221 ${libdir}/libssp*.la \
Brad Bishop08902b02019-08-20 09:16:51 -0400222 ${libdir}/${TARGET_SYS}/${BINV}/include/ssp \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500223"
Patrick Williams213cb262021-08-07 19:21:33 -0500224SUMMARY:libssp-dev = "GNU stack smashing protection library - development files"
225FILES:libssp-staticdev = "${libdir}/libssp*.a"
226SUMMARY:libssp-staticdev = "GNU stack smashing protection library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500227
Patrick Williams213cb262021-08-07 19:21:33 -0500228FILES:libquadmath = "${libdir}/libquadmath*.so.*"
229SUMMARY:libquadmath = "GNU quad-precision math library"
230FILES:libquadmath-dev = "\
Brad Bishop08902b02019-08-20 09:16:51 -0400231 ${libdir}/${TARGET_SYS}/${BINV}/include/quadmath* \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500232 ${libdir}/libquadmath*.so \
233 ${libdir}/libquadmath.la \
234"
Patrick Williams213cb262021-08-07 19:21:33 -0500235SUMMARY:libquadmath-dev = "GNU quad-precision math library - development files"
236FILES:libquadmath-staticdev = "${libdir}/libquadmath.a"
237SUMMARY:libquadmath-staticdev = "GNU quad-precision math library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500238
Patrick Williams213cb262021-08-07 19:21:33 -0500239FILES:libgomp = "${libdir}/libgomp*${SOLIBS}"
240SUMMARY:libgomp = "GNU OpenMP parallel programming library"
241FILES:libgomp-dev = "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500242 ${libdir}/libgomp*${SOLIBSDEV} \
243 ${libdir}/libgomp*.la \
244 ${libdir}/libgomp.spec \
Andrew Geisslerc182c622020-05-15 14:13:32 -0500245 ${libdir}/${TARGET_SYS}/${BINV}/include/acc_prof.h \
Brad Bishop08902b02019-08-20 09:16:51 -0400246 ${libdir}/${TARGET_SYS}/${BINV}/include/omp.h \
247 ${libdir}/${TARGET_SYS}/${BINV}/include/openacc.h \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500248"
Patrick Williams213cb262021-08-07 19:21:33 -0500249SUMMARY:libgomp-dev = "GNU OpenMP parallel programming library - development files"
250FILES:libgomp-staticdev = "${libdir}/libgomp*.a"
251SUMMARY:libgomp-staticdev = "GNU OpenMP parallel programming library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500252
Patrick Williams213cb262021-08-07 19:21:33 -0500253FILES:libatomic = "${libdir}/libatomic.so.*"
254SUMMARY:libatomic = "GNU C++11 atomics support library"
255FILES:libatomic-dev = "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500256 ${libdir}/libatomic.so \
257 ${libdir}/libatomic.la \
258"
Patrick Williams213cb262021-08-07 19:21:33 -0500259SUMMARY:libatomic-dev = "GNU C++11 atomics support library - development files"
260FILES:libatomic-staticdev = "${libdir}/libatomic.a"
261SUMMARY:libatomic-staticdev = "GNU C++11 atomics support library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500262
Patrick Williams213cb262021-08-07 19:21:33 -0500263FILES:libitm = "${libdir}/libitm.so.*"
264SUMMARY:libitm = "GNU transactional memory support library"
265FILES:libitm-dev = "\
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500266 ${libdir}/libitm.so \
267 ${libdir}/libitm.la \
268 ${libdir}/libitm.spec \
269"
Patrick Williams213cb262021-08-07 19:21:33 -0500270SUMMARY:libitm-dev = "GNU transactional memory support library - development files"
271FILES:libitm-staticdev = "${libdir}/libitm.a"
272SUMMARY:libitm-staticdev = "GNU transactional memory support library - static development files"
Brad Bishop79641f22019-09-10 07:20:22 -0400273
274require gcc-testsuite.inc
275
Patrick Williams213cb262021-08-07 19:21:33 -0500276EXTRA_OEMAKE:prepend:task-check = "${PARALLEL_MAKE} "
Brad Bishop79641f22019-09-10 07:20:22 -0400277
278MAKE_CHECK_TARGETS ??= "check-gcc ${@" ".join("check-target-" + i for i in d.getVar("RUNTIMETARGET").split())}"
279# prettyprinters and xmethods require gdb tooling
280MAKE_CHECK_IGNORE ??= "prettyprinters.exp xmethods.exp"
281MAKE_CHECK_RUNTESTFLAGS ??= "${MAKE_CHECK_BOARDARGS} --ignore '${MAKE_CHECK_IGNORE}'"
282
283# specific host and target dependencies required for test suite running
284do_check[depends] += "dejagnu-native:do_populate_sysroot expect-native:do_populate_sysroot"
285do_check[depends] += "virtual/libc:do_populate_sysroot"
286# only depend on qemu if targeting linux user execution
287do_check[depends] += "${@'qemu-native:do_populate_sysroot' if "user" in d.getVar('TOOLCHAIN_TEST_TARGET') else ''}"
288# extend the recipe sysroot to include the built libraries (for qemu usermode)
289do_check[prefuncs] += "extend_recipe_sysroot"
290do_check[prefuncs] += "check_prepare"
291do_check[dirs] = "${WORKDIR}/dejagnu ${B}"
292do_check[nostamp] = "1"
293do_check() {
294 export DEJAGNU="${WORKDIR}/dejagnu/site.exp"
295
296 # HACK: this works around the configure setting CXX with -nostd* args
Andrew Geissler7e0e3c02022-02-25 20:34:39 +0000297 sed -i 's#-nostdinc++ -L${WORKDIR}/dummylib##g' $(find ${B} -name testsuite_flags | head -1)
Brad Bishop79641f22019-09-10 07:20:22 -0400298
299 if [ "${TOOLCHAIN_TEST_TARGET}" = "user" ]; then
300 # qemu user has issues allocating large amounts of memory
301 export G_SLICE=always-malloc
302 # no test should need more that 10G of memory, this prevents tests like pthread7-rope from leaking memory
303 ulimit -m 4194304
304 ulimit -v 10485760
305 fi
306
307 oe_runmake -i ${MAKE_CHECK_TARGETS} RUNTESTFLAGS="${MAKE_CHECK_RUNTESTFLAGS}"
308}
309addtask check after do_compile do_populate_sysroot
310