https://bugs.llvm.org/show_bug.cgi?id=44853

            Bug ID: 44853
           Summary: -mno-save-restore spams a RISCV Linux kernel build
           Product: clang
           Version: trunk
          Hardware: Other
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Driver
          Assignee: unassignedclangb...@nondot.org
          Reporter: natechancel...@gmail.com
                CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
                    richard-l...@metafoo.co.uk

When building the Linux kernel for RISCV, there is a bunch of warning spam
around -mno-save-restore, which is explicitly specified in arch/riscv/Makefile.

$ make -j$(nproc) -s ARCH=riscv CC=clang-11 CROSS_COMPILE=riscv64-linux-gnu-
O=out.riscv distclean defconfig all
...
'-save-restore' is not a recognized feature for this target (ignoring feature)  
'-save-restore' is not a recognized feature for this target (ignoring feature)  
'-save-restore' is not a recognized feature for this target (ignoring feature)
'-save-restore' is not a recognized feature for this target (ignoring feature)
...

I assume this warning is coming from the backend since -msave-restore warns
from clang.

$ echo | clang-11 --target=riscv64-linux-gnu -msave-restore -c -x c -o
/dev/null -
clang: warning: the clang compiler does not support '-msave-restore'
'+save-restore' is not a recognized feature for this target (ignoring feature)
$ echo | clang-11 --target=riscv64-linux-gnu -mno-save-restore -c -x c -o
/dev/null -
'-save-restore' is not a recognized feature for this target (ignoring feature)

This warning happens on every translation unit so it is very noisy. We could
silence it by just not passing -mno-save-restore when building with clang but
that seems fragile in case -msave-restore ever became default. We’ll do
whatever you feel is best though.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to