Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mold 2.31.0 build failure when targeting ARMv6 #1250

Closed
jpalus opened this issue May 3, 2024 · 3 comments
Closed

mold 2.31.0 build failure when targeting ARMv6 #1250

jpalus opened this issue May 3, 2024 · 3 comments

Comments

@jpalus
Copy link
Contributor

jpalus commented May 3, 2024

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 31969a2:

mold/common/common.h

Lines 526 to 532 in 2b67afb

static inline void pause() {
#if defined(__x86_64__)
asm volatile("pause");
#elif defined(__arm__) || defined(__aarch64__)
asm volatile("yield");
#endif
}

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
Copy link
Owner

rui314 commented May 3, 2024

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.

@rui314 rui314 closed this as completed in f0f61cc May 3, 2024
@jpalus
Copy link
Contributor Author

jpalus commented May 3, 2024

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

@rui314
Copy link
Owner

rui314 commented May 4, 2024

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.

rui314 added a commit that referenced this issue May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants