ClangBuiltLinux / linux

Linux kernel source tree
Other
241 stars 14 forks source link

invalid output constraint '+a' in asm #1226

Closed nickdesaulniers closed 3 years ago

nickdesaulniers commented 3 years ago

working around #1224 , I observe:

In file included from scripts/mod/devicetable-offsets.c:3:
In file included from ./include/linux/mod_devicetable.h:13:
In file included from ./include/linux/uuid.h:12:
In file included from ./include/linux/string.h:21:
./arch/m68k/include/asm/string.h:20:5: error: invalid output constraint '+a' in asm
                : "+a" (sc), "+d" (count));
                  ^
./arch/m68k/include/asm/string.h:36:5: error: invalid output constraint '+a' in asm
                : "+a" (dest), "+a" (src), "+d" (n)
                  ^
./arch/m68k/include/asm/string.h:56:5: error: invalid output constraint '+a' in asm
                : "+a" (cs), "+a" (ct), "=d" (res));
                  ^

Looks like some of the inline asm constraint handling code needs to be taught about the new M68k backend. cc @mshockwave

mshockwave commented 3 years ago

Managed to fix this in Clang with no problem. Nevertheless after fixing this I bumped into a bunch of "unrecognized inline asm syntax XYZ" problems screaming from the assembler - namely m68k's MC part since m68k is using integrated assembler now (or just temporarily switching back to GNU AS by giving -fno-integrated-as to Clang if you want to bypass any assembly related issues).

I will close this issue with a pointer to the patch in the M68k-llvm's repo. And might file another issue regarding unrecognized inline asm syntax, if that's the best way to keep record

mshockwave commented 3 years ago

This issue is now fixed in https://github.com/M680x0/M680x0-mono-repo. Please (force) pull that repo to get the update