blob: 3d03d8e57159b02ba2a1e69c8bb1db6662a21cb8 [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"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050020RUNTIMELIBITM = "libitm"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080021RUNTIMELIBITM_arc = ""
Brad Bishop6e60e8b2018-02-01 10:27:11 -050022RUNTIMELIBITM_mipsarch = ""
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050023RUNTIMELIBITM_nios2 = ""
24RUNTIMELIBITM_microblaze = ""
Brad Bishop00111322018-04-01 22:23:53 -040025RUNTIMELIBITM_riscv32 = ""
26RUNTIMELIBITM_riscv64 = ""
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080027RUNTIMELIBSSP ?= ""
28RUNTIMELIBSSP_mingw32 ?= "libssp"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050029
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080030RUNTIMETARGET = "${RUNTIMELIBSSP} libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050031 ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \
32"
33
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034# libiberty
35# libmudflap
36# libgfortran needs separate recipe due to libquadmath dependency
37
Brad Bishop316dfdd2018-06-25 12:45:53 -040038SLIB = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
39SLIB_NEW = "/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}"
40
41DEBUG_PREFIX_MAP_class-target = " \
42 -fdebug-prefix-map=${WORKDIR}/recipe-sysroot= \
43 -fdebug-prefix-map=${WORKDIR}/recipe-sysroot-native= \
44 -fdebug-prefix-map=${SLIB}=${SLIB_NEW} \
45 -fdebug-prefix-map=${SLIB}/include=${SLIB_NEW}/libstdc++-v3/../include \
46 -fdebug-prefix-map=${SLIB}/libiberty=${SLIB_NEW}/libstdc++-v3/../libiberty \
47 -fdebug-prefix-map=${B}=${SLIB_NEW} \
48 "
49
Patrick Williamsc124f4f2015-09-15 14:41:29 -050050do_configure () {
51 export CXX="${CXX} -nostdinc++ -nostdlib++"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050052 for d in libgcc ${RUNTIMETARGET}; do
53 echo "Configuring $d"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050054 rm -rf ${B}/${TARGET_SYS}/$d/
55 mkdir -p ${B}/${TARGET_SYS}/$d/
56 cd ${B}/${TARGET_SYS}/$d/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050057 chmod a+x ${S}/$d/configure
Brad Bishop6e60e8b2018-02-01 10:27:11 -050058 relpath=${@os.path.relpath("${S}/$d", "${B}/${TARGET_SYS}/$d")}
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050059 $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
Brad Bishopd7bf8c12018-02-25 22:55:05 -050060 if [ "$d" = "libgcc" ]; then
61 (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
62 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050063 done
64}
Brad Bishop6e60e8b2018-02-01 10:27:11 -050065EXTRACONFFUNCS += "extract_stashed_builddir"
66do_configure[depends] += "${COMPILERDEP}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050067
68do_compile () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050069 for d in libgcc ${RUNTIMETARGET}; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050070 cd ${B}/${TARGET_SYS}/$d/
71 oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050072 done
73}
74
75do_install () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050076 for d in ${RUNTIMETARGET}; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050077 cd ${B}/${TARGET_SYS}/$d/
78 oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
Patrick Williamsc124f4f2015-09-15 14:41:29 -050079 done
80 rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050081 rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir
Patrick Williamsc124f4f2015-09-15 14:41:29 -050082 rm -rf ${D}${infodir}/libquadmath.info ${D}${infodir}/dir
83 if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then
84 rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
85 fi
86 if [ -d ${D}${infodir} ]; then
87 rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
88 fi
Patrick Williamsf1e5d692016-03-30 15:21:19 -050089 if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
90 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}
91 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -060092
93}
94
95do_install_append_class-target () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050096 if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
97 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
98 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -060099
100 if [ "${TARGET_OS}" = "linux-gnun32" ]; then
101 if [ "${MULTILIBS}" != "" ]; then
102 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-pokymllib64-linux
103 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-pokymllib64-linux/32
104 else
105 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
106 fi
107 fi
108 if [ "${TARGET_OS}" = "linux-gnux32" ]; then
109 if [ "${MULTILIBS}" != "" ]; then
110 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-poky-linux
111 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-poky-linux/x32
112 else
113 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
114 fi
115 fi
116
117 if [ "${TCLIBC}" != "glibc" ]; then
118 case "${TARGET_OS}" in
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500119 "linux-musl" | "linux-*spe") extra_target_os="linux";;
120 "linux-musleabi") extra_target_os="linux-gnueabi";;
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600121 *) extra_target_os="linux";;
122 esac
123 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os
124 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500125 chown -R root:root ${D}
126}
127
128INHIBIT_DEFAULT_DEPS = "1"
Brad Bishop19323692019-04-05 15:28:33 -0400129DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc virtual/${MLPREFIX}libc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500130PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
131
132BBCLASSEXTEND = "nativesdk"
133
134PACKAGES = "\
135 ${PN}-dbg \
136 libstdc++ \
137 libstdc++-precompile-dev \
138 libstdc++-dev \
139 libstdc++-staticdev \
140 libg2c \
141 libg2c-dev \
142 libssp \
143 libssp-dev \
144 libssp-staticdev \
145 libmudflap \
146 libmudflap-dev \
147 libmudflap-staticdev \
148 libquadmath \
149 libquadmath-dev \
150 libquadmath-staticdev \
151 libgomp \
152 libgomp-dev \
153 libgomp-staticdev \
154 libatomic \
155 libatomic-dev \
156 libatomic-staticdev \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500157 libitm \
158 libitm-dev \
159 libitm-staticdev \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500160"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500161# The base package doesn't exist, so we clear the recommends.
162RRECOMMENDS_${PN}-dbg = ""
163
164# include python debugging scripts
165FILES_${PN}-dbg += "\
166 ${libdir}/libstdc++.so.*-gdb.py \
167 ${datadir}/gcc-${BINV}/python/libstdcxx \
168"
169
170FILES_libg2c = "${target_libdir}/libg2c.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600171SUMMARY_libg2c = "Companion runtime library for g77"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500172FILES_libg2c-dev = "\
173 ${libdir}/libg2c.so \
174 ${libdir}/libg2c.a \
175 ${libdir}/libfrtbegin.a \
176"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600177SUMMARY_libg2c-dev = "Companion runtime library for g77 - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500178
179FILES_libstdc++ = "${libdir}/libstdc++.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600180SUMMARY_libstdc++ = "GNU standard C++ library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500181FILES_libstdc++-dev = "\
182 ${includedir}/c++/ \
183 ${libdir}/libstdc++.so \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500184 ${libdir}/libstdc++*.la \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500185 ${libdir}/libsupc++.la \
186"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600187SUMMARY_libstdc++-dev = "GNU standard C++ library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500188FILES_libstdc++-staticdev = "\
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500189 ${libdir}/libstdc++*.a \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500190 ${libdir}/libsupc++.a \
191"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600192SUMMARY_libstdc++-staticdev = "GNU standard C++ library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500193
194FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600195SUMMARY_libstdc++-precompile-dev = "GNU standard C++ library - precompiled header files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500196
197FILES_libssp = "${libdir}/libssp.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600198SUMMARY_libssp = "GNU stack smashing protection library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500199FILES_libssp-dev = "\
200 ${libdir}/libssp*.so \
201 ${libdir}/libssp*_nonshared.a \
202 ${libdir}/libssp*.la \
203 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \
204"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600205SUMMARY_libssp-dev = "GNU stack smashing protection library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500206FILES_libssp-staticdev = "${libdir}/libssp*.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600207SUMMARY_libssp-staticdev = "GNU stack smashing protection library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500208
209FILES_libquadmath = "${libdir}/libquadmath*.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600210SUMMARY_libquadmath = "GNU quad-precision math library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500211FILES_libquadmath-dev = "\
212 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \
213 ${libdir}/libquadmath*.so \
214 ${libdir}/libquadmath.la \
215"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600216SUMMARY_libquadmath-dev = "GNU quad-precision math library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500217FILES_libquadmath-staticdev = "${libdir}/libquadmath.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600218SUMMARY_libquadmath-staticdev = "GNU quad-precision math library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500219
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600220# 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 -0500221FILES_libmudflap = "${libdir}/libmudflap*.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600222SUMMARY_libmudflap = "Pointer debugging library for gcc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500223FILES_libmudflap-dev = "\
224 ${libdir}/libmudflap*.so \
225 ${libdir}/libmudflap.la \
226"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600227SUMMARY_libmudflap-dev = "Pointer debugging library for gcc - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500228FILES_libmudflap-staticdev = "${libdir}/libmudflap.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600229SUMMARY_libmudflap-staticdev = "Pointer debugging library for gcc - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500230
231FILES_libgomp = "${libdir}/libgomp*${SOLIBS}"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600232SUMMARY_libgomp = "GNU OpenMP parallel programming library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500233FILES_libgomp-dev = "\
234 ${libdir}/libgomp*${SOLIBSDEV} \
235 ${libdir}/libgomp*.la \
236 ${libdir}/libgomp.spec \
237 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \
238"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600239SUMMARY_libgomp-dev = "GNU OpenMP parallel programming library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500240FILES_libgomp-staticdev = "${libdir}/libgomp*.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600241SUMMARY_libgomp-staticdev = "GNU OpenMP parallel programming library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500242
243FILES_libatomic = "${libdir}/libatomic.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600244SUMMARY_libatomic = "GNU C++11 atomics support library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500245FILES_libatomic-dev = "\
246 ${libdir}/libatomic.so \
247 ${libdir}/libatomic.la \
248"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600249SUMMARY_libatomic-dev = "GNU C++11 atomics support library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500250FILES_libatomic-staticdev = "${libdir}/libatomic.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600251SUMMARY_libatomic-staticdev = "GNU C++11 atomics support library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500252
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500253FILES_libitm = "${libdir}/libitm.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600254SUMMARY_libitm = "GNU transactional memory support library"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500255FILES_libitm-dev = "\
256 ${libdir}/libitm.so \
257 ${libdir}/libitm.la \
258 ${libdir}/libitm.spec \
259"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600260SUMMARY_libitm-dev = "GNU transactional memory support library - development files"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500261FILES_libitm-staticdev = "${libdir}/libitm.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600262SUMMARY_libitm-staticdev = "GNU transactional memory support library - static development files"