toolchain.eclass: prune more unused libtool archives #573302
authorMike Frysinger <vapier@gentoo.org>
Thu, 12 May 2016 01:05:41 +0000 (21:05 -0400)
committerMike Frysinger <vapier@gentoo.org>
Thu, 12 May 2016 01:05:48 +0000 (21:05 -0400)
eclass/toolchain.eclass

index 08813a9e355ddf8f563eb6d7165491771f6260ee..9dd1604e9638c7a7f8df9a529797483576ce042d 100644 (file)
@@ -1745,13 +1745,49 @@ toolchain_src_install() {
        if ! is_crosscompile ; then
                insinto "${DATAPATH}"
                newins "${GCC_FILESDIR}"/awk/fixlafiles.awk-no_gcc_la fixlafiles.awk || die
-               find "${D}/${LIBPATH}" -name libstdc++.la -type f -delete
-               find "${D}/${LIBPATH}" -name 'lib*san.la' -type f -delete #487550 #546700
                exeinto "${DATAPATH}"
                doexe "${GCC_FILESDIR}"/fix_libtool_files.sh || die
                doexe "${GCC_FILESDIR}"/c{89,99} || die
        fi
 
+       # libstdc++.la: Delete as it doesn't add anything useful: g++ itself
+       # handles linkage correctly in the dynamic & static case.  It also just
+       # causes us pain: any C++ progs/libs linking with libtool will gain a
+       # reference to the full libstdc++.la file which is gcc version specific.
+       # libstdc++fs.la: It doesn't link against anything useful.
+       # libsupc++.la: This has no dependencies.
+       # libcc1.la: There is no static library, only dynamic.
+       # libcc1plugin.la: Same as above, and it's loaded via dlopen.
+       # libgomp.la: gcc itself handles linkage (libgomp.spec).
+       # libgomp-plugin-*.la: Same as above, and it's an internal plugin only
+       # loaded via dlopen.
+       # libgfortran.la: gfortran itself handles linkage correctly in the
+       # dynamic & static case (libgfortran.spec). #573302
+       # libgfortranbegin.la: Same as above, and it's an internal lib.
+       # libmpx.la: gcc itself handles linkage correctly (libmpx.spec).
+       # libmpxwrappers.la: See above.
+       # libitm.la: gcc itself handles linkage correctly (libitm.spec).
+       # libvtv.la: gcc itself handles linkage correctly.
+       # lib*san.la: Sanitizer linkage is handled internally by gcc, and they
+       # do not support static linking. #487550 #546700
+       find "${D}/${LIBPATH}" \
+               '(' \
+                       -name libstdc++.la -o \
+                       -name libstdc++fs.la -o \
+                       -name libsupc++.la -o \
+                       -name libcc1.la -o \
+                       -name libcc1plugin.la -o \
+                       -name 'libgomp.la' -o \
+                       -name 'libgomp-plugin-*.la' -o \
+                       -name libgfortran.la -o \
+                       -name libgfortranbegin.la -o \
+                       -name libmpx.la -o \
+                       -name libmpxwrappers.la -o \
+                       -name libitm.la -o \
+                       -name libvtv.la -o \
+                       -name 'lib*san.la' \
+               ')' -type f -delete
+
        # Use gid of 0 because some stupid ports don't have
        # the group 'root' set to gid 0.  Send to /dev/null
        # for people who are testing as non-root.