From: Tim Bird <tim.bird@am.sony.com>
To: <ak@linux.intel.com>
Cc: linux kernel <linux-kernel@vger.kernel.org>
Subject: Problem with ld-version.sh (scripts/Makefile.lto helper tool)
Date: Tue, 8 Jan 2013 11:59:59 -0800 [thread overview]
Message-ID: <50EC7ABF.1080901@am.sony.com> (raw)
Andi,
I'm experimenting with your LTO kernel tree and found something strange with
your helper script: scripts/ld-version.sh
It doesn't seem to produce sensible numbers for the linker version:
I have version 2.23.51.0.5 of the Linux binutils.
But the version produced by scripts/ld-version.sh is weird.
$ /opt/binutils-2.23.51.0.5/bin/ld -version
GNU ld (Linux/GNU Binutils) 2.23.51.0.5.20121110
Copyright 2012 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
$ /opt/binutils-2.23.51.0.5/bin/ld -version | scripts/ld-version.sh
22810005
The number of digits reserved for the third portion of the version string
is only 1, and it should be 2. The '51' is combining with the '23' to
produce the '28' in the strings produced by ld-version.sh
I would recommend changing the script (and the Makefile.lto that
depends on it) as follows:
diff --git a/scripts/Makefile.lto b/scripts/Makefile.lto
index da54968..74a17e2 100644
--- a/scripts/Makefile.lto
+++ b/scripts/Makefile.lto
@@ -16,7 +16,7 @@ ifneq ($(call cc-option,${LTO_CFLAGS},n),n)
# We need HJ Lu's Linux binutils because mainline binutils does not
# support mixing assembler and LTO code in the same ld -r object.
# XXX check if the gcc plugin ld is the expected one too
-ifeq ($(call ld-ifversion,-ge,22710001,y),y)
+ifeq ($(call ld-ifversion,-ge,222510001,y),y)
# should use -flto=jobserver, but we need a fix for http://gcc.gnu.org/PR50639
LTO_CFLAGS := -flto -fno-toplevel-reorder
LTO_FINAL_CFLAGS := -fuse-linker-plugin -flto=$(shell getconf _NPROCESSORS_ONLN) -fno-toplevel-reorder
diff --git a/scripts/ld-version.sh b/scripts/ld-version.sh
index 7eb0b76..6aed2be 100755
--- a/scripts/ld-version.sh
+++ b/scripts/ld-version.sh
@@ -3,6 +3,6 @@
{
gsub(".*)", "");
split($1,a, ".");
- print a[1]*10000000 + a[2]*100000 + a[3]*10000 + a[4]*100 + a[5];
+ print a[1]*100000000 + a[2]*1000000 + a[3]*10000 + a[4]*100 + a[5];
exit
}
I presume that the required version of binutils is actually 2.22.51.0.1, and not
2.27.<something> (which appears to not exist yet).
-- Tim
=============================
Tim Bird
Architecture Group Chair, CE Workgroup of the Linux Foundation
Senior Staff Engineer, Sony Network Entertainment
=============================
reply other threads:[~2013-01-08 19:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50EC7ABF.1080901@am.sony.com \
--to=tim.bird@am.sony.com \
--cc=ak@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox