Skip to contentSkip to conversation

Revert "configs/stm32f429: force usage of binutils 2.28.x"

PATCH New Christophe PRIOUZEAU 3 participants 12 messages May 31, 2018 – Jun 1, 2018 Arm STM32

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/4 Revert "configs/stm32f429: force usage of binutils 2.28.x"

This reverts commit cbe43fd417d77f846f1ca47cdacd51a73be1aaec.

---
 configs/stm32f429_disco_defconfig | 1 -
 1 file changed, 1 deletion(-)
configs/stm32f429_disco_defconfig +0 -1
index fc167d0..5237e9a 100644
@@ -2,7 +2,6 @@ BR2_arm=y
 BR2_cortex_m4=y
 BR2_GLOBAL_PATCH_DIR="board/stmicroelectronics/stm32f429-disco/patches"
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_11=y
-BR2_BINUTILS_VERSION_2_28_X=y
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/stmicroelectronics/stm32-post-build.sh"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
Signature · 1 line
2.7.4
#1 lore raw

PATCH v3 2/4 Revert "configs/stm32f469: force usage of binutils 2.28.x"

This reverts commit 12049cc8b8972a9d0f1e27f1382cc5752d45312f.

---
 configs/stm32f469_disco_defconfig | 1 -
 1 file changed, 1 deletion(-)
configs/stm32f469_disco_defconfig +0 -1
index e5cacaf..8b77d8c 100644
@@ -2,7 +2,6 @@ BR2_arm=y
 BR2_cortex_m4=y
 BR2_GLOBAL_PATCH_DIR="board/stmicroelectronics/stm32f469-disco/patches"
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_11=y
-BR2_BINUTILS_VERSION_2_28_X=y
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/stmicroelectronics/stm32-post-build.sh"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
Signature · 1 line
2.7.4
#2 lore raw

PATCH v3 2/4 Revert "configs/stm32f469: force usage of binutils 2.28.x"

Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Christophe" == Christophe PRIOUZEAU <[email protected]> writes:

This reverts commit 12049cc8b8972a9d0f1e27f1382cc5752d45312f.

Committed after extending the commit message with a description of why this can now be reverted, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH v3 3/4 package/binutils: Cortex-M targets require version <2.29

In reply to Christophe PRIOUZEAU

From: Laurent GONZALEZ <[email protected]>

binutils 2.29 changed the implementation of adr pseudo instruction it breaks linux kernel and impacts Cortex-M targets (eg. stm32)

---
 package/binutils/Config.in.host | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
package/binutils/Config.in.host +3 -2
index 03b2281..9a4caad 100644
@@ -2,8 +2,9 @@ comment "Binutils Options"
 
 choice
 	prompt "Binutils Version"
-	default BR2_BINUTILS_VERSION_2_29_X if !BR2_arc
-	default BR2_BINUTILS_VERSION_ARC if BR2_arc
+	default BR2_BINUTILS_VERSION_2_28_X if BR2_ARM_CPU_ARMV7M
+	default BR2_BINUTILS_VERSION_2_29_X if !BR2_arc && !BR2_ARM_CPU_ARMV7M
+	default BR2_BINUTILS_VERSION_ARC if BR2_arc && !BR2_ARM_CPU_ARMV7M
 	help
 	  Select the version of binutils you wish to use.
 
Signature · 1 line
2.7.4
#4 lore raw

PATCH v3 3/4 package/binutils: Cortex-M targets require version <2.29

Quoted 17 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Christophe" == Christophe PRIOUZEAU <[email protected]> writes:

From: Laurent GONZALEZ <[email protected]>
binutils 2.29 changed the implementation of adr pseudo instruction it breaks linux kernel and impacts Cortex-M targets (eg. stm32)

---
 package/binutils/Config.in.host | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
package/binutils/Config.in.host +0 -0
index 03b2281..9a4caad 100644

package/binutils/Config.in.host comment "Binutils Options" · line 7

