• Stephen Boyd's avatar
    kbuild: Check for unknown options with cc-option usage in Kconfig and clang · e8de12fb
    Stephen Boyd authored
    If the particular version of clang a user has doesn't enable
    -Werror=unknown-warning-option by default, even though it is the
    default[1], then make sure to pass the option to the Kconfig cc-option
    command so that testing options from Kconfig files works properly.
    Otherwise, depending on the default values setup in the clang toolchain
    we will silently assume options such as -Wmaybe-uninitialized are
    supported by clang, when they really aren't.
    
    A compilation issue only started happening for me once commit
    589834b3 ("kbuild: Add -Werror=unknown-warning-option to
    CLANG_FLAGS") was applied on top of commit b303c6df ("kbuild:
    compute false-positive -Wmaybe-uninitialized cases in Kconfig"). This
    leads kbuild to try and test for the existence of the
    -Wmaybe-uninitialized flag with the cc-option command in
    scripts/Kconfig.include, and it doesn't see an error returned from the
    option test so it sets the config value to Y. Then the ...
    e8de12fb
Kconfig.include 1.15 KB