diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-target.inc')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-target.inc | 76 |
1 files changed, 11 insertions, 65 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-target.inc b/meta/recipes-devtools/gcc/gcc-target.inc index 7dac3ef422..6b47c10413 100644 --- a/meta/recipes-devtools/gcc/gcc-target.inc +++ b/meta/recipes-devtools/gcc/gcc-target.inc | |||
@@ -2,6 +2,7 @@ GCCMULTILIB = "--enable-multilib" | |||
2 | require gcc-configure-common.inc | 2 | require gcc-configure-common.inc |
3 | 3 | ||
4 | EXTRA_OECONF_PATHS = "\ | 4 | EXTRA_OECONF_PATHS = "\ |
5 | --with-gxx-libcxx-include-dir=${target_includedir}/c++/v1 \ | ||
5 | --with-build-sysroot=${STAGING_DIR_TARGET} \ | 6 | --with-build-sysroot=${STAGING_DIR_TARGET} \ |
6 | " | 7 | " |
7 | 8 | ||
@@ -32,8 +33,7 @@ PACKAGES = "\ | |||
32 | ${PN} ${PN}-plugins ${PN}-symlinks \ | 33 | ${PN} ${PN}-plugins ${PN}-symlinks \ |
33 | g++ g++-symlinks \ | 34 | g++ g++-symlinks \ |
34 | cpp cpp-symlinks \ | 35 | cpp cpp-symlinks \ |
35 | g77 g77-symlinks \ | 36 | ${@bb.utils.contains('FORTRAN', ',fortran', 'gfortran gfortran-symlinks', '', d)} \ |
36 | gfortran gfortran-symlinks \ | ||
37 | gcov gcov-symlinks \ | 37 | gcov gcov-symlinks \ |
38 | ${PN}-doc \ | 38 | ${PN}-doc \ |
39 | ${PN}-dev \ | 39 | ${PN}-dev \ |
@@ -60,7 +60,7 @@ RRECOMMENDS:${PN} += "\ | |||
60 | libssp \ | 60 | libssp \ |
61 | libssp-dev \ | 61 | libssp-dev \ |
62 | " | 62 | " |
63 | RDEPENDS:${PN} += "cpp" | 63 | RDEPENDS:${PN} += "binutils cpp" |
64 | 64 | ||
65 | FILES:${PN}-dev = "\ | 65 | FILES:${PN}-dev = "\ |
66 | ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \ | 66 | ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \ |
@@ -80,23 +80,15 @@ FILES:${PN}-plugins = "\ | |||
80 | " | 80 | " |
81 | ALLOW_EMPTY:${PN}-plugins = "1" | 81 | ALLOW_EMPTY:${PN}-plugins = "1" |
82 | 82 | ||
83 | FILES:g77 = "\ | 83 | INSANE_SKIP:${MLPREFIX}gfortran += "dev-deps" |
84 | ${bindir}/${TARGET_PREFIX}g77 \ | ||
85 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f771 \ | ||
86 | " | ||
87 | FILES:g77-symlinks = "\ | ||
88 | ${bindir}/g77 \ | ||
89 | ${bindir}/f77 \ | ||
90 | " | ||
91 | RRECOMMENDS:g77 = "\ | ||
92 | libg2c \ | ||
93 | libg2c-dev \ | ||
94 | " | ||
95 | |||
96 | FILES:gfortran = "\ | 84 | FILES:gfortran = "\ |
97 | ${bindir}/${TARGET_PREFIX}gfortran \ | 85 | ${bindir}/${TARGET_PREFIX}gfortran \ |
98 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f951 \ | 86 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f951 \ |
99 | " | 87 | " |
88 | RDEPENDS:gfortran = "\ | ||
89 | gcc \ | ||
90 | libgfortran-dev \ | ||
91 | " | ||
100 | RRECOMMENDS:gfortran = "\ | 92 | RRECOMMENDS:gfortran = "\ |
101 | libquadmath \ | 93 | libquadmath \ |
102 | libquadmath-dev \ | 94 | libquadmath-dev \ |
@@ -140,20 +132,8 @@ FILES:${PN}-doc = "\ | |||
140 | " | 132 | " |
141 | 133 | ||
142 | do_compile () { | 134 | do_compile () { |
143 | # Prevent full target sysroot path from being used in configargs.h header, | 135 | remove_sysroot_paths_from_configargs '/' |
144 | # as it will be rewritten when used by other sysroots preventing support | 136 | remove_sysroot_paths_from_checksum_options '${STAGING_DIR_TARGET}' '/' |
145 | # for gcc plugins. Additionally the path is embeddeded into the output | ||
146 | # binary, this prevents building a reproducible binary. | ||
147 | oe_runmake configure-gcc | ||
148 | sed -i 's@${STAGING_DIR_TARGET}@/@g' ${B}/gcc/configargs.h | ||
149 | sed -i 's@${STAGING_DIR_HOST}@/@g' ${B}/gcc/configargs.h | ||
150 | |||
151 | # Prevent sysroot/workdir paths from being used in checksum-options. | ||
152 | # checksum-options is used to generate a checksum which is embedded into | ||
153 | # the output binary. | ||
154 | oe_runmake TARGET-gcc=checksum-options all-gcc | ||
155 | sed -i 's@${DEBUG_PREFIX_MAP}@@g' ${B}/gcc/checksum-options | ||
156 | sed -i 's@${STAGING_DIR_TARGET}@/@g' ${B}/gcc/checksum-options | ||
157 | 137 | ||
158 | oe_runmake all-host | 138 | oe_runmake all-host |
159 | } | 139 | } |
@@ -197,11 +177,6 @@ do_install () { | |||
197 | # Not sure why we end up with these but we don't want them... | 177 | # Not sure why we end up with these but we don't want them... |
198 | rm -f ${TARGET_PREFIX}${TARGET_PREFIX}* | 178 | rm -f ${TARGET_PREFIX}${TARGET_PREFIX}* |
199 | 179 | ||
200 | # Symlinks so we can use these trivially on the target | ||
201 | if [ -e ${TARGET_PREFIX}g77 ]; then | ||
202 | ln -sf ${TARGET_PREFIX}g77 g77 || true | ||
203 | ln -sf g77 f77 || true | ||
204 | fi | ||
205 | if [ -e ${TARGET_PREFIX}gfortran ]; then | 180 | if [ -e ${TARGET_PREFIX}gfortran ]; then |
206 | ln -sf ${TARGET_PREFIX}gfortran gfortran || true | 181 | ln -sf ${TARGET_PREFIX}gfortran gfortran || true |
207 | ln -sf gfortran f95 || true | 182 | ln -sf gfortran f95 || true |
@@ -218,37 +193,8 @@ do_install () { | |||
218 | install -d ${D}${libdir}/bfd-plugins | 193 | install -d ${D}${libdir}/bfd-plugins |
219 | ln -sf ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/liblto_plugin.so ${D}${libdir}/bfd-plugins/liblto_plugin.so | 194 | ln -sf ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/liblto_plugin.so ${D}${libdir}/bfd-plugins/liblto_plugin.so |
220 | chown -R root:root ${D} | 195 | chown -R root:root ${D} |
221 | } | ||
222 | 196 | ||
223 | do_install:append () { | 197 | cleanup_installed_include_fixed |
224 | # | ||
225 | # Thefixinc.sh script, run on the gcc's compile phase, looks into sysroot header | ||
226 | # files and places the modified files into | ||
227 | # {D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed folder. This makes the | ||
228 | # build not deterministic. The following code prunes all those headers | ||
229 | # except those under include-fixed/linux, *limits.h and README, yielding | ||
230 | # the same include-fixed folders no matter what sysroot | ||
231 | |||
232 | include_fixed="${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed" | ||
233 | for f in $(find ${include_fixed} -type f); do | ||
234 | case $f in | ||
235 | */include-fixed/linux/*) | ||
236 | continue | ||
237 | ;; | ||
238 | */include-fixed/*limits.h) | ||
239 | continue | ||
240 | ;; | ||
241 | */include-fixed/README) | ||
242 | continue | ||
243 | ;; | ||
244 | *) | ||
245 | # remove file and directory if empty | ||
246 | bbdebug 2 "Pruning $f" | ||
247 | rm $f | ||
248 | find $(dirname $f) -maxdepth 0 -empty -exec rmdir {} \; | ||
249 | ;; | ||
250 | esac | ||
251 | done | ||
252 | } | 198 | } |
253 | 199 | ||
254 | # Installing /usr/lib/gcc/* means we'd have two copies, one from gcc-cross | 200 | # Installing /usr/lib/gcc/* means we'd have two copies, one from gcc-cross |