* [Buildroot] [PATCH v2 1/4] mpir: fix build on ARM with old binutils versions
2017-05-08 19:45 [Buildroot] [PATCH v2 0/4] mpir build fixes Thomas Petazzoni
@ 2017-05-08 19:45 ` Thomas Petazzoni
2017-05-08 19:45 ` [Buildroot] [PATCH v2 2/4] mpir: fix build on ARM Thumb-only platforms Thomas Petazzoni
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2017-05-08 19:45 UTC (permalink / raw)
To: buildroot
Old binutils versions are affected by a bug when the assembly code has
whitespace between [ ] signs, causing a build failure of the mpir
package with ARM toolchains using such old binutils versions.
This commit fixes that by adding a patch that removes those whitespaces.
Fixes:
- http://autobuild.buildroot.net/results/ec67ffdef74b9a61d0491e71f8cb2f8f0b6daa50/
armv7-ctng-linux-gnueabihf Crosstool-NG toolchain
- http://autobuild.buildroot.net/results/2e4a27af60065db51aca9e69701bc191d24b2209/
armv5-ctng-linux-gnueabi Crosstool-NG toolchain
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
...rm-udiv.asm-workaround-binutils-bug-14887.patch | 40 ++++++++++++++++++++++
1 file changed, 40 insertions(+)
create mode 100644 package/mpir/0001-mpn-arm-udiv.asm-workaround-binutils-bug-14887.patch
diff --git a/package/mpir/0001-mpn-arm-udiv.asm-workaround-binutils-bug-14887.patch b/package/mpir/0001-mpn-arm-udiv.asm-workaround-binutils-bug-14887.patch
new file mode 100644
index 0000000..6a6f467
--- /dev/null
+++ b/package/mpir/0001-mpn-arm-udiv.asm-workaround-binutils-bug-14887.patch
@@ -0,0 +1,40 @@
+From d858ce52d1971cb4e8500b0ebc0472fdae4686ec Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Sun, 7 May 2017 23:12:04 +0200
+Subject: [PATCH] mpn/arm/udiv.asm: workaround binutils bug #14887
+
+Old binutils versions are affected by bug #14887,
+https://sourceware.org/bugzilla/show_bug.cgi?id=14887, which causes a
+build failure when a register specification is surrounded by
+whitespaces. Removing those whitespaces works around the issue.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ mpn/arm/udiv.asm | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/mpn/arm/udiv.asm b/mpn/arm/udiv.asm
+index 25197a6..ed11eb3 100644
+--- a/mpn/arm/udiv.asm
++++ b/mpn/arm/udiv.asm
+@@ -50,7 +50,7 @@ L(oop): divstep(n1,n0,d)
+ teq r12, #0
+ bne L(oop)
+
+- str n1, [ rem_ptr ] C store remainder
++ str n1, [rem_ptr] C store remainder
+ adc r0, n0, n0 C quotient: add last carry from divstep
+ mov pc, lr
+
+@@ -89,7 +89,7 @@ L(oop2):
+ addcs n0, n0, #1 C adjust quotient
+
+ L(_even_divisor):
+- str n1, [ rem_ptr ] C store remainder
++ str n1, [rem_ptr] C store remainder
+ mov r0, n0 C quotient
+ ldmfd sp!, { r8, pc }
+ EPILOGUE(mpn_udiv_qrnnd)
+--
+2.7.4
+
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* [Buildroot] [PATCH v2 2/4] mpir: fix build on ARM Thumb-only platforms
2017-05-08 19:45 [Buildroot] [PATCH v2 0/4] mpir build fixes Thomas Petazzoni
2017-05-08 19:45 ` [Buildroot] [PATCH v2 1/4] mpir: fix build on ARM with old binutils versions Thomas Petazzoni
@ 2017-05-08 19:45 ` Thomas Petazzoni
2017-05-08 19:45 ` [Buildroot] [PATCH v2 3/4] mpir: fix build on mips32r6/mips64r6 Thomas Petazzoni
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2017-05-08 19:45 UTC (permalink / raw)
To: buildroot
The optimized ARM assembly code is not suitable for Thumb-only
platforms, so use the generic code in such situations.
Fixes:
http://autobuild.buildroot.net/results/4d7f2a1326f75e11693bdd51ad274079b0dd0ce4/
(ARM Cortex-M4 toolchain)
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/mpir/mpir.mk | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/package/mpir/mpir.mk b/package/mpir/mpir.mk
index b7f3829..cf17502 100644
--- a/package/mpir/mpir.mk
+++ b/package/mpir/mpir.mk
@@ -20,4 +20,10 @@ ifeq ($(BR2_MIPS_NABI64),y)
MPIR_CONF_OPTS += ABI=64
endif
+# The optimized ARM assembly code uses ARM-only (i.e not Thumb1/2
+# compatible) instructions.
+ifeq ($(BR2_arm)$(BR2_armeb):$(BR2_ARM_CPU_HAS_ARM),y:)
+MPIR_CONF_ENV += MPN_PATH="generic"
+endif
+
$(eval $(autotools-package))
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* [Buildroot] [PATCH v2 3/4] mpir: fix build on mips32r6/mips64r6
2017-05-08 19:45 [Buildroot] [PATCH v2 0/4] mpir build fixes Thomas Petazzoni
2017-05-08 19:45 ` [Buildroot] [PATCH v2 1/4] mpir: fix build on ARM with old binutils versions Thomas Petazzoni
2017-05-08 19:45 ` [Buildroot] [PATCH v2 2/4] mpir: fix build on ARM Thumb-only platforms Thomas Petazzoni
@ 2017-05-08 19:45 ` Thomas Petazzoni
2017-05-08 19:45 ` [Buildroot] [PATCH v2 4/4] mpir: fix build on powerpc64le Thomas Petazzoni
2017-05-09 15:12 ` [Buildroot] [PATCH v2 0/4] mpir build fixes Peter Korsgaard
4 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2017-05-08 19:45 UTC (permalink / raw)
To: buildroot
The optimized mips32 and mips64 assembly code is not compatible with
mips32r6/mips64r6, so use the generic code of MPIR on such platforms.
Fixes:
- http://autobuild.buildroot.net/results/db2542a2ec3029eda81738a7ae5faeb9ea4aedee/
mips32r6 toolchain
- http://autobuild.buildroot.net/results/50b94e6d0dbc33664c6bfe06f83b211083aa07f7/
mips64r6 toolchain
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
package/mpir/mpir.mk | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/package/mpir/mpir.mk b/package/mpir/mpir.mk
index cf17502..03f21d8 100644
--- a/package/mpir/mpir.mk
+++ b/package/mpir/mpir.mk
@@ -26,4 +26,9 @@ ifeq ($(BR2_arm)$(BR2_armeb):$(BR2_ARM_CPU_HAS_ARM),y:)
MPIR_CONF_ENV += MPN_PATH="generic"
endif
+# Optimized mips32/mips64 code not suitable for mips32r6/mips64r6
+ifeq ($(BR2_mips_32r6)$(BR2_mips_64r6),y)
+MPIR_CONF_ENV += MPN_PATH="generic"
+endif
+
$(eval $(autotools-package))
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH v2 4/4] mpir: fix build on powerpc64le
2017-05-08 19:45 [Buildroot] [PATCH v2 0/4] mpir build fixes Thomas Petazzoni
` (2 preceding siblings ...)
2017-05-08 19:45 ` [Buildroot] [PATCH v2 3/4] mpir: fix build on mips32r6/mips64r6 Thomas Petazzoni
@ 2017-05-08 19:45 ` Thomas Petazzoni
2017-05-09 15:12 ` [Buildroot] [PATCH v2 0/4] mpir build fixes Peter Korsgaard
4 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2017-05-08 19:45 UTC (permalink / raw)
To: buildroot
The optimized powerpc64 code is not compatible with powerpc64le, so use
the generic MPIR code on powerpc64le.
Fixes:
http://autobuild.buildroot.net/results/17e523be894b60d7a9b2a3303f02c3fb34816828/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/mpir/mpir.mk | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/package/mpir/mpir.mk b/package/mpir/mpir.mk
index 03f21d8..697e838 100644
--- a/package/mpir/mpir.mk
+++ b/package/mpir/mpir.mk
@@ -31,4 +31,9 @@ ifeq ($(BR2_mips_32r6)$(BR2_mips_64r6),y)
MPIR_CONF_ENV += MPN_PATH="generic"
endif
+# Optimized powerpc64 code is not suitable for powerpc64le
+ifeq ($(BR2_powerpc64le),y)
+MPIR_CONF_ENV += MPN_PATH="generic"
+endif
+
$(eval $(autotools-package))
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* [Buildroot] [PATCH v2 0/4] mpir build fixes
2017-05-08 19:45 [Buildroot] [PATCH v2 0/4] mpir build fixes Thomas Petazzoni
` (3 preceding siblings ...)
2017-05-08 19:45 ` [Buildroot] [PATCH v2 4/4] mpir: fix build on powerpc64le Thomas Petazzoni
@ 2017-05-09 15:12 ` Peter Korsgaard
4 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2017-05-09 15:12 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
> Hello,
> This new version of the mpir build fixes series now fixes the build
> for all 49 toolchain configurations, tested with the test-pkg script.
> Changes since v1:
> - Fix a typo in the mips32r6/mips64r6 that originally made it useless
> (BR2_mips32r6 was used, while the option is name BR2_mips_32r6)
> - Add a patch to fix the powerpc64le build
> Best regards,
> Thomas
> Thomas Petazzoni (4):
> mpir: fix build on ARM with old binutils versions
> mpir: fix build on ARM Thumb-only platforms
> mpir: fix build on mips32r6/mips64r6
> mpir: fix build on powerpc64le
Committed all 4, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 6+ messages in thread