[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: armel buildd misconfiguration (was Re: Bug#1017537: dietlibc: FTBFS on armel)



On Mon, Aug 22, 2022 at 3:08 AM Thorsten Glaser <tg@debian.org> wrote:
>
> outlook 1017537 some armel buildds are misconfigured and lack SWP emulation
> thanks
>
> Dixi quod…
>
> ># if __ARM_ARCH__ < 6
> >       swp     r0, r1, [r2]
> ># else
>
> And this, after some research, is it. This is needed for armel, which
> is v5. Apparently, Linux has SWP emulation for v7/v8 hosts, but at least
> one buildd listed does not have this enabled, breaking the armel ABI.
>
> Please ensure that only hosts with working SWP emulation run armel.
>
> (Can I reassign this bugreport to the buildd? Does it have a virtual
> package in debbugs?)

For reference, the instruction is not avaialable on Armv7 but is emulated
on 32-bit kernels whenever CONFIG_SWP_EMULATE is enabled,
this is defined as:

config SWP_EMULATE
            bool "Emulate SWP/SWPB instructions" if !SMP
            depends on CPU_V7
            default y if SMP
            select HAVE_PROC_CPU if PROC_FS

so this is enabled on all SMP-enabled kernels but can be disabled
on uniprocessor Armv7 builds, which would be broken here.

On 64-bit kernels, the same option is not enabled by default
in mainline kernels, so the kernel config needs to contain
CONFIG_COMPAT=y, ARMV8_DEPRECATED=y, and
CONFIG_SWP_EMULATION=y. This also has to be enabled
at runtime using the "abi.swp=1" sysctl, see
https://www.kernel.org/doc/Documentation/arm64/legacy_instructions.rst

Most likely, the buildd is running a default debian kernel and has
the compile-time options enabled, but has it disabled at runtime.

Can you find out if /proc/sys/abi/swp exists on the system, and
what its contents are? If it does not exist, fixing this requires
a change to the kernel configuration, if it exists but contains
'0', then running binaries with the swp instruction just requires
changing the local sysctl.conf for any armel buildd.


Reply to: