fixup binutils printing from scripts/ver_linux
PATCH 1/1 fixup binutils printing from scripts/ver_linux
I just found that scripts/ver_linux does not print the binutils version properly on my Slackware 12.0 system.
The following patch fixes things up.
Pre this patch:
juhl@dragon:~/kernel/linux-2.6$ scripts/ver_linux ... binutils Binutils ...
Post this patch:
juhl@dragon:~/kernel/linux-2.6$ scripts/ver_linux ... binutils 2.17.50.0.17.20070615 ...
---
scripts/ver_linux | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
scripts/ver_linux +2 -3
@@ -21,9 +21,8 @@ gcc --version 2>&1| grep gcc | awk \ make --version 2>&1 | awk -F, '{print $1}' | awk \ '/GNU Make/{print "Gnu make ",$NF}' -ld -v | awk -F\) '{print $1}' | awk \ -'/BFD/{print "binutils ",$NF} \ -/^GNU/{print "binutils ",$4}' +echo "binutils $(ld -v | awk -F \) \ +{'print $2'} | tr -d ' ')" echo -n "util-linux " fdformat --version | awk '{print $NF}' | sed -e s/^util-linux-// -e s/\)$//
Signature · 3 lines
Jesper Juhl <[email protected]> Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html Plain text mails only, please http://www.expita.com/nomime.html
Quoted 6 lines · Jesper Juhl
I just found that
scripts/ver_linuxdoes not print the binutils version properly on my Slackware 12.0 system.
scripts/ver_linux gcc --version 2>&1| grep gcc | awk \ · line 25
Quoted 8 lines
scripts/ver_linux +2
-3@@ -21,9 +21,8 @@ gcc --version 2>&1| grep gcc | awk \ make --version 2>&1 | awk -F, '{print $1}' | awk \ '/GNU Make/{print "Gnu make ",$NF}' -ld -v | awk -F\) '{print $1}' | awk \ -'/BFD/{print "binutils ",$NF} \ -/^GNU/{print "binutils ",$4}' +echo "binutils $(ld -v | awk -F \) \ +{'print $2'} | tr -d ' ')"
NAK. It starts reporting here empty binutils field. FWIW,
$ ld -v GNU ld version 2.16.1
Quoted 22 lines · Alexey Dobriyan
Quoted 7 lines · Jesper Juhl
I just found that
scripts/ver_linuxdoes not print the binutils version properly on my Slackware 12.0 system.scripts/ver_linux gcc --version 2>&1| grep gcc | awk \ · line 26
Quoted 9 lines
scripts/ver_linux +2
-3@@ -21,9 +21,8 @@ gcc --version 2>&1| grep gcc | awk \ make --version 2>&1 | awk -F, '{print $1}' | awk \ '/GNU Make/{print "Gnu make ",$NF}' -ld -v | awk -F\) '{print $1}' | awk \ -'/BFD/{print "binutils ",$NF} \ -/^GNU/{print "binutils ",$4}' +echo "binutils $(ld -v | awk -F \) \ +{'print $2'} | tr -d ' ')"NAK. It starts reporting here empty binutils field. FWIW,
Quoted 5 lines
$ ld -v GNU ld version 2.16.1
Well the format changed so now we have :
$ ld -v GNU ld (Linux/GNU Binutils) 2.17.50.0.16.20070511
Maybe something like this may work :
echo "binutils $(ld -v | tr -d [:alpha:] | sed 's/.*)/\//;s/\///g' | tr -d ' ')"
Regards,
Gabriel C
Quoted 4 lines · Gabriel C
Quoted 4 lines
NAK. It starts reporting here empty binutils field. FWIW,
Quoted 8 lines
Quoted 3 lines
$ ld -v GNU ld version 2.16.1Well the format changed so now we have :
$ ld -v GNU ld (Linux/GNU Binutils) 2.17.50.0.16.20070511
Adding to the collection:
12:39 ichi:~ > ld -v
GNU ld version 2.17.50.0.5 20060927 (SUSE Linux)
Jan
Quoted 11 lines · Jan Engelhardt
Quoted 9 lines · Gabriel C
Quoted 7 lines
NAK. It starts reporting here empty binutils field. FWIW,
$ ld -v GNU ld version 2.16.1Well the format changed so now we have :
Quoted 10 lines
Quoted 3 lines
$ ld -v GNU ld (Linux/GNU Binutils) 2.17.50.0.16.20070511Adding to the collection:
12:39 ichi:~ > ld -v
GNU ld version 2.17.50.0.5 20060927 (SUSE Linux)
Uhh :) Ok here an ugly one :
$ ld -v | sed 's/.*version//;s/.*Binutils)//'|awk '{print $1}'|tr -d ' '
2.17.50.0.16.20070511$ echo 'GNU ld version 2.17.50.0.5 20060927 (SUSE Linux)' | sed 's/.*version//;s/.*Binutils)//'|awk '{print $1}'|tr -d ' '
2.17.50.0.5$ echo 'GNU ld version 2.16.1' | sed 's/.*version//;s/.*Binutils)//'|awk '{print $1}'|tr -d ' '
2.16.1Gabriel
Quoted 6 lines · Gabriel C
Uhh :) Ok here an ugly one :
$ ld -v | sed 's/.*version//;s/.*Binutils)//'|awk '{print $1}'|tr -d ' ' 2.17.50.0.16.20070511
Quoted 7 lines
$ echo 'GNU ld version 2.17.50.0.5 20060927 (SUSE Linux)' | sed 's/.*version//;s/.*Binutils)//'|awk '{print $1}'|tr -d ' ' 2.17.50.0.5$ echo 'GNU ld version 2.16.1' | sed 's/.*version//;s/.*Binutils)//'|awk '{print $1}'|tr -d ' ' 2.16.1
That could be more beautiful :)
For example (untested)
#!/bin/bash
set -- (ld -v);
while [ "$1" != "version" -a $# -gt 0 ]; then
shift; done; if [ "$1" == "version" ]; then version="$2";
fi;
if [ -z "$version" ]; then
echo ld missing or could not figure.
else
echo "BINUTILS: $version";
fi;
Jan
drop it ?(Re: [PATCH] fixup binutils printing from scripts/ver_linux)
In reply to Jan Engelhardt* Jan Engelhardt "Mon, 9 Jul 2007 12:41:54 +0200 (CEST)"
Quoted 10 lines · Gabriel C
Quoted 8 lines
Quoted 7 lines
NAK. It starts reporting here empty binutils field. FWIW,
$ ld -v GNU ld version 2.16.1
Quoted 8 lines
Quoted 4 lines
Well the format changed so now we have :
$ ld -v GNU ld (Linux/GNU Binutils) 2.17.50.0.16.20070511Adding to the collection:
12:39 ichi:~ > ld -v
GNU ld version 2.17.50.0.5 20060927 (SUSE Linux)
Dumb, but better solution: drop that crap, called ver_linux. Know you have many distros, so be happy with any one, and forget about black old days of finding toolchain, that can actually build the kernel.
Anything else is a Foo Linux Distribution's Problem (tm)
____
Re: drop it ?(Re: [PATCH] fixup binutils printing from scripts/ver_linux)
Quoted 3 lines
Dumb, but better solution: drop that crap, called
ver_linux. Know you have many distros, so be happy with any one, and forget about black old days of finding toolchain, that can actually build the kernel.
#v+
echo 'If some fields are empty or look unusual you may have an old version.' echo 'Compare to the current minimal requirements in Documentation/Changes.' echo ' '
#v-
The comment above is yet another cause to remind you to check reportbug tool and how it organizes collecting of information for particular bug report and package.
____
Re: drop it ?(Re: [PATCH] fixup binutils printing from scripts/ver_linux)
Quoted 11 lines · Oleg Verych
Quoted 4 lines
Dumb, but better solution: drop that crap, called
ver_linux. Know you have many distros, so be happy with any one, and forget about black old days of finding toolchain, that can actually build the kernel.#v+
echo 'If some fields are empty or look unusual you may have an old version.' echo 'Compare to the current minimal requirements inDocumentation/Changes.' echo ' '
#v-
Quoted 3 lines
The comment above is yet another cause to remind you to check
reportbugtool and how it organizes collecting of information for particular bug report and package.
We could just do $(rpm -qf $(which ld)) :^)
Jan