Skip to contentSkip to conversation

v4.14.9 on ARMv5: OK with gcc 4.8/5.4, NOK with gcc 7.2

DISCUSSION Thomas Petazzoni 3 participants 5 messages Jan 4, 2018 – Jan 5, 2018

lore
Share & tools
lore
#0 lore raw

Hello,

I'm pretty sure it has already been reported, but just in case: I'm testing v4.14.9 on an ARMv5 platform (Kirkwood-based OpenBlocks A7). mvebu_v5_defconfig boots fine when built with gcc 4.8 (good old Sourcery toolchain) or gcc 5.4 (some old Linaro toolchain), but doesn't boot at all when built with gcc 7.2 (Fedora toolchain). Even when configured and booted with earlyprintk, the kernel doesn't say anything.

The toolchain being used is the default ARM toolchain provided by Fedora 27. It says:

gcc version 7.2.1 20170915 (Red Hat Cross 7.2.1-1) (GCC) GNU ld version 2.29.1-1.fc27

So it's quite bleeding edge.

Let me know if this has already been fixed, or if I should test a patch. I have not tested 4.15-rc or next at this point, assuming that if a fix had been made, it would have been backported to 4.14-stable.

Best regards,

Thomas Petazzoni

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#1 lore raw
Quoted 12 lines · Thomas Petazzoni

Hello,

I'm pretty sure it has already been reported, but just in case: I'm testing v4.14.9 on an ARMv5 platform (Kirkwood-based OpenBlocks A7). mvebu_v5_defconfig boots fine when built with gcc 4.8 (good old Sourcery toolchain) or gcc 5.4 (some old Linaro toolchain), but doesn't boot at all when built with gcc 7.2 (Fedora toolchain). Even when configured and booted with earlyprintk, the kernel doesn't say anything.

The toolchain being used is the default ARM toolchain provided by Fedora 27. It says:

Quoted 8 lines

gcc version 7.2.1 20170915 (Red Hat Cross 7.2.1-1) (GCC) GNU ld version 2.29.1-1.fc27

So it's quite bleeding edge.

Let me know if this has already been fixed, or if I should test a patch. I have not tested 4.15-rc or next at this point, assuming that if a fix had been made, it would have been backported to 4.14-stable.

It's a known issue -

http://archive.armlinux.org.uk/lurker/message/20171018.095713.a56a717b.en.html

but so far no patches have been forthcoming for the kernel, because (I guess) it's deemed to be a gcc bug.

It's one of those discussions that just seemed to die without any real conclusion.

Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up
#2 lore raw
Quoted 37 lines · Russell King - ARM Linux
Quoted 12 lines · Thomas Petazzoni

Hello,

I'm pretty sure it has already been reported, but just in case: I'm testing v4.14.9 on an ARMv5 platform (Kirkwood-based OpenBlocks A7). mvebu_v5_defconfig boots fine when built with gcc 4.8 (good old Sourcery toolchain) or gcc 5.4 (some old Linaro toolchain), but doesn't boot at all when built with gcc 7.2 (Fedora toolchain). Even when configured and booted with earlyprintk, the kernel doesn't say anything.

The toolchain being used is the default ARM toolchain provided by Fedora 27. It says:

Quoted 8 lines

gcc version 7.2.1 20170915 (Red Hat Cross 7.2.1-1) (GCC) GNU ld version 2.29.1-1.fc27

So it's quite bleeding edge.

Let me know if this has already been fixed, or if I should test a patch. I have not tested 4.15-rc or next at this point, assuming that if a fix had been made, it would have been backported to 4.14-stable.

It's a known issue -

http://archive.armlinux.org.uk/lurker/message/20171018.095713.a56a717b.en.html

but so far no patches have been forthcoming for the kernel, because (I guess) it's deemed to be a gcc bug.

It's one of those discussions that just seemed to die without any real conclusion.

