lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 8 Jan 2013 11:59:59 -0800
From:	Tim Bird <tim.bird@...sony.com>
To:	<ak@...ux.intel.com>
CC:	linux kernel <linux-kernel@...r.kernel.org>
Subject: Problem with ld-version.sh (scripts/Makefile.lto helper tool)

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
=============================

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