Quoted 8 lines
package/binutils/Config.in.host +3 -2
@@ -2,8 +2,9 @@ comment "Binutils Options"
 
 choice
 	prompt "Binutils Version"
-	default BR2_BINUTILS_VERSION_2_29_X if !BR2_arc
-	default BR2_BINUTILS_VERSION_ARC if BR2_arc
+	default BR2_BINUTILS_VERSION_2_28_X if BR2_ARM_CPU_ARMV7M
+	default BR2_BINUTILS_VERSION_2_29_X if !BR2_arc && !BR2_ARM_CPU_ARMV7M
+	default BR2_BINUTILS_VERSION_ARC if BR2_arc && !BR2_ARM_CPU_ARMV7M

kconfig will use the first available default line, so it is enough to simply add:

default BR2_BINUTILS_VERSION_2_28_X if BR2_ARM_CPU_ARMV7M

In front of the others. Committed with that fixed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

PATCH v3 3/4 package/binutils: Cortex-M targets require version <2.29

In reply to Christophe PRIOUZEAU

Christophe, All,

On 2018-05-31 13:21 +0000, Christophe PRIOUZEAU spake thusly:

Quoted 16 lines

From: Laurent GONZALEZ <[email protected]>

binutils 2.29 changed the implementation of adr pseudo instruction it breaks linux kernel and impacts Cortex-M targets (eg. stm32)

---
 package/binutils/Config.in.host | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
package/binutils/Config.in.host +0 -0
index 03b2281..9a4caad 100644

package/binutils/Config.in.host comment "Binutils Options" · line 5

Quoted 6 lines
package/binutils/Config.in.host +1 -2
@@ -2,8 +2,9 @@ comment "Binutils Options"
 
 choice
 	prompt "Binutils Version"
-	default BR2_BINUTILS_VERSION_2_29_X if !BR2_arc
-	default BR2_BINUTILS_VERSION_ARC if BR2_arc
+	default BR2_BINUTILS_VERSION_2_28_X if BR2_ARM_CPU_ARMV7M

Again, isn't it the fact that a Thumb-mode compilation is attempted, so we'd trigger the same issue when building in Thumb mode for (e.g.) a cortex-a CPU as well?

Regards,
Yann E. MORIN.

Quoted 11 lines
package/binutils/Config.in.host +2 -0
+	default BR2_BINUTILS_VERSION_2_29_X if !BR2_arc && !BR2_ARM_CPU_ARMV7M
+	default BR2_BINUTILS_VERSION_ARC if BR2_arc && !BR2_ARM_CPU_ARMV7M
 	help
 	  Select the version of binutils you wish to use.
 
Signature · 5 lines
2.7.4
_______________________________________________
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.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH v3 3/4 package/binutils: Cortex-M targets require version <2.29

Quoted 21 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Christophe, All,
On 2018-05-31 13:21 +0000, Christophe PRIOUZEAU spake thusly:

Quoted 17 lines

From: Laurent GONZALEZ <[email protected]>

binutils 2.29 changed the implementation of adr pseudo instruction it breaks linux kernel and impacts Cortex-M targets (eg. stm32)

---
package/binutils/Config.in.host | 5 +++--

1 file changed, 3 insertions(+), 2 deletions(-)
package/binutils/Config.in.host +0 -0
index 03b2281..9a4caad 100644
@@ -2,8 +2,9 @@ comment "Binutils Options"
 
Quoted 9 lines

package/binutils/Config.in.host comment "Binutils Options" · line 5

Quoted 5 lines

choice
prompt "Binutils Version"

package/binutils/Config.in.host +1 -2
-	default BR2_BINUTILS_VERSION_2_29_X if !BR2_arc
-	default BR2_BINUTILS_VERSION_ARC if BR2_arc
+	default BR2_BINUTILS_VERSION_2_28_X if BR2_ARM_CPU_ARMV7M

Again, isn't it the fact that a Thumb-mode compilation is attempted, so we'd trigger the same issue when building in Thumb mode for (e.g.) a cortex-a CPU as well?

