blob: ba767e1a380dcec563dd276da88bce72ca01ad6b [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 Williamsc0f7c042017-02-23 20:41:17 -060089}
90
91do_install_append_class-target () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050092 if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
93 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
94 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -060095
96 if [ "${TARGET_OS}" = "linux-gnun32" ]; then
Brad Bishopf3fd2882019-06-21 08:06:37 -040097 if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
98 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux
99 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux/32
100 elif [ "${MULTILIB_VARIANTS}" != "" ]; then
101 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
102 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux/32
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600103 else
104 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
105 fi
Brad Bishopf3fd2882019-06-21 08:06:37 -0400106 elif [ "${TARGET_OS}" = "linux-gnux32" ]; then
107 if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
108 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux
109 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux/x32
110 elif [ "${MULTILIB_VARIANTS}" != "" ]; then
111 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
112 ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux/32
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600113 else
114 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
115 fi
Brad Bishopf3fd2882019-06-21 08:06:37 -0400116 elif [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
117 mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux
118 ln -s ../${TARGET_SYS}/bits ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}/bits
119 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 -0600120 fi
121
122 if [ "${TCLIBC}" != "glibc" ]; then
123 case "${TARGET_OS}" in
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500124 "linux-musl" | "linux-*spe") extra_target_os="linux";;
125 "linux-musleabi") extra_target_os="linux-gnueabi";;
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600126 *) extra_target_os="linux";;
127 esac
128 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os
129 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500130 chown -R root:root ${D}
131}
132
133INHIBIT_DEFAULT_DEPS = "1"
Brad Bishop19323692019-04-05 15:28:33 -0400134DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc virtual/${MLPREFIX}libc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500135PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
136
137BBCLASSEXTEND = "nativesdk"
138
139PACKAGES = "\
140 ${PN}-dbg \
141 libstdc++ \
142 libstdc++-precompile-dev \
143 libstdc++-dev \
144 libstdc++-staticdev \
145 libg2c \
146 libg2c-dev \
147 libssp \
148 libssp-dev \
149 libssp-staticdev \
150 libmudflap \
151 libmudflap-dev \
152 libmudflap-staticdev \
153 libquadmath \
154 libquadmath-dev \
155 libquadmath-staticdev \
156 libgomp \
157 libgomp-dev \
158 libgomp-staticdev \
159 libatomic \
160 libatomic-dev \
161 libatomic-staticdev \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500162 libitm \
163 libitm-dev \
164 libitm-staticdev \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500165"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500166# The base package doesn't exist, so we clear the recommends.
167RRECOMMENDS_${PN}-dbg = ""
168
169# include python debugging scripts
170FILES_${PN}-dbg += "\
171 ${libdir}/libstdc++.so.*-gdb.py \
172 ${datadir}/gcc-${BINV}/python/libstdcxx \
173"
174
175FILES_libg2c = "${target_libdir}/libg2c.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600176SUMMARY_libg2c = "Companion runtime library for g77"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500177FILES_libg2c-dev = "\
178 ${libdir}/libg2c.so \
179 ${libdir}/libg2c.a \
180 ${libdir}/libfrtbegin.a \
181"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600182SUMMARY_libg2c-dev = "Companion runtime library for g77 - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500183
184FILES_libstdc++ = "${libdir}/libstdc++.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600185SUMMARY_libstdc++ = "GNU standard C++ library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500186FILES_libstdc++-dev = "\
187 ${includedir}/c++/ \
188 ${libdir}/libstdc++.so \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500189 ${libdir}/libstdc++*.la \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500190 ${libdir}/libsupc++.la \
191"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600192SUMMARY_libstdc++-dev = "GNU standard C++ library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500193FILES_libstdc++-staticdev = "\
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500194 ${libdir}/libstdc++*.a \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500195 ${libdir}/libsupc++.a \
196"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600197SUMMARY_libstdc++-staticdev = "GNU standard C++ library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500198
199FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600200SUMMARY_libstdc++-precompile-dev = "GNU standard C++ library - precompiled header files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500201
202FILES_libssp = "${libdir}/libssp.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600203SUMMARY_libssp = "GNU stack smashing protection library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500204FILES_libssp-dev = "\
205 ${libdir}/libssp*.so \
206 ${libdir}/libssp*_nonshared.a \
207 ${libdir}/libssp*.la \
208 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \
209"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600210SUMMARY_libssp-dev = "GNU stack smashing protection library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500211FILES_libssp-staticdev = "${libdir}/libssp*.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600212SUMMARY_libssp-staticdev = "GNU stack smashing protection library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500213
214FILES_libquadmath = "${libdir}/libquadmath*.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600215SUMMARY_libquadmath = "GNU quad-precision math library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500216FILES_libquadmath-dev = "\
217 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \
218 ${libdir}/libquadmath*.so \
219 ${libdir}/libquadmath.la \
220"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600221SUMMARY_libquadmath-dev = "GNU quad-precision math library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500222FILES_libquadmath-staticdev = "${libdir}/libquadmath.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600223SUMMARY_libquadmath-staticdev = "GNU quad-precision math library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500224
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600225# 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 -0500226FILES_libmudflap = "${libdir}/libmudflap*.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600227SUMMARY_libmudflap = "Pointer debugging library for gcc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500228FILES_libmudflap-dev = "\
229 ${libdir}/libmudflap*.so \
230 ${libdir}/libmudflap.la \
231"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600232SUMMARY_libmudflap-dev = "Pointer debugging library for gcc - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500233FILES_libmudflap-staticdev = "${libdir}/libmudflap.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600234SUMMARY_libmudflap-staticdev = "Pointer debugging library for gcc - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500235
236FILES_libgomp = "${libdir}/libgomp*${SOLIBS}"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600237SUMMARY_libgomp = "GNU OpenMP parallel programming library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500238FILES_libgomp-dev = "\
239 ${libdir}/libgomp*${SOLIBSDEV} \
240 ${libdir}/libgomp*.la \
241 ${libdir}/libgomp.spec \
242 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \
243"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600244SUMMARY_libgomp-dev = "GNU OpenMP parallel programming library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500245FILES_libgomp-staticdev = "${libdir}/libgomp*.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600246SUMMARY_libgomp-staticdev = "GNU OpenMP parallel programming library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500247
248FILES_libatomic = "${libdir}/libatomic.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600249SUMMARY_libatomic = "GNU C++11 atomics support library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500250FILES_libatomic-dev = "\
251 ${libdir}/libatomic.so \
252 ${libdir}/libatomic.la \
253"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600254SUMMARY_libatomic-dev = "GNU C++11 atomics support library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500255FILES_libatomic-staticdev = "${libdir}/libatomic.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600256SUMMARY_libatomic-staticdev = "GNU C++11 atomics support library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500257
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500258FILES_libitm = "${libdir}/libitm.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600259SUMMARY_libitm = "GNU transactional memory support library"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500260FILES_libitm-dev = "\
261 ${libdir}/libitm.so \
262 ${libdir}/libitm.la \
263 ${libdir}/libitm.spec \
264"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600265SUMMARY_libitm-dev = "GNU transactional memory support library - development files"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500266FILES_libitm-staticdev = "${libdir}/libitm.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600267SUMMARY_libitm-staticdev = "GNU transactional memory support library - static development files"