lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190607162400.GI28398@e103592.cambridge.arm.com>
Date:   Fri, 7 Jun 2019 17:24:00 +0100
From:   Dave Martin <Dave.Martin@....com>
To:     Nathan Chancellor <natechancellor@...il.com>
Cc:     Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will.deacon@....com>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        linux-kernel@...r.kernel.org, clang-built-linux@...glegroups.com,
        Qian Cai <cai@....pw>, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] arm64: Don't unconditionally add -Wno-psabi to
 KBUILD_CFLAGS

On Fri, Jun 07, 2019 at 09:12:01AM -0700, Nathan Chancellor wrote:
> This is a GCC only option, which warns about ABI changes within GCC, so
> unconditionally adding breaks Clang with tons of:
> 
> warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
> 
> and link time failures:
> 
> ld.lld: error: undefined symbol: __efistub___stack_chk_guard
> >>> referenced by arm-stub.c:73
> (/home/nathan/cbl/linux/drivers/firmware/efi/libstub/arm-stub.c:73)
> >>>               arm-stub.stub.o:(__efistub_install_memreserve_table)
> in archive ./drivers/firmware/efi/libstub/lib.a
> 
> I suspect the link time failure comes from some flags not being added
> via cc-option, which will always fail when an unknown flag is
> unconditionally added to KBUILD_CFLAGS because -Werror is added after
> commit c3f0d0bc5b01 ("kbuild, LLVMLinux: Add -Werror to cc-option to
> support clang").
> 
> $ echo "int main() { return 0; }" | clang -Wno-psabi -o /dev/null -x c -
> warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
> 1 warning generated.
> 
> $ echo $?
> 0
> 
> $ echo "int main() { return 0; }" | clang -Werror -Wno-psabi -o /dev/null -x c -
> error: unknown warning option '-Wno-psabi' [-Werror,-Wunknown-warning-option]
> 
> $ echo $?
> 1
> 
> This side effect is user visible (aside from the inordinate amount of
> -Wunknown-warning-option and build failure), as some warnings that are
> normally disabled like -Waddress-of-packed-member or
> -Wunused-const-variable show up.
> 
> Use cc-disable-warning so that it gets disabled for GCC and does nothing
> for Clang.
> 
> Fixes: ebcc5928c5d9 ("arm64: Silence gcc warnings about arch ABI drift")
> Link: https://github.com/ClangBuiltLinux/linux/issues/511
> Reported-by: Qian Cai <cai@....pw>
> Signed-off-by: Nathan Chancellor <natechancellor@...il.com>

FWIW,
Acked-by: Dave Martin <Dave.Martin@....com>

Cheers
---Dave

> ---
>  arch/arm64/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> index 8fbd583b18e1..e9d2e578cbe6 100644
> --- a/arch/arm64/Makefile
> +++ b/arch/arm64/Makefile
> @@ -51,7 +51,7 @@ endif
>  
>  KBUILD_CFLAGS	+= -mgeneral-regs-only $(lseinstr) $(brokengasinst)
>  KBUILD_CFLAGS	+= -fno-asynchronous-unwind-tables
> -KBUILD_CFLAGS	+= -Wno-psabi
> +KBUILD_CFLAGS	+= $(call cc-disable-warning, psabi)
>  KBUILD_AFLAGS	+= $(lseinstr) $(brokengasinst)
>  
>  KBUILD_CFLAGS	+= $(call cc-option,-mabi=lp64)
> -- 
> 2.22.0.rc3
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