blob: 59d9a24686f5b50e359b9a6cb009ff15837eae0e [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
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
55DEBUG_PREFIX_MAP_class-target = " \
56 -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 () {
67 export CXX="${CXX} -nostdinc++ -nostdlib++"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050068 for d in libgcc ${RUNTIMETARGET}; do
69 echo "Configuring $d"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050070 rm -rf ${B}/${TARGET_SYS}/$d/
71 mkdir -p ${B}/${TARGET_SYS}/$d/
72 cd ${B}/${TARGET_SYS}/$d/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050073 chmod a+x ${S}/$d/configure
Brad Bishop6e60e8b2018-02-01 10:27:11 -050074 relpath=${@os.path.relpath("${S}/$d", "${B}/${TARGET_SYS}/$d")}
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050075 $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
Brad Bishopd7bf8c12018-02-25 22:55:05 -050076 if [ "$d" = "libgcc" ]; then
77 (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
78 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050079 done
80}
Brad Bishop6e60e8b2018-02-01 10:27:11 -050081EXTRACONFFUNCS += "extract_stashed_builddir"
82do_configure[depends] += "${COMPILERDEP}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050083
84do_compile () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050085 for d in libgcc ${RUNTIMETARGET}; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050086 cd ${B}/${TARGET_SYS}/$d/
87 oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050088 done
89}
90
91do_install () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050092 for d in ${RUNTIMETARGET}; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050093 cd ${B}/${TARGET_SYS}/$d/
94 oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
Patrick Williamsc124f4f2015-09-15 14:41:29 -050095 done
Brad Bishop08902b02019-08-20 09:16:51 -040096 if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then
97 install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include
98 mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include
99 rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include
100 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500101 rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500102 rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500103 rm -rf ${D}${infodir}/libquadmath.info ${D}${infodir}/dir
104 if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then
105 rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
106 fi
107 if [ -d ${D}${infodir} ]; then
108 rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
109 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600110}
111
112do_install_append_class-target () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500113 if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
114 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
115 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600116
117 if [ "${TARGET_OS}" = "linux-gnun32" ]; then
Brad Bishopf3fd2882019-06-21 08:06:37 -0400118 if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
119 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux
120 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux/32
121 elif [ "${MULTILIB_VARIANTS}" != "" ]; then
122 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
123 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux/32
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600124 else
125 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
126 fi
Brad Bishopf3fd2882019-06-21 08:06:37 -0400127 elif [ "${TARGET_OS}" = "linux-gnux32" ]; then
128 if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
129 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux
130 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux/x32
131 elif [ "${MULTILIB_VARIANTS}" != "" ]; then
132 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
133 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux/32
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600134 else
135 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
136 fi
Brad Bishopf3fd2882019-06-21 08:06:37 -0400137 elif [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
Brad Bishopc8f47122019-06-24 09:36:18 -0400138 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}
Brad Bishopf3fd2882019-06-21 08:06:37 -0400139 ln -s ../${TARGET_SYS}/bits ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}/bits
140 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 -0600141 fi
142
Andrew Geissler635e0e42020-08-21 15:58:33 -0500143 if [ "${TARGET_ARCH}" == "x86_64" -a "${MULTILIB_VARIANTS}" != "" ];then
144 ln -sf ../${X86ARCH32}${TARGET_VENDOR}-${TARGET_OS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}/32
145 fi
146
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600147 if [ "${TCLIBC}" != "glibc" ]; then
148 case "${TARGET_OS}" in
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500149 "linux-musl" | "linux-*spe") extra_target_os="linux";;
150 "linux-musleabi") extra_target_os="linux-gnueabi";;
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600151 *) extra_target_os="linux";;
152 esac
153 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os
154 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500155 chown -R root:root ${D}
156}
157
158INHIBIT_DEFAULT_DEPS = "1"
Brad Bishop19323692019-04-05 15:28:33 -0400159DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc virtual/${MLPREFIX}libc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500160PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
161
162BBCLASSEXTEND = "nativesdk"
163
164PACKAGES = "\
165 ${PN}-dbg \
166 libstdc++ \
167 libstdc++-precompile-dev \
168 libstdc++-dev \
169 libstdc++-staticdev \
170 libg2c \
171 libg2c-dev \
172 libssp \
173 libssp-dev \
174 libssp-staticdev \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500175 libquadmath \
176 libquadmath-dev \
177 libquadmath-staticdev \
178 libgomp \
179 libgomp-dev \
180 libgomp-staticdev \
181 libatomic \
182 libatomic-dev \
183 libatomic-staticdev \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500184 libitm \
185 libitm-dev \
186 libitm-staticdev \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500187"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500188# The base package doesn't exist, so we clear the recommends.
189RRECOMMENDS_${PN}-dbg = ""
190
191# include python debugging scripts
192FILES_${PN}-dbg += "\
Andrew Geissler82c905d2020-04-13 13:39:40 -0500193 ${libdir}/libstdc++.*-gdb.py \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500194 ${datadir}/gcc-${BINV}/python/libstdcxx \
195"
196
197FILES_libg2c = "${target_libdir}/libg2c.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600198SUMMARY_libg2c = "Companion runtime library for g77"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500199FILES_libg2c-dev = "\
200 ${libdir}/libg2c.so \
201 ${libdir}/libg2c.a \
202 ${libdir}/libfrtbegin.a \
203"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600204SUMMARY_libg2c-dev = "Companion runtime library for g77 - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500205
206FILES_libstdc++ = "${libdir}/libstdc++.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600207SUMMARY_libstdc++ = "GNU standard C++ library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500208FILES_libstdc++-dev = "\
209 ${includedir}/c++/ \
210 ${libdir}/libstdc++.so \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500211 ${libdir}/libstdc++*.la \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500212 ${libdir}/libsupc++.la \
213"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600214SUMMARY_libstdc++-dev = "GNU standard C++ library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500215FILES_libstdc++-staticdev = "\
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500216 ${libdir}/libstdc++*.a \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500217 ${libdir}/libsupc++.a \
218"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600219SUMMARY_libstdc++-staticdev = "GNU standard C++ library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500220
221FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600222SUMMARY_libstdc++-precompile-dev = "GNU standard C++ library - precompiled header files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500223
224FILES_libssp = "${libdir}/libssp.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600225SUMMARY_libssp = "GNU stack smashing protection library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500226FILES_libssp-dev = "\
227 ${libdir}/libssp*.so \
228 ${libdir}/libssp*_nonshared.a \
229 ${libdir}/libssp*.la \
Brad Bishop08902b02019-08-20 09:16:51 -0400230 ${libdir}/${TARGET_SYS}/${BINV}/include/ssp \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500231"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600232SUMMARY_libssp-dev = "GNU stack smashing protection library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500233FILES_libssp-staticdev = "${libdir}/libssp*.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600234SUMMARY_libssp-staticdev = "GNU stack smashing protection library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500235
236FILES_libquadmath = "${libdir}/libquadmath*.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600237SUMMARY_libquadmath = "GNU quad-precision math library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500238FILES_libquadmath-dev = "\
Brad Bishop08902b02019-08-20 09:16:51 -0400239 ${libdir}/${TARGET_SYS}/${BINV}/include/quadmath* \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500240 ${libdir}/libquadmath*.so \
241 ${libdir}/libquadmath.la \
242"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600243SUMMARY_libquadmath-dev = "GNU quad-precision math library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500244FILES_libquadmath-staticdev = "${libdir}/libquadmath.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600245SUMMARY_libquadmath-staticdev = "GNU quad-precision math library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500246
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500247FILES_libgomp = "${libdir}/libgomp*${SOLIBS}"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600248SUMMARY_libgomp = "GNU OpenMP parallel programming library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500249FILES_libgomp-dev = "\
250 ${libdir}/libgomp*${SOLIBSDEV} \
251 ${libdir}/libgomp*.la \
252 ${libdir}/libgomp.spec \
Andrew Geisslerc182c622020-05-15 14:13:32 -0500253 ${libdir}/${TARGET_SYS}/${BINV}/include/acc_prof.h \
Brad Bishop08902b02019-08-20 09:16:51 -0400254 ${libdir}/${TARGET_SYS}/${BINV}/include/omp.h \
255 ${libdir}/${TARGET_SYS}/${BINV}/include/openacc.h \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500256"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600257SUMMARY_libgomp-dev = "GNU OpenMP parallel programming library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500258FILES_libgomp-staticdev = "${libdir}/libgomp*.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600259SUMMARY_libgomp-staticdev = "GNU OpenMP parallel programming library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500260
261FILES_libatomic = "${libdir}/libatomic.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600262SUMMARY_libatomic = "GNU C++11 atomics support library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500263FILES_libatomic-dev = "\
264 ${libdir}/libatomic.so \
265 ${libdir}/libatomic.la \
266"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600267SUMMARY_libatomic-dev = "GNU C++11 atomics support library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500268FILES_libatomic-staticdev = "${libdir}/libatomic.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600269SUMMARY_libatomic-staticdev = "GNU C++11 atomics support library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500270
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500271FILES_libitm = "${libdir}/libitm.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600272SUMMARY_libitm = "GNU transactional memory support library"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500273FILES_libitm-dev = "\
274 ${libdir}/libitm.so \
275 ${libdir}/libitm.la \
276 ${libdir}/libitm.spec \
277"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600278SUMMARY_libitm-dev = "GNU transactional memory support library - development files"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500279FILES_libitm-staticdev = "${libdir}/libitm.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600280SUMMARY_libitm-staticdev = "GNU transactional memory support library - static development files"
Brad Bishop79641f22019-09-10 07:20:22 -0400281
282require gcc-testsuite.inc
283
284EXTRA_OEMAKE_prepend_task-check = "${PARALLEL_MAKE} "
285
286MAKE_CHECK_TARGETS ??= "check-gcc ${@" ".join("check-target-" + i for i in d.getVar("RUNTIMETARGET").split())}"
287# prettyprinters and xmethods require gdb tooling
288MAKE_CHECK_IGNORE ??= "prettyprinters.exp xmethods.exp"
289MAKE_CHECK_RUNTESTFLAGS ??= "${MAKE_CHECK_BOARDARGS} --ignore '${MAKE_CHECK_IGNORE}'"
290
291# specific host and target dependencies required for test suite running
292do_check[depends] += "dejagnu-native:do_populate_sysroot expect-native:do_populate_sysroot"
293do_check[depends] += "virtual/libc:do_populate_sysroot"
294# only depend on qemu if targeting linux user execution
295do_check[depends] += "${@'qemu-native:do_populate_sysroot' if "user" in d.getVar('TOOLCHAIN_TEST_TARGET') else ''}"
296# extend the recipe sysroot to include the built libraries (for qemu usermode)
297do_check[prefuncs] += "extend_recipe_sysroot"
298do_check[prefuncs] += "check_prepare"
299do_check[dirs] = "${WORKDIR}/dejagnu ${B}"
300do_check[nostamp] = "1"
301do_check() {
302 export DEJAGNU="${WORKDIR}/dejagnu/site.exp"
303
304 # HACK: this works around the configure setting CXX with -nostd* args
305 sed -i 's/-nostdinc++ -nostdlib++//g' $(find ${B} -name testsuite_flags | head -1)
Brad Bishop79641f22019-09-10 07:20:22 -0400306
307 if [ "${TOOLCHAIN_TEST_TARGET}" = "user" ]; then
308 # qemu user has issues allocating large amounts of memory
309 export G_SLICE=always-malloc
310 # no test should need more that 10G of memory, this prevents tests like pthread7-rope from leaking memory
311 ulimit -m 4194304
312 ulimit -v 10485760
313 fi
314
315 oe_runmake -i ${MAKE_CHECK_TARGETS} RUNTESTFLAGS="${MAKE_CHECK_RUNTESTFLAGS}"
316}
317addtask check after do_compile do_populate_sysroot
318