Yes, it looks like you are right. Lacking hardware at hand I did a test build of qemu_arm_vexpress:

default, E.G. binutils 2.29, ARM instructions: OK 2.28, THUMB2_KERNEL / BR2_ARM_INSTRUCTIONS_THUMB2: OK 2.29, THUMB2_KERNEL / BR2_ARM_INSTRUCTIONS_THUMB2: FAIL

It crashes in init:

devtmpfs: mounted
Freeing unused kernel memory: 1024K

Internal error: Oops - undefined instruction: 0 [#1] SMP THUMB2
Modules linked in:
CPU: 0 PID: 1 Comm: init Not tainted 4.16.7 #1
Hardware name: ARM-Versatile Express
PC is at ret_fast_syscall+0x4/0x62

See https://pastebin.com/VdtBWEgi for the complete boot log.

So I guess we should change the BR2_ARM_CPU_ARMV7M to BR2_ARM_INSTRUCTIONS_THUMB2.

Signature · 1 line
Bye, Peter Korsgaard
#7 lore raw

PATCH v3 4/4 linux: config.in: add comment for Arm Cortex-M

In reply to Christophe PRIOUZEAU

When binutils > 2.28 are selected on Arm Cortex-M cpu, linux kernel does not boot due to a new implementation of 'adr pseudo instruction' on binutils.

Bugzilla thread: https://bugs.busybox.net/show_bug.cgi?id=11051

---
Changes v1 -> v2
- correct depends on for comment

Changes v2 -> v3
- use correct TAG BR2_ARM_CPU_ARMV7M
- invert depends for BR2_ARM_CPU_ARMV7M

 linux/Config.in | 4 ++++
 1 file changed, 4 insertions(+)
linux/Config.in +4 -0
index 73a3299..b5957b6 100644
@@ -8,6 +8,10 @@ config BR2_LINUX_KERNEL
 
 if BR2_LINUX_KERNEL
 
+comment "Linux kernel will not boot with binutils >= 2.29"
+	depends on BR2_ARM_CPU_ARMV7M
+	depends on !BR2_BINUTILS_VERSION_2_28_X
+
 # Packages that need to have a kernel with support for loadable modules,
 # but do not use the kernel-modules infrastructure, should select that
 # option.
Signature · 1 line
2.7.4
#8 lore raw

PATCH v3 4/4 linux: config.in: add comment for Arm Cortex-M

Quoted 25 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Christophe" == Christophe PRIOUZEAU <[email protected]> writes:

When binutils > 2.28 are selected on Arm Cortex-M cpu, linux kernel does not boot due to a new implementation of 'adr pseudo instruction' on binutils.

Bugzilla thread: https://bugs.busybox.net/show_bug.cgi?id=11051

---
Changes v1 -> v2
- correct depends on for comment

Changes v2 -> v3
- use correct TAG BR2_ARM_CPU_ARMV7M
- invert depends for BR2_ARM_CPU_ARMV7M

 linux/Config.in | 4 ++++
 1 file changed, 4 insertions(+)
linux/Config.in +0 -0
index 73a3299..b5957b6 100644

linux/Config.in config BR2_LINUX_KERNEL · line 11

Quoted 4 lines
linux/Config.in +1 -0
@@ -8,6 +8,10 @@ config BR2_LINUX_KERNEL
 
 if BR2_LINUX_KERNEL
 
+comment "Linux kernel will not boot with binutils >= 2.29"

The hope is still that this may be fixed in newer Linux kernel versions so I changed it to the less strong:

Linux kernel may fail to boot with binutils >= 2.29

And committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#9 lore raw

PATCH v3 4/4 linux: config.in: add comment for Arm Cortex-M

In reply to Christophe PRIOUZEAU

Christophe, All,

On 2018-05-31 13:21 +0000, Christophe PRIOUZEAU spake thusly:

Quoted 23 lines

When binutils > 2.28 are selected on Arm Cortex-M cpu, linux kernel does not boot due to a new implementation of 'adr pseudo instruction' on binutils.

Bugzilla thread: https://bugs.busybox.net/show_bug.cgi?id=11051

---
Changes v1 -> v2
- correct depends on for comment

Changes v2 -> v3
- use correct TAG BR2_ARM_CPU_ARMV7M
- invert depends for BR2_ARM_CPU_ARMV7M

 linux/Config.in | 4 ++++
 1 file changed, 4 insertions(+)
linux/Config.in +0 -0
index 73a3299..b5957b6 100644

linux/Config.in config BR2_LINUX_KERNEL · line 12

Quoted 5 lines
linux/Config.in +2 -0
@@ -8,6 +8,10 @@ config BR2_LINUX_KERNEL
 
 if BR2_LINUX_KERNEL
 
+comment "Linux kernel will not boot with binutils >= 2.29"
+	depends on BR2_ARM_CPU_ARMV7M

So, my understanding was that the build in Thuimb mode was what was causing the issue, rather than the actual architecture.

So, if one has (say) a Cortex-A9, and decides to build in Thumb mode, as well as build its kernel in Thumb mode, wouldn't that also trigger the issue as well?

Regards,
Yann E. MORIN.

Quoted 11 lines
linux/Config.in +2 -0
+	depends on !BR2_BINUTILS_VERSION_2_28_X
+
 # Packages that need to have a kernel with support for loadable modules,
 # but do not use the kernel-modules infrastructure, should select that
 # option.
Signature · 5 lines
2.7.4
_______________________________________________
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.  |
'------------------------------^-------^------------------^--------------------'
#10 lore raw

PATCH v3 4/4 linux: config.in: add comment for Arm Cortex-M

Christophe, All,

On 2018-06-01 17:39 +0200, Yann E. MORIN spake thusly:

Quoted 6 lines

On 2018-05-31 13:21 +0000, Christophe PRIOUZEAU spake thusly:

Quoted 5 lines

When binutils > 2.28 are selected on Arm Cortex-M cpu, linux kernel does not boot due to a new implementation of 'adr pseudo instruction' on binutils.

Bugzilla thread: https://bugs.busybox.net/show_bug.cgi?id=11051

[--SNIP--]

Quoted 14 lines

linux/Config.in config BR2_LINUX_KERNEL · line 12

Quoted 10 lines
linux/Config.in +2 -0
index 73a3299..b5957b6 100644
@@ -8,6 +8,10 @@ config BR2_LINUX_KERNEL
 
 if BR2_LINUX_KERNEL
 
+comment "Linux kernel will not boot with binutils >= 2.29"
+	depends on BR2_ARM_CPU_ARMV7M

So, my understanding was that the build in Thuimb mode was what was causing the issue, rather than the actual architecture.

Quoted 3 lines

So, if one has (say) a Cortex-A9, and decides to build in Thumb mode, as well as build its kernel in Thumb mode, wouldn't that also trigger the issue as well?

So, with Peter, we've attemped various tests, all based of our qemu_arm_vexpress_defconfig, with the followingf results:

- defconfig with no change, ie.e arm mode with binutils 2.29: OK

- defconfig with just Thumb mode and kernel in Thumb2, still with

    binutils 2.29: KO

- defconfig with Thumb mode, kernel in Thumb2, and binutils 2.28: OK

So, it really is thumb mode and binutils 2.29 that is at fault, not just armv7m.

I'm cooking the patch right now, theres a good smell around; baking is on good tracks... ;-)

Regards,
Yann E. MORIN.

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.  |
'------------------------------^-------^------------------^--------------------'
#11 lore raw

PATCH v3 1/4 Revert "configs/stm32f429: force usage of binutils 2.28.x"

In reply to Christophe PRIOUZEAU
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Christophe" == Christophe PRIOUZEAU <[email protected]> writes:

This reverts commit cbe43fd417d77f846f1ca47cdacd51a73be1aaec.

Committed after extending the commit message with a description of why this can now be reverted, thanks.

Signature · 1 line
Bye, Peter Korsgaard