Giter Club home page Giter Club logo

Comments (1)

zeule avatar zeule commented on June 12, 2024

A simple fix:

--- /usr/bin/lto-rebuild.orig    2023-05-02 23:20:59.064006276 +0200
+++ /usr/bin/lto-rebuild 2023-05-05 21:10:58.499995951 +0200
@@ -27,6 +27,7 @@
 {
 local prefix="${EROOT%/}/usr/lib"
 local suffix="\.a"
+local all_archives=()
 local archives=()
 local packages=()
 local GCC_VER=""
@@ -41,16 +42,18 @@
 
 # Exclude /usr/lib/gcc/<arch> because these are internal
 # to the [cross-]compilers on the system
-mapfile -t archives < <(
+mapfile -t all_archives < <(
    find "${prefix}"{,64,32} -type f -name "*${suffix}" \
-   -exec readelf -p .comment {} + \
    -o -path "${prefix}64/gcc" -prune \
    -o -path "${prefix}32/gcc" -prune \
-   -o -path "${prefix}/gcc" -prune 2> /dev/null | \
-   grep -v "${GCC_VER}" | grep -B3 "GCC:" | \
-   grep -o "${prefix}.*${suffix}" | uniq
+   -o -path "${prefix}/gcc" -prune 2> /dev/null
 )
 
+for a in ${all_archives[@]}; do
+   gcc_ver=$(readelf -p .comment "$a" 2>/dev/null | grep "GCC:" | sed -E 's/^.+\(.+\) ([0-9]+).*$/\1/' | sort -u | head -1 )
+   [[ ! -z $gcc_ver && $gcc_ver != $GCC_VER ]] && archives+=( "$a" )
+done
+
 if [[ ${#archives[@]} -eq 0 ]]
 then
    echo "No problems found!" >&2

from gentoolto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.