blob: 9e7e7c5b3d692b402d72c1614a7a13e33ab6a4e8 [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 Bishop1a4b7ee2018-12-16 17:11:34 -080020RUNTIMELIBITM_arc = ""
Brad Bishop6e60e8b2018-02-01 10:27:11 -050021RUNTIMELIBITM_mipsarch = ""
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050022RUNTIMELIBITM_nios2 = ""
23RUNTIMELIBITM_microblaze = ""
Brad Bishop00111322018-04-01 22:23:53 -040024RUNTIMELIBITM_riscv32 = ""
25RUNTIMELIBITM_riscv64 = ""
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080026RUNTIMELIBSSP ?= ""
27RUNTIMELIBSSP_mingw32 ?= "libssp"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050028
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080029RUNTIMETARGET = "${RUNTIMELIBSSP} libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050030 ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \
31"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050032RUNTIMETARGET_append_x86 = " libmpx"
33RUNTIMETARGET_append_x86-64 = " libmpx"
34RUNTIMETARGET_remove_libc-musl = "libmpx"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050035
Patrick Williamsc124f4f2015-09-15 14:41:29 -050036# libiberty
37# libmudflap
38# libgfortran needs separate recipe due to libquadmath dependency
39
Brad Bishop316dfdd2018-06-25 12:45:53 -040040SLIB = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
41SLIB_NEW = "/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}"
42
43DEBUG_PREFIX_MAP_class-target = " \
44 -fdebug-prefix-map=${WORKDIR}/recipe-sysroot= \
45 -fdebug-prefix-map=${WORKDIR}/recipe-sysroot-native= \
46 -fdebug-prefix-map=${SLIB}=${SLIB_NEW} \
47 -fdebug-prefix-map=${SLIB}/include=${SLIB_NEW}/libstdc++-v3/../include \
48 -fdebug-prefix-map=${SLIB}/libiberty=${SLIB_NEW}/libstdc++-v3/../libiberty \
49 -fdebug-prefix-map=${B}=${SLIB_NEW} \
50 "
51
Patrick Williamsc124f4f2015-09-15 14:41:29 -050052do_configure () {
53 export CXX="${CXX} -nostdinc++ -nostdlib++"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050054 for d in libgcc ${RUNTIMETARGET}; do
55 echo "Configuring $d"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050056 rm -rf ${B}/${TARGET_SYS}/$d/
57 mkdir -p ${B}/${TARGET_SYS}/$d/
58 cd ${B}/${TARGET_SYS}/$d/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050059 chmod a+x ${S}/$d/configure
Brad Bishop6e60e8b2018-02-01 10:27:11 -050060 relpath=${@os.path.relpath("${S}/$d", "${B}/${TARGET_SYS}/$d")}
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050061 $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
Brad Bishopd7bf8c12018-02-25 22:55:05 -050062 if [ "$d" = "libgcc" ]; then
63 (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
64 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050065 done
66}
Brad Bishop6e60e8b2018-02-01 10:27:11 -050067EXTRACONFFUNCS += "extract_stashed_builddir"
68do_configure[depends] += "${COMPILERDEP}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050069
70do_compile () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050071 for d in libgcc ${RUNTIMETARGET}; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050072 cd ${B}/${TARGET_SYS}/$d/
73 oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050074 done
75}
76
77do_install () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050078 for d in ${RUNTIMETARGET}; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050079 cd ${B}/${TARGET_SYS}/$d/
80 oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
Patrick Williamsc124f4f2015-09-15 14:41:29 -050081 done
82 rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050083 rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir
Patrick Williamsc124f4f2015-09-15 14:41:29 -050084 rm -rf ${D}${infodir}/libquadmath.info ${D}${infodir}/dir
85 if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then
86 rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
87 fi
88 if [ -d ${D}${infodir} ]; then
89 rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
90 fi
Patrick Williamsf1e5d692016-03-30 15:21:19 -050091 if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
92 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}
93 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -060094
95}
96
97do_install_append_class-target () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050098 if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
99 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
100 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600101
102 if [ "${TARGET_OS}" = "linux-gnun32" ]; then
103 if [ "${MULTILIBS}" != "" ]; then
104 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-pokymllib64-linux
105 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-pokymllib64-linux/32
106 else
107 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
108 fi
109 fi
110 if [ "${TARGET_OS}" = "linux-gnux32" ]; then
111 if [ "${MULTILIBS}" != "" ]; then
112 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-poky-linux
113 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-poky-linux/x32
114 else
115 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
116 fi
117 fi
118
119 if [ "${TCLIBC}" != "glibc" ]; then
120 case "${TARGET_OS}" in
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500121 "linux-musl" | "linux-*spe") extra_target_os="linux";;
122 "linux-musleabi") extra_target_os="linux-gnueabi";;
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600123 *) extra_target_os="linux";;
124 esac
125 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os
126 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500127 chown -R root:root ${D}
128}
129
130INHIBIT_DEFAULT_DEPS = "1"
131DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc"
132PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
133
134BBCLASSEXTEND = "nativesdk"
135
136PACKAGES = "\
137 ${PN}-dbg \
138 libstdc++ \
139 libstdc++-precompile-dev \
140 libstdc++-dev \
141 libstdc++-staticdev \
142 libg2c \
143 libg2c-dev \
144 libssp \
145 libssp-dev \
146 libssp-staticdev \
147 libmudflap \
148 libmudflap-dev \
149 libmudflap-staticdev \
150 libquadmath \
151 libquadmath-dev \
152 libquadmath-staticdev \
153 libgomp \
154 libgomp-dev \
155 libgomp-staticdev \
156 libatomic \
157 libatomic-dev \
158 libatomic-staticdev \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500159 libitm \
160 libitm-dev \
161 libitm-staticdev \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500162"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500163PACKAGES_append_x86 = "\
164 libmpx \
165 libmpx-dev \
166 libmpx-staticdev \
167"
168
169PACKAGES_append_x86-64 = "\
170 libmpx \
171 libmpx-dev \
172 libmpx-staticdev \
173"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500174
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500175# The base package doesn't exist, so we clear the recommends.
176RRECOMMENDS_${PN}-dbg = ""
177
178# include python debugging scripts
179FILES_${PN}-dbg += "\
180 ${libdir}/libstdc++.so.*-gdb.py \
181 ${datadir}/gcc-${BINV}/python/libstdcxx \
182"
183
184FILES_libg2c = "${target_libdir}/libg2c.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600185SUMMARY_libg2c = "Companion runtime library for g77"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500186FILES_libg2c-dev = "\
187 ${libdir}/libg2c.so \
188 ${libdir}/libg2c.a \
189 ${libdir}/libfrtbegin.a \
190"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600191SUMMARY_libg2c-dev = "Companion runtime library for g77 - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500192
193FILES_libstdc++ = "${libdir}/libstdc++.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600194SUMMARY_libstdc++ = "GNU standard C++ library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500195FILES_libstdc++-dev = "\
196 ${includedir}/c++/ \
197 ${libdir}/libstdc++.so \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500198 ${libdir}/libstdc++*.la \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500199 ${libdir}/libsupc++.la \
200"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600201SUMMARY_libstdc++-dev = "GNU standard C++ library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500202FILES_libstdc++-staticdev = "\
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500203 ${libdir}/libstdc++*.a \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500204 ${libdir}/libsupc++.a \
205"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600206SUMMARY_libstdc++-staticdev = "GNU standard C++ library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500207
208FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600209SUMMARY_libstdc++-precompile-dev = "GNU standard C++ library - precompiled header files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500210
211FILES_libssp = "${libdir}/libssp.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600212SUMMARY_libssp = "GNU stack smashing protection library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500213FILES_libssp-dev = "\
214 ${libdir}/libssp*.so \
215 ${libdir}/libssp*_nonshared.a \
216 ${libdir}/libssp*.la \
217 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \
218"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600219SUMMARY_libssp-dev = "GNU stack smashing protection library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500220FILES_libssp-staticdev = "${libdir}/libssp*.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600221SUMMARY_libssp-staticdev = "GNU stack smashing protection library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500222
223FILES_libquadmath = "${libdir}/libquadmath*.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600224SUMMARY_libquadmath = "GNU quad-precision math library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500225FILES_libquadmath-dev = "\
226 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \
227 ${libdir}/libquadmath*.so \
228 ${libdir}/libquadmath.la \
229"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600230SUMMARY_libquadmath-dev = "GNU quad-precision math library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500231FILES_libquadmath-staticdev = "${libdir}/libquadmath.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600232SUMMARY_libquadmath-staticdev = "GNU quad-precision math library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500233
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600234# 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 -0500235FILES_libmudflap = "${libdir}/libmudflap*.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600236SUMMARY_libmudflap = "Pointer debugging library for gcc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500237FILES_libmudflap-dev = "\
238 ${libdir}/libmudflap*.so \
239 ${libdir}/libmudflap.la \
240"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600241SUMMARY_libmudflap-dev = "Pointer debugging library for gcc - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500242FILES_libmudflap-staticdev = "${libdir}/libmudflap.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600243SUMMARY_libmudflap-staticdev = "Pointer debugging library for gcc - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500244
245FILES_libgomp = "${libdir}/libgomp*${SOLIBS}"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600246SUMMARY_libgomp = "GNU OpenMP parallel programming library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500247FILES_libgomp-dev = "\
248 ${libdir}/libgomp*${SOLIBSDEV} \
249 ${libdir}/libgomp*.la \
250 ${libdir}/libgomp.spec \
251 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \
252"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600253SUMMARY_libgomp-dev = "GNU OpenMP parallel programming library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500254FILES_libgomp-staticdev = "${libdir}/libgomp*.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600255SUMMARY_libgomp-staticdev = "GNU OpenMP parallel programming library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500256
257FILES_libatomic = "${libdir}/libatomic.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600258SUMMARY_libatomic = "GNU C++11 atomics support library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500259FILES_libatomic-dev = "\
260 ${libdir}/libatomic.so \
261 ${libdir}/libatomic.la \
262"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600263SUMMARY_libatomic-dev = "GNU C++11 atomics support library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500264FILES_libatomic-staticdev = "${libdir}/libatomic.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600265SUMMARY_libatomic-staticdev = "GNU C++11 atomics support library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500266
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500267FILES_libitm = "${libdir}/libitm.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600268SUMMARY_libitm = "GNU transactional memory support library"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500269FILES_libitm-dev = "\
270 ${libdir}/libitm.so \
271 ${libdir}/libitm.la \
272 ${libdir}/libitm.spec \
273"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600274SUMMARY_libitm-dev = "GNU transactional memory support library - development files"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500275FILES_libitm-staticdev = "${libdir}/libitm.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600276SUMMARY_libitm-staticdev = "GNU transactional memory support library - static development files"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500277
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500278
279FILES_libmpx = "${libdir}/libmpx.so.* ${libdir}/libmpxwrappers.so.*"
280SUMMARY_libmpx = "Intel Memory Protection Extension library"
281FILES_libmpx-dev = "\
282 ${libdir}/libmpxwrappers.so \
283 ${libdir}/libmpxwrappers.la \
284 ${libdir}/libmpx.so \
285 ${libdir}/libmpx.la \
286 ${libdir}/libmpx.spec \
287"
288SUMMARY_libmpx-dev = "Intel Memory Protection Extension library - development files"
289FILES_libmpx-staticdev = "${libdir}/libmpx.a ${libdir}/libmpxwrappers.a"
290SUMMARY_libmpx-staticdev = "Intel Memory Protection Extension library - static development files"
291
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500292do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
293do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
294do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"