blob: e9f2cf16e8402ed253d2cf414d773ef97af9f1dd [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 Geissler9aee5002022-03-30 16:27:02 +00005# Over-ride the LICENSE set by gcc-${PV}.inc to remove "& GPL-3.0-only"
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"
19EXTRA_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
Patrick Williams213cb262021-08-07 19:21:33 -050022EXTRA_OECONF:append:arm = " libat_cv_have_ifunc=no "
23EXTRA_OECONF:append:armeb = " libat_cv_have_ifunc=no "
Andrew Geissler82c905d2020-04-13 13:39:40 -050024
Patrick Williams213cb262021-08-07 19:21:33 -050025DISABLE_STATIC:class-nativesdk ?= ""
Andrew Geissler82c905d2020-04-13 13:39:40 -050026
27# Newlib does not support symbol versioning on libsdtcc++
Patrick Williams213cb262021-08-07 19:21:33 -050028SYMVERS_CONF:libc-newlib = ""
Brad Bishop08902b02019-08-20 09:16:51 -040029
30# Building with thumb enabled on armv6t fails
Patrick Williams213cb262021-08-07 19:21:33 -050031ARM_INSTRUCTION_SET:armv6 = "arm"
Brad Bishop08902b02019-08-20 09:16:51 -040032
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050033RUNTIMELIBITM = "libitm"
Patrick Williams213cb262021-08-07 19:21:33 -050034RUNTIMELIBITM:arc = ""
35RUNTIMELIBITM:mipsarch = ""
36RUNTIMELIBITM:nios2 = ""
37RUNTIMELIBITM:microblaze = ""
38RUNTIMELIBITM:riscv32 = ""
39RUNTIMELIBITM:riscv64 = ""
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080040RUNTIMELIBSSP ?= ""
Patrick Williams213cb262021-08-07 19:21:33 -050041RUNTIMELIBSSP: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
Patrick Williams213cb262021-08-07 19:21:33 -050047RUNTIMETARGET:libc-newlib = "libstdc++-v3"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050048
Patrick Williamsc124f4f2015-09-15 14:41:29 -050049# libiberty
Patrick Williamsc124f4f2015-09-15 14:41:29 -050050# libgfortran needs separate recipe due to libquadmath dependency
51
Andrew Geisslerc926e172021-05-07 16:11:35 -050052# Relative path to be repaced into debug info
53REL_S = "/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}"
Brad Bishop316dfdd2018-06-25 12:45:53 -040054
Patrick Williams213cb262021-08-07 19:21:33 -050055DEBUG_PREFIX_MAP:class-target = " \
Brad Bishop316dfdd2018-06-25 12:45:53 -040056 -fdebug-prefix-map=${WORKDIR}/recipe-sysroot= \
57 -fdebug-prefix-map=${WORKDIR}/recipe-sysroot-native= \
Andrew Geisslerc926e172021-05-07 16:11:35 -050058 -fdebug-prefix-map=${S}=${REL_S} \
59 -fdebug-prefix-map=${S}/include=${REL_S}/libstdc++-v3/../include \
60 -fdebug-prefix-map=${S}/libiberty=${REL_S}/libstdc++-v3/../libiberty \
61 -fdebug-prefix-map=${S}/libgcc=${REL_S}/libstdc++-v3/../libgcc \
62 -fdebug-prefix-map=${B}=${REL_S} \
63 -ffile-prefix-map=${B}/${HOST_SYS}/libstdc++-v3/include=${includedir}/c++/${BINV} \
Brad Bishop316dfdd2018-06-25 12:45:53 -040064 "
65
Patrick Williamsc124f4f2015-09-15 14:41:29 -050066do_configure () {
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000067 export CXX="${CXX} -nostdinc++ -L${WORKDIR}/dummylib"
68 # libstdc++ isn't built yet so CXX would error not able to find it which breaks stdc++'s configure
69 # tests. Create a dummy empty lib for the purposes of configure.
70 mkdir -p ${WORKDIR}/dummylib
71 touch ${WORKDIR}/dummylib/libstdc++.so
Patrick Williamsc124f4f2015-09-15 14:41:29 -050072 for d in libgcc ${RUNTIMETARGET}; do
73 echo "Configuring $d"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050074 rm -rf ${B}/${TARGET_SYS}/$d/
75 mkdir -p ${B}/${TARGET_SYS}/$d/
76 cd ${B}/${TARGET_SYS}/$d/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050077 chmod a+x ${S}/$d/configure
Brad Bishop6e60e8b2018-02-01 10:27:11 -050078 relpath=${@os.path.relpath("${S}/$d", "${B}/${TARGET_SYS}/$d")}
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050079 $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
Brad Bishopd7bf8c12018-02-25 22:55:05 -050080 if [ "$d" = "libgcc" ]; then
81 (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
82 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050083 done
84}
Brad Bishop6e60e8b2018-02-01 10:27:11 -050085EXTRACONFFUNCS += "extract_stashed_builddir"
86do_configure[depends] += "${COMPILERDEP}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050087
88do_compile () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050089 for d in libgcc ${RUNTIMETARGET}; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050090 cd ${B}/${TARGET_SYS}/$d/
91 oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050092 done
93}
94
95do_install () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050096 for d in ${RUNTIMETARGET}; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050097 cd ${B}/${TARGET_SYS}/$d/
98 oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
Patrick Williamsc124f4f2015-09-15 14:41:29 -050099 done
Brad Bishop08902b02019-08-20 09:16:51 -0400100 if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then
101 install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include
102 mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include
103 rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include
104 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500105 rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500106 rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500107 rm -rf ${D}${infodir}/libquadmath.info ${D}${infodir}/dir
108 if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then
109 rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
110 fi
111 if [ -d ${D}${infodir} ]; then
112 rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
113 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600114}
115
Patrick Williams213cb262021-08-07 19:21:33 -0500116do_install:append:class-target () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500117 if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
118 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
119 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600120
121 if [ "${TARGET_OS}" = "linux-gnun32" ]; then
Brad Bishopf3fd2882019-06-21 08:06:37 -0400122 if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
123 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux
124 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux/32
125 elif [ "${MULTILIB_VARIANTS}" != "" ]; then
126 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
127 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux/32
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600128 else
129 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
130 fi
Brad Bishopf3fd2882019-06-21 08:06:37 -0400131 elif [ "${TARGET_OS}" = "linux-gnux32" ]; then
132 if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
133 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux
134 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux/x32
135 elif [ "${MULTILIB_VARIANTS}" != "" ]; then
136 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
137 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux/32
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600138 else
139 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
140 fi
Brad Bishopf3fd2882019-06-21 08:06:37 -0400141 elif [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
Brad Bishopc8f47122019-06-24 09:36:18 -0400142 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}
Brad Bishopf3fd2882019-06-21 08:06:37 -0400143 ln -s ../${TARGET_SYS}/bits ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}/bits
144 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 -0600145 fi
146
Andrew Geissler635e0e42020-08-21 15:58:33 -0500147 if [ "${TARGET_ARCH}" == "x86_64" -a "${MULTILIB_VARIANTS}" != "" ];then
148 ln -sf ../${X86ARCH32}${TARGET_VENDOR}-${TARGET_OS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}/32
149 fi
150
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600151 if [ "${TCLIBC}" != "glibc" ]; then
152 case "${TARGET_OS}" in
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500153 "linux-musl" | "linux-*spe") extra_target_os="linux";;
154 "linux-musleabi") extra_target_os="linux-gnueabi";;
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600155 *) extra_target_os="linux";;
156 esac
157 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os
158 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500159 chown -R root:root ${D}
160}
161
162INHIBIT_DEFAULT_DEPS = "1"
Brad Bishop19323692019-04-05 15:28:33 -0400163DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc virtual/${MLPREFIX}libc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500164PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
165
166BBCLASSEXTEND = "nativesdk"
167
168PACKAGES = "\
169 ${PN}-dbg \
170 libstdc++ \
171 libstdc++-precompile-dev \
172 libstdc++-dev \
173 libstdc++-staticdev \
174 libg2c \
175 libg2c-dev \
176 libssp \
177 libssp-dev \
178 libssp-staticdev \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500179 libquadmath \
180 libquadmath-dev \
181 libquadmath-staticdev \
182 libgomp \
183 libgomp-dev \
184 libgomp-staticdev \
185 libatomic \
186 libatomic-dev \
187 libatomic-staticdev \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500188 libitm \
189 libitm-dev \
190 libitm-staticdev \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500191"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500192# The base package doesn't exist, so we clear the recommends.
Patrick Williams213cb262021-08-07 19:21:33 -0500193RRECOMMENDS:${PN}-dbg = ""
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500194
195# include python debugging scripts
Patrick Williams213cb262021-08-07 19:21:33 -0500196FILES:${PN}-dbg += "\
Andrew Geissler82c905d2020-04-13 13:39:40 -0500197 ${libdir}/libstdc++.*-gdb.py \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500198 ${datadir}/gcc-${BINV}/python/libstdcxx \
199"
200
Patrick Williams213cb262021-08-07 19:21:33 -0500201FILES:libg2c = "${target_libdir}/libg2c.so.*"
202SUMMARY:libg2c = "Companion runtime library for g77"
203FILES:libg2c-dev = "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500204 ${libdir}/libg2c.so \
205 ${libdir}/libg2c.a \
206 ${libdir}/libfrtbegin.a \
207"
Patrick Williams213cb262021-08-07 19:21:33 -0500208SUMMARY:libg2c-dev = "Companion runtime library for g77 - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500209
Patrick Williams213cb262021-08-07 19:21:33 -0500210FILES:libstdc++ = "${libdir}/libstdc++.so.*"
211SUMMARY:libstdc++ = "GNU standard C++ library"
212FILES:libstdc++-dev = "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500213 ${includedir}/c++/ \
214 ${libdir}/libstdc++.so \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500215 ${libdir}/libstdc++*.la \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500216 ${libdir}/libsupc++.la \
217"
Patrick Williams213cb262021-08-07 19:21:33 -0500218SUMMARY:libstdc++-dev = "GNU standard C++ library - development files"
219FILES:libstdc++-staticdev = "\
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500220 ${libdir}/libstdc++*.a \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500221 ${libdir}/libsupc++.a \
222"
Patrick Williams213cb262021-08-07 19:21:33 -0500223SUMMARY:libstdc++-staticdev = "GNU standard C++ library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500224
Patrick Williams213cb262021-08-07 19:21:33 -0500225FILES:libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
226SUMMARY:libstdc++-precompile-dev = "GNU standard C++ library - precompiled header files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500227
Patrick Williams213cb262021-08-07 19:21:33 -0500228FILES:libssp = "${libdir}/libssp.so.*"
229SUMMARY:libssp = "GNU stack smashing protection library"
230FILES:libssp-dev = "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500231 ${libdir}/libssp*.so \
232 ${libdir}/libssp*_nonshared.a \
233 ${libdir}/libssp*.la \
Brad Bishop08902b02019-08-20 09:16:51 -0400234 ${libdir}/${TARGET_SYS}/${BINV}/include/ssp \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500235"
Patrick Williams213cb262021-08-07 19:21:33 -0500236SUMMARY:libssp-dev = "GNU stack smashing protection library - development files"
237FILES:libssp-staticdev = "${libdir}/libssp*.a"
238SUMMARY:libssp-staticdev = "GNU stack smashing protection library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500239
Patrick Williams213cb262021-08-07 19:21:33 -0500240FILES:libquadmath = "${libdir}/libquadmath*.so.*"
241SUMMARY:libquadmath = "GNU quad-precision math library"
242FILES:libquadmath-dev = "\
Brad Bishop08902b02019-08-20 09:16:51 -0400243 ${libdir}/${TARGET_SYS}/${BINV}/include/quadmath* \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500244 ${libdir}/libquadmath*.so \
245 ${libdir}/libquadmath.la \
246"
Patrick Williams213cb262021-08-07 19:21:33 -0500247SUMMARY:libquadmath-dev = "GNU quad-precision math library - development files"
248FILES:libquadmath-staticdev = "${libdir}/libquadmath.a"
249SUMMARY:libquadmath-staticdev = "GNU quad-precision math library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500250
Patrick Williams213cb262021-08-07 19:21:33 -0500251FILES:libgomp = "${libdir}/libgomp*${SOLIBS}"
252SUMMARY:libgomp = "GNU OpenMP parallel programming library"
253FILES:libgomp-dev = "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500254 ${libdir}/libgomp*${SOLIBSDEV} \
255 ${libdir}/libgomp*.la \
256 ${libdir}/libgomp.spec \
Andrew Geisslerc182c622020-05-15 14:13:32 -0500257 ${libdir}/${TARGET_SYS}/${BINV}/include/acc_prof.h \
Brad Bishop08902b02019-08-20 09:16:51 -0400258 ${libdir}/${TARGET_SYS}/${BINV}/include/omp.h \
259 ${libdir}/${TARGET_SYS}/${BINV}/include/openacc.h \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500260"
Patrick Williams213cb262021-08-07 19:21:33 -0500261SUMMARY:libgomp-dev = "GNU OpenMP parallel programming library - development files"
262FILES:libgomp-staticdev = "${libdir}/libgomp*.a"
263SUMMARY:libgomp-staticdev = "GNU OpenMP parallel programming library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500264
Patrick Williams213cb262021-08-07 19:21:33 -0500265FILES:libatomic = "${libdir}/libatomic.so.*"
266SUMMARY:libatomic = "GNU C++11 atomics support library"
267FILES:libatomic-dev = "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500268 ${libdir}/libatomic.so \
269 ${libdir}/libatomic.la \
270"
Patrick Williams213cb262021-08-07 19:21:33 -0500271SUMMARY:libatomic-dev = "GNU C++11 atomics support library - development files"
272FILES:libatomic-staticdev = "${libdir}/libatomic.a"
273SUMMARY:libatomic-staticdev = "GNU C++11 atomics support library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500274
Patrick Williams213cb262021-08-07 19:21:33 -0500275FILES:libitm = "${libdir}/libitm.so.*"
276SUMMARY:libitm = "GNU transactional memory support library"
277FILES:libitm-dev = "\
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500278 ${libdir}/libitm.so \
279 ${libdir}/libitm.la \
280 ${libdir}/libitm.spec \
281"
Patrick Williams213cb262021-08-07 19:21:33 -0500282SUMMARY:libitm-dev = "GNU transactional memory support library - development files"
283FILES:libitm-staticdev = "${libdir}/libitm.a"
284SUMMARY:libitm-staticdev = "GNU transactional memory support library - static development files"
Brad Bishop79641f22019-09-10 07:20:22 -0400285
286require gcc-testsuite.inc
287
Patrick Williams213cb262021-08-07 19:21:33 -0500288EXTRA_OEMAKE:prepend:task-check = "${PARALLEL_MAKE} "
Brad Bishop79641f22019-09-10 07:20:22 -0400289
290MAKE_CHECK_TARGETS ??= "check-gcc ${@" ".join("check-target-" + i for i in d.getVar("RUNTIMETARGET").split())}"
291# prettyprinters and xmethods require gdb tooling
292MAKE_CHECK_IGNORE ??= "prettyprinters.exp xmethods.exp"
293MAKE_CHECK_RUNTESTFLAGS ??= "${MAKE_CHECK_BOARDARGS} --ignore '${MAKE_CHECK_IGNORE}'"
294
295# specific host and target dependencies required for test suite running
296do_check[depends] += "dejagnu-native:do_populate_sysroot expect-native:do_populate_sysroot"
297do_check[depends] += "virtual/libc:do_populate_sysroot"
298# only depend on qemu if targeting linux user execution
299do_check[depends] += "${@'qemu-native:do_populate_sysroot' if "user" in d.getVar('TOOLCHAIN_TEST_TARGET') else ''}"
300# extend the recipe sysroot to include the built libraries (for qemu usermode)
301do_check[prefuncs] += "extend_recipe_sysroot"
302do_check[prefuncs] += "check_prepare"
303do_check[dirs] = "${WORKDIR}/dejagnu ${B}"
304do_check[nostamp] = "1"
305do_check() {
306 export DEJAGNU="${WORKDIR}/dejagnu/site.exp"
307
308 # HACK: this works around the configure setting CXX with -nostd* args
Andrew Geissler7e0e3c02022-02-25 20:34:39 +0000309 sed -i 's#-nostdinc++ -L${WORKDIR}/dummylib##g' $(find ${B} -name testsuite_flags | head -1)
Brad Bishop79641f22019-09-10 07:20:22 -0400310
311 if [ "${TOOLCHAIN_TEST_TARGET}" = "user" ]; then
312 # qemu user has issues allocating large amounts of memory
313 export G_SLICE=always-malloc
314 # no test should need more that 10G of memory, this prevents tests like pthread7-rope from leaking memory
315 ulimit -m 4194304
316 ulimit -v 10485760
317 fi
318
319 oe_runmake -i ${MAKE_CHECK_TARGETS} RUNTESTFLAGS="${MAKE_CHECK_RUNTESTFLAGS}"
320}
321addtask check after do_compile do_populate_sysroot
322