rui314 / mold

Mold: A Modern Linker 🦠
MIT License
13.69k stars 448 forks source link

`mold 2.31.0` build failure when targeting `ARMv6` #1250

Closed jpalus closed 2 months ago

jpalus commented 2 months ago

Build fails with

{standard input}: Assembler messages:
{standard input}:6254: Error: selected processor does not support `yield' in ARM mode

That's because of too optimistic change in 31969a27564198c26d4a309b67809d2597dc9074: https://github.com/rui314/mold/blob/2b67afb8a3e9eaeeea64d0b2349c1c8b2d64df49/common/common.h#L526-L532

The lowest ARM archs on which yield is available is ARM 6K or ARM 6M so it's missing on bare ARM 6 (-march=armv6) or lower. However __arm__ is defined on all ARM 32-bit.

rui314 commented 2 months ago

Thank you for the report. I'll remove defined(__arm__) from the line. In the meantime, please apply a local patch to compile mold for arm.

jpalus commented 2 months ago

Simple alternative to still keep it for ARMv7 would be defined(__arm__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7

rui314 commented 2 months ago

Executing pause in this code path is not super important, and perhaps even more so on less powerful ARM processors, but let me try to do something for ARM.