blob: fa5b048dab70e1bed0cf76013d7a45930635d294 [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 = ""
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080041RUNTIMELIBSSP ?= ""
Patrick Williams213cb262021-08-07 19:21:33 -050042RUNTIMELIBSSP:mingw32 ?= "libssp"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050043
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080044RUNTIMETARGET = "${RUNTIMELIBSSP} libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050045 ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \
46"
Andrew Geissler82c905d2020-04-13 13:39:40 -050047# Only build libstdc++ for newlib
Patrick Williams213cb262021-08-07 19:21:33 -050048RUNTIMETARGET:libc-newlib = "libstdc++-v3"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050049
Patrick Williamsc124f4f2015-09-15 14:41:29 -050050# libiberty
Patrick Williamsc124f4f2015-09-15 14:41:29 -050051# libgfortran needs separate recipe due to libquadmath dependency
52
53do_configure () {
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000054 export CXX="${CXX} -nostdinc++ -L${WORKDIR}/dummylib"
55 # libstdc++ isn't built yet so CXX would error not able to find it which breaks stdc++'s configure
56 # tests. Create a dummy empty lib for the purposes of configure.
57 mkdir -p ${WORKDIR}/dummylib
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050058 ${CC} -x c /dev/null -c -o ${WORKDIR}/dummylib/dummylib.o
59 ${AR} rcs ${WORKDIR}/dummylib/libstdc++.a ${WORKDIR}/dummylib/dummylib.o
Patrick Williamsc124f4f2015-09-15 14:41:29 -050060 for d in libgcc ${RUNTIMETARGET}; do
61 echo "Configuring $d"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050062 rm -rf ${B}/${TARGET_SYS}/$d/
63 mkdir -p ${B}/${TARGET_SYS}/$d/
64 cd ${B}/${TARGET_SYS}/$d/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050065 chmod a+x ${S}/$d/configure
Patrick Williams92b42cb2022-09-03 06:53:57 -050066 ${S}/$d/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
Brad Bishopd7bf8c12018-02-25 22:55:05 -050067 if [ "$d" = "libgcc" ]; then
68 (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
69 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050070 done
71}
Brad Bishop6e60e8b2018-02-01 10:27:11 -050072EXTRACONFFUNCS += "extract_stashed_builddir"
73do_configure[depends] += "${COMPILERDEP}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050074
75do_compile () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050076 for d in libgcc ${RUNTIMETARGET}; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050077 cd ${B}/${TARGET_SYS}/$d/
78 oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050079 done
80}
81
82do_install () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050083 for d in ${RUNTIMETARGET}; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050084 cd ${B}/${TARGET_SYS}/$d/
85 oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
Patrick Williamsc124f4f2015-09-15 14:41:29 -050086 done
Brad Bishop08902b02019-08-20 09:16:51 -040087 if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then
88 install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include
89 mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include
90 rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include
91 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050092 rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050093 rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir
Patrick Williamsc124f4f2015-09-15 14:41:29 -050094 rm -rf ${D}${infodir}/libquadmath.info ${D}${infodir}/dir
95 if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then
96 rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
97 fi
98 if [ -d ${D}${infodir} ]; then
99 rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
100 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600101}
102
Patrick Williams213cb262021-08-07 19:21:33 -0500103do_install:append:class-target () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500104 if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
105 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
106 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600107
108 if [ "${TARGET_OS}" = "linux-gnun32" ]; then
Brad Bishopf3fd2882019-06-21 08:06:37 -0400109 if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
110 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux
111 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux/32
112 elif [ "${MULTILIB_VARIANTS}" != "" ]; then
113 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
114 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux/32
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600115 else
116 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
117 fi
Brad Bishopf3fd2882019-06-21 08:06:37 -0400118 elif [ "${TARGET_OS}" = "linux-gnux32" ]; then
119 if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
120 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux
121 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux/x32
122 elif [ "${MULTILIB_VARIANTS}" != "" ]; then
123 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
124 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux/32
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600125 else
126 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
127 fi
Brad Bishopf3fd2882019-06-21 08:06:37 -0400128 elif [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
Brad Bishopc8f47122019-06-24 09:36:18 -0400129 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}
Brad Bishopf3fd2882019-06-21 08:06:37 -0400130 ln -s ../${TARGET_SYS}/bits ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}/bits
131 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 -0600132 fi
133
Andrew Geissler635e0e42020-08-21 15:58:33 -0500134 if [ "${TARGET_ARCH}" == "x86_64" -a "${MULTILIB_VARIANTS}" != "" ];then
135 ln -sf ../${X86ARCH32}${TARGET_VENDOR}-${TARGET_OS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}/32
136 fi
137
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600138 if [ "${TCLIBC}" != "glibc" ]; then
139 case "${TARGET_OS}" in
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500140 "linux-musl" | "linux-*spe") extra_target_os="linux";;
141 "linux-musleabi") extra_target_os="linux-gnueabi";;
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600142 *) extra_target_os="linux";;
143 esac
144 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os
145 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500146 chown -R root:root ${D}
147}
148
149INHIBIT_DEFAULT_DEPS = "1"
Brad Bishop19323692019-04-05 15:28:33 -0400150DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc virtual/${MLPREFIX}libc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500151PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
152
153BBCLASSEXTEND = "nativesdk"
154
155PACKAGES = "\
156 ${PN}-dbg \
157 libstdc++ \
158 libstdc++-precompile-dev \
159 libstdc++-dev \
160 libstdc++-staticdev \
161 libg2c \
162 libg2c-dev \
163 libssp \
164 libssp-dev \
165 libssp-staticdev \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500166 libquadmath \
167 libquadmath-dev \
168 libquadmath-staticdev \
169 libgomp \
170 libgomp-dev \
171 libgomp-staticdev \
172 libatomic \
173 libatomic-dev \
174 libatomic-staticdev \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500175 libitm \
176 libitm-dev \
177 libitm-staticdev \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500178"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500179# The base package doesn't exist, so we clear the recommends.
Patrick Williams213cb262021-08-07 19:21:33 -0500180RRECOMMENDS:${PN}-dbg = ""
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500181
182# include python debugging scripts
Patrick Williams213cb262021-08-07 19:21:33 -0500183FILES:${PN}-dbg += "\
Andrew Geissler82c905d2020-04-13 13:39:40 -0500184 ${libdir}/libstdc++.*-gdb.py \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500185 ${datadir}/gcc-${BINV}/python/libstdcxx \
186"
187
Patrick Williams213cb262021-08-07 19:21:33 -0500188FILES:libg2c = "${target_libdir}/libg2c.so.*"
189SUMMARY:libg2c = "Companion runtime library for g77"
190FILES:libg2c-dev = "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500191 ${libdir}/libg2c.so \
192 ${libdir}/libg2c.a \
193 ${libdir}/libfrtbegin.a \
194"
Patrick Williams213cb262021-08-07 19:21:33 -0500195SUMMARY:libg2c-dev = "Companion runtime library for g77 - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500196
Patrick Williams213cb262021-08-07 19:21:33 -0500197FILES:libstdc++ = "${libdir}/libstdc++.so.*"
198SUMMARY:libstdc++ = "GNU standard C++ library"
199FILES:libstdc++-dev = "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500200 ${includedir}/c++/ \
201 ${libdir}/libstdc++.so \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500202 ${libdir}/libstdc++*.la \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500203 ${libdir}/libsupc++.la \
204"
Patrick Williams213cb262021-08-07 19:21:33 -0500205SUMMARY:libstdc++-dev = "GNU standard C++ library - development files"
206FILES:libstdc++-staticdev = "\
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500207 ${libdir}/libstdc++*.a \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500208 ${libdir}/libsupc++.a \
209"
Patrick Williams213cb262021-08-07 19:21:33 -0500210SUMMARY:libstdc++-staticdev = "GNU standard C++ library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500211
Patrick Williams213cb262021-08-07 19:21:33 -0500212FILES:libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
213SUMMARY:libstdc++-precompile-dev = "GNU standard C++ library - precompiled header files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500214
Patrick Williams213cb262021-08-07 19:21:33 -0500215FILES:libssp = "${libdir}/libssp.so.*"
216SUMMARY:libssp = "GNU stack smashing protection library"
217FILES:libssp-dev = "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500218 ${libdir}/libssp*.so \
219 ${libdir}/libssp*_nonshared.a \
220 ${libdir}/libssp*.la \
Brad Bishop08902b02019-08-20 09:16:51 -0400221 ${libdir}/${TARGET_SYS}/${BINV}/include/ssp \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500222"
Patrick Williams213cb262021-08-07 19:21:33 -0500223SUMMARY:libssp-dev = "GNU stack smashing protection library - development files"
224FILES:libssp-staticdev = "${libdir}/libssp*.a"
225SUMMARY:libssp-staticdev = "GNU stack smashing protection library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500226
Patrick Williams213cb262021-08-07 19:21:33 -0500227FILES:libquadmath = "${libdir}/libquadmath*.so.*"
228SUMMARY:libquadmath = "GNU quad-precision math library"
229FILES:libquadmath-dev = "\
Brad Bishop08902b02019-08-20 09:16:51 -0400230 ${libdir}/${TARGET_SYS}/${BINV}/include/quadmath* \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500231 ${libdir}/libquadmath*.so \
232 ${libdir}/libquadmath.la \
233"
Patrick Williams213cb262021-08-07 19:21:33 -0500234SUMMARY:libquadmath-dev = "GNU quad-precision math library - development files"
235FILES:libquadmath-staticdev = "${libdir}/libquadmath.a"
236SUMMARY:libquadmath-staticdev = "GNU quad-precision math library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500237
Patrick Williams213cb262021-08-07 19:21:33 -0500238FILES:libgomp = "${libdir}/libgomp*${SOLIBS}"
239SUMMARY:libgomp = "GNU OpenMP parallel programming library"
240FILES:libgomp-dev = "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500241 ${libdir}/libgomp*${SOLIBSDEV} \
242 ${libdir}/libgomp*.la \
243 ${libdir}/libgomp.spec \
Andrew Geisslerc182c622020-05-15 14:13:32 -0500244 ${libdir}/${TARGET_SYS}/${BINV}/include/acc_prof.h \
Brad Bishop08902b02019-08-20 09:16:51 -0400245 ${libdir}/${TARGET_SYS}/${BINV}/include/omp.h \
246 ${libdir}/${TARGET_SYS}/${BINV}/include/openacc.h \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500247"
Patrick Williams213cb262021-08-07 19:21:33 -0500248SUMMARY:libgomp-dev = "GNU OpenMP parallel programming library - development files"
249FILES:libgomp-staticdev = "${libdir}/libgomp*.a"
250SUMMARY:libgomp-staticdev = "GNU OpenMP parallel programming library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500251
Patrick Williams213cb262021-08-07 19:21:33 -0500252FILES:libatomic = "${libdir}/libatomic.so.*"
253SUMMARY:libatomic = "GNU C++11 atomics support library"
254FILES:libatomic-dev = "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500255 ${libdir}/libatomic.so \
256 ${libdir}/libatomic.la \
257"
Patrick Williams213cb262021-08-07 19:21:33 -0500258SUMMARY:libatomic-dev = "GNU C++11 atomics support library - development files"
259FILES:libatomic-staticdev = "${libdir}/libatomic.a"
260SUMMARY:libatomic-staticdev = "GNU C++11 atomics support library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500261
Patrick Williams213cb262021-08-07 19:21:33 -0500262FILES:libitm = "${libdir}/libitm.so.*"
263SUMMARY:libitm = "GNU transactional memory support library"
264FILES:libitm-dev = "\
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500265 ${libdir}/libitm.so \
266 ${libdir}/libitm.la \
267 ${libdir}/libitm.spec \
268"
Patrick Williams213cb262021-08-07 19:21:33 -0500269SUMMARY:libitm-dev = "GNU transactional memory support library - development files"
270FILES:libitm-staticdev = "${libdir}/libitm.a"
271SUMMARY:libitm-staticdev = "GNU transactional memory support library - static development files"
Brad Bishop79641f22019-09-10 07:20:22 -0400272
273require gcc-testsuite.inc
274
Patrick Williams213cb262021-08-07 19:21:33 -0500275EXTRA_OEMAKE:prepend:task-check = "${PARALLEL_MAKE} "
Brad Bishop79641f22019-09-10 07:20:22 -0400276
277MAKE_CHECK_TARGETS ??= "check-gcc ${@" ".join("check-target-" + i for i in d.getVar("RUNTIMETARGET").split())}"
278# prettyprinters and xmethods require gdb tooling
279MAKE_CHECK_IGNORE ??= "prettyprinters.exp xmethods.exp"
280MAKE_CHECK_RUNTESTFLAGS ??= "${MAKE_CHECK_BOARDARGS} --ignore '${MAKE_CHECK_IGNORE}'"
281
282# specific host and target dependencies required for test suite running
283do_check[depends] += "dejagnu-native:do_populate_sysroot expect-native:do_populate_sysroot"
284do_check[depends] += "virtual/libc:do_populate_sysroot"
285# only depend on qemu if targeting linux user execution
286do_check[depends] += "${@'qemu-native:do_populate_sysroot' if "user" in d.getVar('TOOLCHAIN_TEST_TARGET') else ''}"
287# extend the recipe sysroot to include the built libraries (for qemu usermode)
288do_check[prefuncs] += "extend_recipe_sysroot"
289do_check[prefuncs] += "check_prepare"
290do_check[dirs] = "${WORKDIR}/dejagnu ${B}"
291do_check[nostamp] = "1"
292do_check() {
293 export DEJAGNU="${WORKDIR}/dejagnu/site.exp"
294
295 # HACK: this works around the configure setting CXX with -nostd* args
Andrew Geissler7e0e3c02022-02-25 20:34:39 +0000296 sed -i 's#-nostdinc++ -L${WORKDIR}/dummylib##g' $(find ${B} -name testsuite_flags | head -1)
Brad Bishop79641f22019-09-10 07:20:22 -0400297
298 if [ "${TOOLCHAIN_TEST_TARGET}" = "user" ]; then
299 # qemu user has issues allocating large amounts of memory
300 export G_SLICE=always-malloc
301 # no test should need more that 10G of memory, this prevents tests like pthread7-rope from leaking memory
302 ulimit -m 4194304
303 ulimit -v 10485760
304 fi
305
306 oe_runmake -i ${MAKE_CHECK_TARGETS} RUNTESTFLAGS="${MAKE_CHECK_RUNTESTFLAGS}"
307}
308addtask check after do_compile do_populate_sysroot
309