linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Build issue "Error: operands mismatch -- statement `movec %d2,%caar' ignored" on m68k
@ 2024-12-29 12:48 Thomas Petazzoni
  2024-12-29 14:23 ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2024-12-29 12:48 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-m68k

Hello,

While trying to build the multi_defconfig, from Linux 6.12.5, for a
68040 system, the build fails with:

{standard input}: Assembler messages:
{standard input}:104: Error: operands mismatch -- statement `movec %d2,%caar' ignored
make[5]: *** [scripts/Makefile.build:229: arch/m68k/kernel/sys_m68k.o] Error 1

It seems like the 68020/68030 code:

        if (CPU_IS_020_OR_030) {
                if (scope == FLUSH_SCOPE_LINE && len < 256) {
                        unsigned long cacr;
                        __asm__ ("movec %%cacr, %0" : "=r" (cacr));
                        if (cache & FLUSH_CACHE_INSN)
                                cacr |= 4;
                        if (cache & FLUSH_CACHE_DATA)
                                cacr |= 0x400;
                        len >>= 2;
                        while (len--) {
                                __asm__ __volatile__ ("movec %1, %%caar\n\t"
                                                      "movec %0, %%cacr"
                                                      : /* no outputs */
                                                      : "r" (cacr), "r" (addr));
                                addr += 4;
                        }
                } else {
                        /* Flush the whole cache, even if page granularity requested. */
                        unsigned long cacr;
                        __asm__ ("movec %%cacr, %0" : "=r" (cacr));
                        if (cache & FLUSH_CACHE_INSN)
                                cacr |= 8;
                        if (cache & FLUSH_CACHE_DATA)
                                cacr |= 0x800;
                        __asm__ __volatile__ ("movec %0, %%cacr" : : "r" (cacr));
                }
                ret = 0;
                goto out_unlock;

gets compiled in, and binutils isn't happy about it.

The issue can trivially be reproduced by building the following
Buildroot configuration:

BR2_m68k=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y

Quick recipe:

$ git clone https://gitlab.com/buildroot.org/buildroot.git
$ cd buildroot/
$ cat >.config <<EOF
BR2_m68k=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
EOF
$ make olddefconfig
$ make

Is this expected?

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-12-30 11:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-29 12:48 Build issue "Error: operands mismatch -- statement `movec %d2,%caar' ignored" on m68k Thomas Petazzoni
2024-12-29 14:23 ` Geert Uytterhoeven
2024-12-30  8:30   ` Finn Thain
2024-12-30  8:53     ` Geert Uytterhoeven
2024-12-30  9:35       ` Thomas Petazzoni
2024-12-30  9:57         ` Geert Uytterhoeven
2024-12-30 11:22       ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).