gcc: Restructure package creation.
RFC PATCH 1/1 gcc: Restructure package creation.
Hi,
Inspired by a discussion with RP on IRC this patch does following.
* Package most of target libraries during gcc-cross recipes and not during gcc target recipe.
* Do not build and package libraries like libstdc++ and others twice (once during cross compile and then during target gcc compile)
More libraries that can be built in cross gcc recipe should be packaged there. These changes can be done after this patch.
Comments ?
-Khem
--- recipes/gcc/gcc-configure-cross.inc | 25 ++++++-- recipes/gcc/gcc-configure-target.inc | 9 ++- recipes/gcc/gcc-package-cross.inc | 107 ++++++++++++++++++++-------------- recipes/gcc/gcc-package-target.inc | 93 +++++++++--------------------- 4 files changed, 118 insertions(+), 116 deletions(-)
recipes/gcc/gcc-configure-cross.inc +20 -5
@@ -29,11 +29,10 @@ do_stage_append () { done # Fix a few include links so cross builds are happier - if [ ! -e ${STAGING_INCDIR}/c++ ]; then - mkdir -p ${STAGING_INCDIR} - mkdir -p ${CROSS_DIR}/${TARGET_SYS}/include/c++ + if [ ! -e ${STAGING_DIR_TARGET}/${target_includedir}/c++ ]; then + mkdir -p ${STAGING_DIR_TARGET}/${target_includedir}/c++ ln -sf ${CROSS_DIR}/${TARGET_SYS}/include/c++ \ - ${STAGING_INCDIR}/ + ${STAGING_DIR_TARGET}/${target_includedir}/c++/ fi # We probably don't need these
@@ -47,9 +46,25 @@ do_stage_append () { done #fix up libsupc++ and libstdc++ la files - for d in lib lib/nof; do + libdirs="lib" + if [ -e lib/nof ]; then + libdirs="$libs lib/nof" + fi + for d in ${libdirs}; do sed -i "s|dependency_libs\s*=\s*.*|dependency_libs='-L${CROSS_DIR}/${TARGET_SYS}/$d ${LIBGCCS_VAR} -lc -lm '|" ${CROSS_DIR}/${TARGET_SYS}/$d/libsupc++.la || true sed -i "s|dependency_libs\s*=\s*.*|dependency_libs='-L${CROSS_DIR}/${TARGET_SYS}/$d ${LIBGCCS_VAR} -lc -lm '|" ${CROSS_DIR}/${TARGET_SYS}/$d/libstdc++.la || true done + # stage shared libgcc and libstdc++ in target staging area. + if [ -e ${CROSS_DIR}/${TARGET_SYS}${target_base_libdir}/libgcc_s.so ]; then + mkdir -p ${STAGING_DIR_TARGET}${target_base_libdir} + cp -d ${CROSS_DIR}/${TARGET_SYS}${target_base_libdir}/libgcc_s.so* \ + ${STAGING_DIR_TARGET}${target_base_libdir} + + fi + if [ -e ${CROSS_DIR}/${TARGET_SYS}${target_base_libdir}/libstdc++.so ]; then + mkdir -p ${STAGING_DIR_TARGET}${target_prefix}${target_base_libdir} + cp -d ${CROSS_DIR}/${TARGET_SYS}${target_base_libdir}/libstdc++.so* \ + ${STAGING_DIR_TARGET}${target_prefix}${target_base_libdir} + fi }
recipes/gcc/gcc-configure-target.inc +7 -2
@@ -2,5 +2,10 @@ require gcc-configure-common.inc EXTRA_OECONF_PATHS = " \ --with-local-prefix=${prefix}/local \ - --with-gxx-include-dir=${includedir}/c++/${BINV}" - + --with-gxx-include-dir=${includedir}/c++/${BINV} \ + --disable-libstdc++-v3 \ + --disable-libgfortran \ + --disable-libssp \ + --disable-libobjc \ + " +TARGET_CC_ARCH += "${LDFLAGS}"
recipes/gcc/gcc-package-cross.inc +64 -43
134 lines not on this page · raw message
recipes/gcc/gcc-package-target.inc +27 -66
136 lines not on this page · raw message
Signature · 1 line
1.6.5
Hello,
Quoted 6 lines · Khem Raj
Hi,
Inspired by a discussion with RP on IRC this patch does following.
* Package most of target libraries during gcc-cross recipes and not during gcc target recipe.
Can you explain this a bit more?
GCC recipes are like black magic for me but I'd like to understand the idea at least ;-)
Signature · 3 lines
Otavio Salvador O.S. Systems E-mail: [email protected] http://www.ossystems.com.br Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
Dnia poniedziałek, 1 lutego 2010 o 13:14:41 Otavio Salvador napisał(a):
Quoted 7 lines
Quoted 2 lines
* Package most of target libraries during gcc-cross recipes and not during gcc target recipe.
Can you explain this a bit more?
GCC recipes are like black magic for me but I'd like to understand the idea at least ;-)
It means "we do not need to build 'gcc' to get 'libfortran' because we build it during build of 'gcc-cross'".
Regards,
Signature · 3 lines
JID: [email protected] Website: http://marcin.juszkiewicz.com.pl/ LinkedIn: http://www.linkedin.com/in/marcinjuszkiewicz
Quoted 7 lines · Khem Raj
Hi,
Inspired by a discussion with RP on IRC this patch does following.
* Package most of target libraries during gcc-cross recipes and not during gcc target recipe.
Quoted 7 lines
* Do not build and package libraries like libstdc++ and others twice (once during cross compile and then during target gcc compile)
More libraries that can be built in cross gcc recipe should be packaged there. These changes can be done after this patch.
Comments ?
I think it might be better to unbundle the libraries from gcc{-cross} altogether, and put them in a new recipe called gcc-runtime or something. Having them built as part of gcc-cross seems to cause a certain level of headache for people who are using external toolchains; this happens already with libgcc and libstdc++, and I suspect your patch will cause the same issues to start popping up with the other libraries.
Or, even better, put the different language runtimes in separate recipes so that folks who want to use Fortran can build those libraries without everybody else needing to do so.
p.
Hello,
Quoted 6 lines · Phil Blundell
I think it might be better to unbundle the libraries from gcc{-cross} altogether, and put them in a new recipe called gcc-runtime or something. Having them built as part of gcc-cross seems to cause a certain level of headache for people who are using external toolchains; this happens already with libgcc and libstdc++, and I suspect your patch will cause the same issues to start popping up with the other libraries.
Indeed; for a outsider the gcc-cross looks like the really basic stuff needed; not libraries and like.
Quoted 3 lines
Or, even better, put the different language runtimes in separate recipes so that folks who want to use Fortran can build those libraries without everybody else needing to do so.
That would be really nice and could speedup the building time a bit.
Cheers,
Signature · 3 lines
Otavio Salvador O.S. Systems E-mail: [email protected] http://www.ossystems.com.br Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
Quoted 14 lines · Phil Blundell
Quoted 13 lines · Khem Raj
Hi,
Inspired by a discussion with RP on IRC this patch does following.
* Package most of target libraries during gcc-cross recipes and not during gcc target recipe.
* Do not build and package libraries like libstdc++ and others twice (once during cross compile and then during target gcc compile)
More libraries that can be built in cross gcc recipe should be packaged there. These changes can be done after this patch.
Quoted 8 lines
Quoted 1 line
Comments ?
I think it might be better to unbundle the libraries from gcc{-cross} altogether, and put them in a new recipe called gcc-runtime or something. Having them built as part of gcc-cross seems to cause a certain level of headache for people who are using external toolchains; this happens already with libgcc and libstdc++, and I suspect your patch will cause the same issues to start popping up with the other libraries.
Well, isn't that exposing problems that exist today, rather than adding new ones (ie the problem is that an unexpected (OE-built) libfoo is used) ?
Quoted 3 lines
Or, even better, put the different language runtimes in separate recipes so that folks who want to use Fortran can build those libraries without everybody else needing to do so.
It would be a good idea, I think, to 'time' a few builds like this, to see how much time we save not building libgfortran (and the java one too) and how much time we do or don't save by building libstdc++ on its own.
Signature · 2 lines
Tom Rini <[email protected]> Mentor Graphics Corporation
Quoted 3 lines · Tom Rini
Well, isn't that exposing problems that exist today, rather than adding new ones (ie the problem is that an unexpected (OE-built) libfoo is used) ?
The problem is more that, if you use an external toolchain and don't build gcc-cross at all, you end up getting unresolved dependencies at rootfs population time because no libgcc package at all has been generated.
For libstdc++ I suspect it would be even worse because no dependencies will even be generated if the package doesn't exist: in this case you won't get a build error of any kind, you'll just find that no binaries in your rootfs will run because libstdc++.so.6 is missing.
p.