--- toolchain.eclass.orig 2012-10-23 00:12:36.998615518 +0200 +++ toolchain.eclass 2012-10-23 00:12:17.467319578 +0200 @@ -23,7 +23,7 @@ inherit git-2 fi -EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_postinst pkg_postrm +EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_preinst pkg_postinst pkg_prerm pkg_postrm DESCRIPTION="The GNU Compiler Collection" FEATURES=${FEATURES/multilib-strict/} @@ -570,10 +570,29 @@ unset LANGUAGES #265283 } +toolchain_pkg_preinst() { + if ! is_crosscompile ; then + # Temporarily add the the new path directly to the linker search paths + # to be sure the new libgcc_s.so will be found after the old one got removed. + # This has to be done because pkg_postinst (and thus gcc_config) is called + # only after the old (current) libgcc_s.so was removed, which would leave + # the system without any libgcc_s.so which is necessary for gcc_config. + # See bug #437050 + echo "${PREFIX}/lib/gcc/${CTARGET}/${GCC_CONFIG_VER}" > "/etc/ld.so.conf.d/00_toolchain_eclass_tmp_${PF}.conf" + fi +} + toolchain_pkg_postinst() { do_gcc_config if ! is_crosscompile ; then + # gcc_config was called so the new libgcc_s.so can be found without the temporary. + # See bug #437050 + rm "/etc/ld.so.conf.d/00_toolchain_eclass_tmp_${PF}.conf" # remove temporary file + ldconfig # update the dynamic linker search paths + fi + + if ! is_crosscompile ; then echo ewarn "If you have issues with packages unable to locate libstdc++.la," ewarn "then try running 'fix_libtool_files.sh' on the old gcc versions." @@ -601,6 +620,12 @@ fi } +toolchain_pkg_prerm() { + if ! is_crosscompile ; then + ldconfig # update the dynamic linker search paths + fi +} + toolchain_pkg_postrm() { # to make our lives easier (and saner), we do the fix_libtool stuff here. # rather than checking SLOT's and trying in upgrade paths, we just see if