Skip to contentSkip to conversation

board/wandboard: fix linux compilation error due to deprecated perl statement

PATCH New imrehg at gmail.com 2 participants 3 messages Sep 21, 2015 – Sep 22, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board/wandboard: fix linux compilation error due to deprecated perl statement

From: Gergely Imreh <[email protected]>

The perl syntax has changed since linux 3.8 and it is causing a compile error in wandboard's kernel. Add in a proposed simple patch (one of the many identical versions found online).

---
 .../patches/linux/perl-define-in-timeconst.patch   | 24 ++++++++++++++++++++++
 configs/wandboard_defconfig                        |  1 +
 2 files changed, 25 insertions(+)
 create mode 100644 board/wandboard/patches/linux/perl-define-in-timeconst.patch
board/wandboard/patches/linux/perl-define-in-timeconst.patch new file +24 -0
new file mode 100644
index 0000000..811b0a4
@@ -0,0 +1,24 @@
+The use of defined() on arrays and hashes has been deprecated since perl
+5.6, but until 5.17.6 it only warned on lexicals, not package globals.
+
+Signed-off-by: Dagfinn Ilmari Manns?ker <[email protected]>
+---
+ kernel/timeconst.pl |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/kernel/timeconst.pl b/kernel/timeconst.pl
+index eb51d76..0461239 100644
+--- a/kernel/timeconst.pl
++++ b/kernel/timeconst.pl
+@@ -370,7 +370,7 @@ if ($hz eq '--can') {
+ 	}
+ 
+ 	@val = @{$canned_values{$hz}};
+-	if (!defined(@val)) {
++	if (!@val) {
+ 		@val = compute_values($hz);
+ 	}
+ 	output($hz, @val);
+-- 
+1.7.5.4
+
configs/wandboard_defconfig +1 -0
index 5d74fc3..5ce5fdf 100644
@@ -1,5 +1,6 @@
 BR2_arm=y
 BR2_cortex_a9=y
+BR2_GLOBAL_PATCH_DIR="board/wandboard/patches"
 BR2_KERNEL_HEADERS_VERSION=y
 BR2_DEFAULT_KERNEL_VERSION="3.0.101"
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_0=y
Signature · 1 line
2.5.3
#1 lore raw

PATCH 1/1 board/wandboard: fix linux compilation error due to deprecated perl statement

Gergely, All,

On 2015-09-21 23:03 +0800, imrehg at gmail.com spake thusly:

Quoted 5 lines

From: Gergely Imreh <[email protected]>

The perl syntax has changed since linux 3.8 and it is causing a compile error in wandboard's kernel. Add in a proposed simple patch (one of the many identical versions found online).

Or backport 70730bca1331fc50c3caacaea00439de1325bd6e which "fixes" this by removing the perl script in favour of a bc script:

commit 70730bca1331fc50c3caacaea00439de1325bd6e

Author: H. Peter Anvin <[email protected]>
Date:   Thu Feb 14 15:13:55 2013 -0800

kernel: Replace timeconst.pl with a bc script

bc is the standard tool for multi-precision arithmetic. We switched to Perl because akpm reported a hard-to-reproduce build hang, which was very odd because affected and unaffected machines were all running the same version of GNU bc.

Unfortunately switching to Perl required a really ugly "canning" mechanism to support Perl < 5.8 installations lacking the Math::BigInt module.

It was recently pointed out to me that some very old versions of GNU make had problems with pipes in subshells, which was indeed the construct used in the Makefile rules in that version of the patch; Perl didn't need it so switching to Perl fixed the problem for unrelated reasons. With the problem (hopefully) root-caused, we can switch back to bc and do the arbitrary-precision arithmetic naturally.

Regards,
Yann E. MORIN.

Quoted 55 lines
---
 .../patches/linux/perl-define-in-timeconst.patch   | 24 ++++++++++++++++++++++
 configs/wandboard_defconfig                        |  1 +
 2 files changed, 25 insertions(+)
 create mode 100644 board/wandboard/patches/linux/perl-define-in-timeconst.patch
board/wandboard/patches/linux/perl-define-in-timeconst.patch new file +24 -0
new file mode 100644
index 0000000..811b0a4
@@ -0,0 +1,24 @@
+The use of defined() on arrays and hashes has been deprecated since perl
+5.6, but until 5.17.6 it only warned on lexicals, not package globals.
+
+Signed-off-by: Dagfinn Ilmari Manns?ker <[email protected]>
+---
+ kernel/timeconst.pl |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/kernel/timeconst.pl b/kernel/timeconst.pl
+index eb51d76..0461239 100644
+--- a/kernel/timeconst.pl
++++ b/kernel/timeconst.pl
+@@ -370,7 +370,7 @@ if ($hz eq '--can') {
+ 	}
+ 
+ 	@val = @{$canned_values{$hz}};
+-	if (!defined(@val)) {
++	if (!@val) {
+ 		@val = compute_values($hz);
+ 	}
+ 	output($hz, @val);
+-- 
+1.7.5.4
+
configs/wandboard_defconfig +1 -0
index 5d74fc3..5ce5fdf 100644
@@ -1,5 +1,6 @@
 BR2_arm=y
 BR2_cortex_a9=y
+BR2_GLOBAL_PATCH_DIR="board/wandboard/patches"
 BR2_KERNEL_HEADERS_VERSION=y
 BR2_DEFAULT_KERNEL_VERSION="3.0.101"
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_0=y
Signature · 6 lines
2.5.3

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 board/wandboard: fix linux compilation error due to deprecated perl statement

Quoted 11 lines · Yann E. MORIN

Gergely, All,

On 2015-09-21 23:03 +0800, imrehg at gmail.com spake thusly:

Quoted 5 lines

From: Gergely Imreh <[email protected]>

The perl syntax has changed since linux 3.8 and it is causing a compile error in wandboard's kernel. Add in a proposed simple patch (one of the many identical versions found online).

Or backport 70730bca1331fc50c3caacaea00439de1325bd6e which "fixes" this by removing the perl script in favour of a bc script:

It's a bigger change, but makes sense. Made a v2 of the patch and can choose which one is more suitable to use.

Thanks a lot for the feedback!

Cheers,
Gergely

Quoted 94 lines

commit 70730bca1331fc50c3caacaea00439de1325bd6e

Author: H. Peter Anvin <[email protected]>
Date:   Thu Feb 14 15:13:55 2013 -0800

kernel: Replace timeconst.pl with a bc script

bc is the standard tool for multi-precision arithmetic. We switched to Perl because akpm reported a hard-to-reproduce build hang, which was very odd because affected and unaffected machines were all running the same version of GNU bc.

Unfortunately switching to Perl required a really ugly "canning" mechanism to support Perl < 5.8 installations lacking the Math::BigInt module.

It was recently pointed out to me that some very old versions of GNU make had problems with pipes in subshells, which was indeed the construct used in the Makefile rules in that version of the patch; Perl didn't need it so switching to Perl fixed the problem for unrelated reasons. With the problem (hopefully) root-caused, we can switch back to bc and do the arbitrary-precision arithmetic naturally.

Regards,
Yann E. MORIN.

Quoted 51 lines
---
 .../patches/linux/perl-define-in-timeconst.patch   | 24 ++++++++++++++++++++++
 configs/wandboard_defconfig                        |  1 +
 2 files changed, 25 insertions(+)
 create mode 100644 board/wandboard/patches/linux/perl-define-in-timeconst.patch
board/wandboard/patches/linux/perl-define-in-timeconst.patch new file +24 -0
new file mode 100644
index 0000000..811b0a4
@@ -0,0 +1,24 @@
+The use of defined() on arrays and hashes has been deprecated since perl
+5.6, but until 5.17.6 it only warned on lexicals, not package globals.
+
+Signed-off-by: Dagfinn Ilmari Manns?ker <[email protected]>
+---
+ kernel/timeconst.pl |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/kernel/timeconst.pl b/kernel/timeconst.pl
+index eb51d76..0461239 100644
+--- a/kernel/timeconst.pl
++++ b/kernel/timeconst.pl
+@@ -370,7 +370,7 @@ if ($hz eq '--can') {
+     }
+
+     @val = @{$canned_values{$hz}};
+-    if (!defined(@val)) {
++    if (!@val) {
+             @val = compute_values($hz);
+     }
+     output($hz, @val);
+--
+1.7.5.4
+
configs/wandboard_defconfig +1 -1
index 5d74fc3..5ce5fdf 100644
@@ -1,5 +1,6 @@
 BR2_arm=y
 BR2_cortex_a9=y
+BR2_GLOBAL_PATCH_DIR="board/wandboard/patches"
 BR2_KERNEL_HEADERS_VERSION=y
 BR2_DEFAULT_KERNEL_VERSION="3.0.101"
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_0=y
--

2.5.3

Quoted 4 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'