loongson-community / linux-stable

Linux kernel source tree for Loongson
Other
67 stars 21 forks source link

[Compiler] unsupported inline asm: input with type 'unsigned long' #5

Open xiangzhai opened 6 years ago

xiangzhai commented 6 years ago

Hi Loonger,

LLVM toolchain failed to build:

clang-7: warning: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Wignored-optimization-argument]
clang-7: warning: optimization flag '-fmerge-constants' is not supported [-Wignored-optimization-argument]
In file included from init/do_mounts.c:32:
In file included from ./include/linux/nfs_fs.h:30:
In file included from ./include/linux/sunrpc/clnt.h:27:
In file included from ./include/net/ipv6.h:16:
In file included from ./include/linux/ipv6.h:76:
In file included from ./include/linux/icmpv6.h:4:
In file included from ./include/linux/skbuff.h:31:
In file included from ./include/net/checksum.h:26:
./arch/mips/include/asm/checksum.h:195:9: error: unsupported inline asm: input with type 'unsigned long'
      matching output with type '__wsum' (aka 'unsigned int')
        : "0" ((__force unsigned long)daddr),
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
scripts/Makefile.build:296: recipe for target 'init/do_mounts.o' failed
make[1]: *** [init/do_mounts.o] Error 1

As Google mentioned Somtimes It's the Compiler and Sometimes It's the Kernel I argue that the inline asm bug can be fixed both in the Kernel side and Compiler side. I will try to fix it in the Kernel side, please give me some suggestion, thanks a lot!

Regards, Leslie Zhai

FlyGoat commented 6 years ago

I'm unfamiliar with clang... So what are inline asm input types that clang actual supports? I doubt if clang doesn't support 'unsigned long', there is nothing to replace it. What we need is a unsigned type which fits register length.

xiangzhai commented 6 years ago

Hi @FlyGoat

Thanks for your response!

As Google mentioned Somtimes It's the Compiler and Sometimes It's the Kernel I argue that the inline asm bug can be fixed both in the Kernel side and Compiler side.

So it is better to fix the issue in the Compiler side? I will try it :)

Regards, Leslie Zhai

xiangzhai commented 6 years ago

So it is better to fix the issue in the Compiler side? I will try it :)

Please follow PR38128.