blob: 0dc405c59158beecdbff9a3e994743aa2e67be18 [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 = ""
23
24RUNTIMETARGET = "libssp libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
25 ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \
26"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050027RUNTIMETARGET_append_x86 = " libmpx"
28RUNTIMETARGET_append_x86-64 = " libmpx"
29RUNTIMETARGET_remove_libc-musl = "libmpx"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050030
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031# libiberty
32# libmudflap
33# libgfortran needs separate recipe due to libquadmath dependency
34
35do_configure () {
36 export CXX="${CXX} -nostdinc++ -nostdlib++"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050037
Patrick Williamsc124f4f2015-09-15 14:41:29 -050038 for d in libgcc ${RUNTIMETARGET}; do
39 echo "Configuring $d"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050040 rm -rf ${B}/${TARGET_SYS}/$d/
41 mkdir -p ${B}/${TARGET_SYS}/$d/
42 cd ${B}/${TARGET_SYS}/$d/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050043 chmod a+x ${S}/$d/configure
Brad Bishop6e60e8b2018-02-01 10:27:11 -050044 relpath=${@os.path.relpath("${S}/$d", "${B}/${TARGET_SYS}/$d")}
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050045 $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050046 done
47}
Brad Bishop6e60e8b2018-02-01 10:27:11 -050048EXTRACONFFUNCS += "extract_stashed_builddir"
49do_configure[depends] += "${COMPILERDEP}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050050
51do_compile () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050052 for d in libgcc ${RUNTIMETARGET}; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050053 cd ${B}/${TARGET_SYS}/$d/
54 oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050055 done
56}
57
58do_install () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050059 for d in ${RUNTIMETARGET}; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050060 cd ${B}/${TARGET_SYS}/$d/
61 oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
Patrick Williamsc124f4f2015-09-15 14:41:29 -050062 done
63 rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050064 rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir
Patrick Williamsc124f4f2015-09-15 14:41:29 -050065 rm -rf ${D}${infodir}/libquadmath.info ${D}${infodir}/dir
66 if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then
67 rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
68 fi
69 if [ -d ${D}${infodir} ]; then
70 rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
71 fi
Patrick Williamsf1e5d692016-03-30 15:21:19 -050072 if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
73 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}
74 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -060075
76}
77
78do_install_append_class-target () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050079 if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
80 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
81 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -060082
83 if [ "${TARGET_OS}" = "linux-gnun32" ]; then
84 if [ "${MULTILIBS}" != "" ]; then
85 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-pokymllib64-linux
86 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-pokymllib64-linux/32
87 else
88 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
89 fi
90 fi
91 if [ "${TARGET_OS}" = "linux-gnux32" ]; then
92 if [ "${MULTILIBS}" != "" ]; then
93 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-poky-linux
94 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-poky-linux/x32
95 else
96 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
97 fi
98 fi
99
100 if [ "${TCLIBC}" != "glibc" ]; then
101 case "${TARGET_OS}" in
102 "linux-musl" | "linux-uclibc" | "linux-*spe") extra_target_os="linux";;
103 "linux-musleabi" | "linux-uclibceabi") extra_target_os="linux-gnueabi";;
104 *) extra_target_os="linux";;
105 esac
106 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os
107 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500108 chown -R root:root ${D}
109}
110
111INHIBIT_DEFAULT_DEPS = "1"
112DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc"
113PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
114
115BBCLASSEXTEND = "nativesdk"
116
117PACKAGES = "\
118 ${PN}-dbg \
119 libstdc++ \
120 libstdc++-precompile-dev \
121 libstdc++-dev \
122 libstdc++-staticdev \
123 libg2c \
124 libg2c-dev \
125 libssp \
126 libssp-dev \
127 libssp-staticdev \
128 libmudflap \
129 libmudflap-dev \
130 libmudflap-staticdev \
131 libquadmath \
132 libquadmath-dev \
133 libquadmath-staticdev \
134 libgomp \
135 libgomp-dev \
136 libgomp-staticdev \
137 libatomic \
138 libatomic-dev \
139 libatomic-staticdev \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500140 libitm \
141 libitm-dev \
142 libitm-staticdev \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500143"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500144PACKAGES_append_x86 = "\
145 libmpx \
146 libmpx-dev \
147 libmpx-staticdev \
148"
149
150PACKAGES_append_x86-64 = "\
151 libmpx \
152 libmpx-dev \
153 libmpx-staticdev \
154"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500155
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500156# The base package doesn't exist, so we clear the recommends.
157RRECOMMENDS_${PN}-dbg = ""
158
159# include python debugging scripts
160FILES_${PN}-dbg += "\
161 ${libdir}/libstdc++.so.*-gdb.py \
162 ${datadir}/gcc-${BINV}/python/libstdcxx \
163"
164
165FILES_libg2c = "${target_libdir}/libg2c.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600166SUMMARY_libg2c = "Companion runtime library for g77"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500167FILES_libg2c-dev = "\
168 ${libdir}/libg2c.so \
169 ${libdir}/libg2c.a \
170 ${libdir}/libfrtbegin.a \
171"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600172SUMMARY_libg2c-dev = "Companion runtime library for g77 - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500173
174FILES_libstdc++ = "${libdir}/libstdc++.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600175SUMMARY_libstdc++ = "GNU standard C++ library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500176FILES_libstdc++-dev = "\
177 ${includedir}/c++/ \
178 ${libdir}/libstdc++.so \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500179 ${libdir}/libstdc++*.la \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500180 ${libdir}/libsupc++.la \
181"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600182SUMMARY_libstdc++-dev = "GNU standard C++ library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500183FILES_libstdc++-staticdev = "\
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500184 ${libdir}/libstdc++*.a \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500185 ${libdir}/libsupc++.a \
186"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600187SUMMARY_libstdc++-staticdev = "GNU standard C++ library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500188
189FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600190SUMMARY_libstdc++-precompile-dev = "GNU standard C++ library - precompiled header files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500191
192FILES_libssp = "${libdir}/libssp.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600193SUMMARY_libssp = "GNU stack smashing protection library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500194FILES_libssp-dev = "\
195 ${libdir}/libssp*.so \
196 ${libdir}/libssp*_nonshared.a \
197 ${libdir}/libssp*.la \
198 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \
199"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600200SUMMARY_libssp-dev = "GNU stack smashing protection library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500201FILES_libssp-staticdev = "${libdir}/libssp*.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600202SUMMARY_libssp-staticdev = "GNU stack smashing protection library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500203
204FILES_libquadmath = "${libdir}/libquadmath*.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600205SUMMARY_libquadmath = "GNU quad-precision math library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500206FILES_libquadmath-dev = "\
207 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \
208 ${libdir}/libquadmath*.so \
209 ${libdir}/libquadmath.la \
210"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600211SUMMARY_libquadmath-dev = "GNU quad-precision math library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500212FILES_libquadmath-staticdev = "${libdir}/libquadmath.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600213SUMMARY_libquadmath-staticdev = "GNU quad-precision math library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500214
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600215# 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 -0500216FILES_libmudflap = "${libdir}/libmudflap*.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600217SUMMARY_libmudflap = "Pointer debugging library for gcc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500218FILES_libmudflap-dev = "\
219 ${libdir}/libmudflap*.so \
220 ${libdir}/libmudflap.la \
221"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600222SUMMARY_libmudflap-dev = "Pointer debugging library for gcc - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500223FILES_libmudflap-staticdev = "${libdir}/libmudflap.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600224SUMMARY_libmudflap-staticdev = "Pointer debugging library for gcc - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500225
226FILES_libgomp = "${libdir}/libgomp*${SOLIBS}"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600227SUMMARY_libgomp = "GNU OpenMP parallel programming library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500228FILES_libgomp-dev = "\
229 ${libdir}/libgomp*${SOLIBSDEV} \
230 ${libdir}/libgomp*.la \
231 ${libdir}/libgomp.spec \
232 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \
233"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600234SUMMARY_libgomp-dev = "GNU OpenMP parallel programming library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500235FILES_libgomp-staticdev = "${libdir}/libgomp*.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600236SUMMARY_libgomp-staticdev = "GNU OpenMP parallel programming library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500237
238FILES_libatomic = "${libdir}/libatomic.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600239SUMMARY_libatomic = "GNU C++11 atomics support library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500240FILES_libatomic-dev = "\
241 ${libdir}/libatomic.so \
242 ${libdir}/libatomic.la \
243"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600244SUMMARY_libatomic-dev = "GNU C++11 atomics support library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500245FILES_libatomic-staticdev = "${libdir}/libatomic.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600246SUMMARY_libatomic-staticdev = "GNU C++11 atomics support library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500247
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500248FILES_libitm = "${libdir}/libitm.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600249SUMMARY_libitm = "GNU transactional memory support library"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500250FILES_libitm-dev = "\
251 ${libdir}/libitm.so \
252 ${libdir}/libitm.la \
253 ${libdir}/libitm.spec \
254"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600255SUMMARY_libitm-dev = "GNU transactional memory support library - development files"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500256FILES_libitm-staticdev = "${libdir}/libitm.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600257SUMMARY_libitm-staticdev = "GNU transactional memory support library - static development files"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500258
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500259
260FILES_libmpx = "${libdir}/libmpx.so.* ${libdir}/libmpxwrappers.so.*"
261SUMMARY_libmpx = "Intel Memory Protection Extension library"
262FILES_libmpx-dev = "\
263 ${libdir}/libmpxwrappers.so \
264 ${libdir}/libmpxwrappers.la \
265 ${libdir}/libmpx.so \
266 ${libdir}/libmpx.la \
267 ${libdir}/libmpx.spec \
268"
269SUMMARY_libmpx-dev = "Intel Memory Protection Extension library - development files"
270FILES_libmpx-staticdev = "${libdir}/libmpx.a ${libdir}/libmpxwrappers.a"
271SUMMARY_libmpx-staticdev = "Intel Memory Protection Extension library - static development files"
272
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500273do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
274do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
275do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"