blob: 7629fa56ff6b8bdf739854d7f4f9bdfceb1e680f [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"
18
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050019RUNTIMELIBITM = "libitm"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050020RUNTIMELIBITM_mipsarch = ""
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050021RUNTIMELIBITM_nios2 = ""
22RUNTIMELIBITM_microblaze = ""
Brad Bishop00111322018-04-01 22:23:53 -040023RUNTIMELIBITM_riscv32 = ""
24RUNTIMELIBITM_riscv64 = ""
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050025
26RUNTIMETARGET = "libssp libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
27 ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \
28"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050029RUNTIMETARGET_append_x86 = " libmpx"
30RUNTIMETARGET_append_x86-64 = " libmpx"
31RUNTIMETARGET_remove_libc-musl = "libmpx"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050032
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033# libiberty
34# libmudflap
35# libgfortran needs separate recipe due to libquadmath dependency
36
Brad Bishop316dfdd2018-06-25 12:45:53 -040037SLIB = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
38SLIB_NEW = "/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}"
39
40DEBUG_PREFIX_MAP_class-target = " \
41 -fdebug-prefix-map=${WORKDIR}/recipe-sysroot= \
42 -fdebug-prefix-map=${WORKDIR}/recipe-sysroot-native= \
43 -fdebug-prefix-map=${SLIB}=${SLIB_NEW} \
44 -fdebug-prefix-map=${SLIB}/include=${SLIB_NEW}/libstdc++-v3/../include \
45 -fdebug-prefix-map=${SLIB}/libiberty=${SLIB_NEW}/libstdc++-v3/../libiberty \
46 -fdebug-prefix-map=${B}=${SLIB_NEW} \
47 "
48
Patrick Williamsc124f4f2015-09-15 14:41:29 -050049do_configure () {
50 export CXX="${CXX} -nostdinc++ -nostdlib++"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050051 for d in libgcc ${RUNTIMETARGET}; do
52 echo "Configuring $d"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050053 rm -rf ${B}/${TARGET_SYS}/$d/
54 mkdir -p ${B}/${TARGET_SYS}/$d/
55 cd ${B}/${TARGET_SYS}/$d/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050056 chmod a+x ${S}/$d/configure
Brad Bishop6e60e8b2018-02-01 10:27:11 -050057 relpath=${@os.path.relpath("${S}/$d", "${B}/${TARGET_SYS}/$d")}
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050058 $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
Brad Bishopd7bf8c12018-02-25 22:55:05 -050059 if [ "$d" = "libgcc" ]; then
60 (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
61 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050062 done
63}
Brad Bishop6e60e8b2018-02-01 10:27:11 -050064EXTRACONFFUNCS += "extract_stashed_builddir"
65do_configure[depends] += "${COMPILERDEP}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050066
67do_compile () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050068 for d in libgcc ${RUNTIMETARGET}; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050069 cd ${B}/${TARGET_SYS}/$d/
70 oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050071 done
72}
73
74do_install () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050075 for d in ${RUNTIMETARGET}; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050076 cd ${B}/${TARGET_SYS}/$d/
77 oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
Patrick Williamsc124f4f2015-09-15 14:41:29 -050078 done
79 rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050080 rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir
Patrick Williamsc124f4f2015-09-15 14:41:29 -050081 rm -rf ${D}${infodir}/libquadmath.info ${D}${infodir}/dir
82 if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then
83 rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
84 fi
85 if [ -d ${D}${infodir} ]; then
86 rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
87 fi
Patrick Williamsf1e5d692016-03-30 15:21:19 -050088 if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
89 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}
90 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -060091
92}
93
94do_install_append_class-target () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050095 if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
96 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
97 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -060098
99 if [ "${TARGET_OS}" = "linux-gnun32" ]; then
100 if [ "${MULTILIBS}" != "" ]; then
101 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-pokymllib64-linux
102 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-pokymllib64-linux/32
103 else
104 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
105 fi
106 fi
107 if [ "${TARGET_OS}" = "linux-gnux32" ]; then
108 if [ "${MULTILIBS}" != "" ]; then
109 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-poky-linux
110 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-poky-linux/x32
111 else
112 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
113 fi
114 fi
115
116 if [ "${TCLIBC}" != "glibc" ]; then
117 case "${TARGET_OS}" in
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500118 "linux-musl" | "linux-*spe") extra_target_os="linux";;
119 "linux-musleabi") extra_target_os="linux-gnueabi";;
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600120 *) extra_target_os="linux";;
121 esac
122 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os
123 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500124 chown -R root:root ${D}
125}
126
127INHIBIT_DEFAULT_DEPS = "1"
128DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc"
129PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
130
131BBCLASSEXTEND = "nativesdk"
132
133PACKAGES = "\
134 ${PN}-dbg \
135 libstdc++ \
136 libstdc++-precompile-dev \
137 libstdc++-dev \
138 libstdc++-staticdev \
139 libg2c \
140 libg2c-dev \
141 libssp \
142 libssp-dev \
143 libssp-staticdev \
144 libmudflap \
145 libmudflap-dev \
146 libmudflap-staticdev \
147 libquadmath \
148 libquadmath-dev \
149 libquadmath-staticdev \
150 libgomp \
151 libgomp-dev \
152 libgomp-staticdev \
153 libatomic \
154 libatomic-dev \
155 libatomic-staticdev \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500156 libitm \
157 libitm-dev \
158 libitm-staticdev \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500159"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500160PACKAGES_append_x86 = "\
161 libmpx \
162 libmpx-dev \
163 libmpx-staticdev \
164"
165
166PACKAGES_append_x86-64 = "\
167 libmpx \
168 libmpx-dev \
169 libmpx-staticdev \
170"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500171
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500172# The base package doesn't exist, so we clear the recommends.
173RRECOMMENDS_${PN}-dbg = ""
174
175# include python debugging scripts
176FILES_${PN}-dbg += "\
177 ${libdir}/libstdc++.so.*-gdb.py \
178 ${datadir}/gcc-${BINV}/python/libstdcxx \
179"
180
181FILES_libg2c = "${target_libdir}/libg2c.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600182SUMMARY_libg2c = "Companion runtime library for g77"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500183FILES_libg2c-dev = "\
184 ${libdir}/libg2c.so \
185 ${libdir}/libg2c.a \
186 ${libdir}/libfrtbegin.a \
187"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600188SUMMARY_libg2c-dev = "Companion runtime library for g77 - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500189
190FILES_libstdc++ = "${libdir}/libstdc++.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600191SUMMARY_libstdc++ = "GNU standard C++ library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500192FILES_libstdc++-dev = "\
193 ${includedir}/c++/ \
194 ${libdir}/libstdc++.so \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500195 ${libdir}/libstdc++*.la \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500196 ${libdir}/libsupc++.la \
197"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600198SUMMARY_libstdc++-dev = "GNU standard C++ library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500199FILES_libstdc++-staticdev = "\
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500200 ${libdir}/libstdc++*.a \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500201 ${libdir}/libsupc++.a \
202"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600203SUMMARY_libstdc++-staticdev = "GNU standard C++ library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500204
205FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600206SUMMARY_libstdc++-precompile-dev = "GNU standard C++ library - precompiled header files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500207
208FILES_libssp = "${libdir}/libssp.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600209SUMMARY_libssp = "GNU stack smashing protection library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500210FILES_libssp-dev = "\
211 ${libdir}/libssp*.so \
212 ${libdir}/libssp*_nonshared.a \
213 ${libdir}/libssp*.la \
214 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \
215"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600216SUMMARY_libssp-dev = "GNU stack smashing protection library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500217FILES_libssp-staticdev = "${libdir}/libssp*.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600218SUMMARY_libssp-staticdev = "GNU stack smashing protection library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500219
220FILES_libquadmath = "${libdir}/libquadmath*.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600221SUMMARY_libquadmath = "GNU quad-precision math library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500222FILES_libquadmath-dev = "\
223 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \
224 ${libdir}/libquadmath*.so \
225 ${libdir}/libquadmath.la \
226"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600227SUMMARY_libquadmath-dev = "GNU quad-precision math library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500228FILES_libquadmath-staticdev = "${libdir}/libquadmath.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600229SUMMARY_libquadmath-staticdev = "GNU quad-precision math library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500230
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600231# 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 -0500232FILES_libmudflap = "${libdir}/libmudflap*.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600233SUMMARY_libmudflap = "Pointer debugging library for gcc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500234FILES_libmudflap-dev = "\
235 ${libdir}/libmudflap*.so \
236 ${libdir}/libmudflap.la \
237"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600238SUMMARY_libmudflap-dev = "Pointer debugging library for gcc - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500239FILES_libmudflap-staticdev = "${libdir}/libmudflap.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600240SUMMARY_libmudflap-staticdev = "Pointer debugging library for gcc - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500241
242FILES_libgomp = "${libdir}/libgomp*${SOLIBS}"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600243SUMMARY_libgomp = "GNU OpenMP parallel programming library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500244FILES_libgomp-dev = "\
245 ${libdir}/libgomp*${SOLIBSDEV} \
246 ${libdir}/libgomp*.la \
247 ${libdir}/libgomp.spec \
248 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \
249"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600250SUMMARY_libgomp-dev = "GNU OpenMP parallel programming library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500251FILES_libgomp-staticdev = "${libdir}/libgomp*.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600252SUMMARY_libgomp-staticdev = "GNU OpenMP parallel programming library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500253
254FILES_libatomic = "${libdir}/libatomic.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600255SUMMARY_libatomic = "GNU C++11 atomics support library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500256FILES_libatomic-dev = "\
257 ${libdir}/libatomic.so \
258 ${libdir}/libatomic.la \
259"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600260SUMMARY_libatomic-dev = "GNU C++11 atomics support library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500261FILES_libatomic-staticdev = "${libdir}/libatomic.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600262SUMMARY_libatomic-staticdev = "GNU C++11 atomics support library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500263
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500264FILES_libitm = "${libdir}/libitm.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600265SUMMARY_libitm = "GNU transactional memory support library"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500266FILES_libitm-dev = "\
267 ${libdir}/libitm.so \
268 ${libdir}/libitm.la \
269 ${libdir}/libitm.spec \
270"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600271SUMMARY_libitm-dev = "GNU transactional memory support library - development files"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500272FILES_libitm-staticdev = "${libdir}/libitm.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600273SUMMARY_libitm-staticdev = "GNU transactional memory support library - static development files"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500274
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500275
276FILES_libmpx = "${libdir}/libmpx.so.* ${libdir}/libmpxwrappers.so.*"
277SUMMARY_libmpx = "Intel Memory Protection Extension library"
278FILES_libmpx-dev = "\
279 ${libdir}/libmpxwrappers.so \
280 ${libdir}/libmpxwrappers.la \
281 ${libdir}/libmpx.so \
282 ${libdir}/libmpx.la \
283 ${libdir}/libmpx.spec \
284"
285SUMMARY_libmpx-dev = "Intel Memory Protection Extension library - development files"
286FILES_libmpx-staticdev = "${libdir}/libmpx.a ${libdir}/libmpxwrappers.a"
287SUMMARY_libmpx-staticdev = "Intel Memory Protection Extension library - static development files"
288
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500289do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
290do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
291do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"