• Nathan Chancellor's avatar
    kbuild: Add -Werror=unknown-warning-option to CLANG_FLAGS · 7caebf6d
    Nathan Chancellor authored
    [ Upstream commit 589834b3 ]
    
    In commit ebcc5928 ("arm64: Silence gcc warnings about arch ABI
    drift"), the arm64 Makefile added -Wno-psabi to KBUILD_CFLAGS, which is
    a GCC only option so clang rightfully complains:
    
    warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
    
    https://clang.llvm.org/docs/DiagnosticsReference.html#wunknown-warning-option
    
    However, by default, this is merely a warning so the build happily goes
    on with a slew of these warnings in the process.
    
    Commit c3f0d0bc ("kbuild, LLVMLinux: Add -Werror to cc-option to
    support clang") worked around this behavior in cc-option by adding
    -Werror so that unknown flags cause an error. However, this all happens
    silently and when an unknown flag is added to the build unconditionally
    like -Wno-psabi, cc-option will always fail because there is always an
    unknown flag in the list of flags. This manifested as link time failures
    in the arm64...
    7caebf6d
Makefile 59.2 KB