--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up According to speedtest.net: 8.21Mbps down 510kbps up

Quoted 4 lines

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

I am happy to report the gcc bug has been fixed in trunk.
I am as well dubious where they say this should also fix gcc6 where we have no known issues with gcc6.

"
This should also fix
incorrect generation of ldrd/strd with unaligned accesses that could previously have occurred on ARMv5e where all such operations must be 64-bit aligned."

https://github.com/gcc-mirror/gcc/commit/f59996b56aaa1c1d62a16cbb4010775b624cbde0

In OpenEmbedded we backported the patch a while ago, see the discussion about qemu booting where real hw doesn't:
http://lists.openembedded.org/pipermail/openembedded-core/2017-November/144045.html

Regards
Andrea

#3 lore raw
Quoted 55 lines · Andrea Adami
Quoted 37 lines · Russell King - ARM Linux
Quoted 12 lines · Thomas Petazzoni

Hello,

I'm pretty sure it has already been reported, but just in case: I'm testing v4.14.9 on an ARMv5 platform (Kirkwood-based OpenBlocks A7). mvebu_v5_defconfig boots fine when built with gcc 4.8 (good old Sourcery toolchain) or gcc 5.4 (some old Linaro toolchain), but doesn't boot at all when built with gcc 7.2 (Fedora toolchain). Even when configured and booted with earlyprintk, the kernel doesn't say anything.

The toolchain being used is the default ARM toolchain provided by Fedora 27. It says:

Quoted 8 lines

gcc version 7.2.1 20170915 (Red Hat Cross 7.2.1-1) (GCC) GNU ld version 2.29.1-1.fc27

So it's quite bleeding edge.

Let me know if this has already been fixed, or if I should test a patch. I have not tested 4.15-rc or next at this point, assuming that if a fix had been made, it would have been backported to 4.14-stable.

It's a known issue -

http://archive.armlinux.org.uk/lurker/message/20171018.095713.a56a717b.en.html

but so far no patches have been forthcoming for the kernel, because (I guess) it's deemed to be a gcc bug.

It's one of those discussions that just seemed to die without any real conclusion.

--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up According to speedtest.net: 8.21Mbps down 510kbps up

Quoted 4 lines

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

I am happy to report the gcc bug has been fixed in trunk.
I am as well dubious where they say this should also fix gcc6 where we have no known issues with gcc6.

"
This should also fix
incorrect generation of ldrd/strd with unaligned accesses that could previously have occurred on ARMv5e where all such operations must be 64-bit aligned."

Quoted 5 lines

https://github.com/gcc-mirror/gcc/commit/f59996b56aaa1c1d62a16cbb4010775b624cbde0

In OpenEmbedded we backported the patch a while ago, see the discussion about qemu booting where real hw doesn't:
http://lists.openembedded.org/pipermail/openembedded-core/2017-November/144045.html

Thanks for reporting the update Andrea!

Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up
#4 lore raw

Hello,

Quoted 10 lines · Russell King - ARM Linux
Quoted 10 lines

I am happy to report the gcc bug has been fixed in trunk.
I am as well dubious where they say this should also fix gcc6 where we have no known issues with gcc6.

"
This should also fix
incorrect generation of ldrd/strd with unaligned accesses that could previously have occurred on ARMv5e where all such operations must be 64-bit aligned."

Quoted 7 lines
Quoted 5 lines

https://github.com/gcc-mirror/gcc/commit/f59996b56aaa1c1d62a16cbb4010775b624cbde0

In OpenEmbedded we backported the patch a while ago, see the discussion about qemu booting where real hw doesn't:
http://lists.openembedded.org/pipermail/openembedded-core/2017-November/144045.html

Thanks for reporting the update Andrea!

Thanks Russell and Andrea for the feedback. Good to know that the problem was already known and even fixed. I'll wait for the gcc 7.x fix to land in my distro toolchain, and will keep using an older toolchain until then.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com