From: Fangrui Song <maskray@google.com>
To: Nathan Chancellor <natechancellor@gmail.com>,
Nick Desaulniers <ndesaulniers@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Kees Cook <keescook@chromium.org>,
Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
Sedat Dilek <sedat.dilek@gmail.com>,
Marco Elver <elver@google.com>,
Andrey Konovalov <andreyknvl@google.com>,
Masahiro Yamada <masahiroy@kernel.org>,
clang-built-linux@googlegroups.com,
Daniel Borkmann <daniel@iogearbox.net>,
Alexei Starovoitov <ast@kernel.org>,
Will Deacon <will@kernel.org>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/7] Revert "kbuild: disable clang's default use of -fmerge-all-constants"
Date: Tue, 1 Sep 2020 09:55:58 -0700 [thread overview]
Message-ID: <20200901165558.sgzbui6khedvwy3o@google.com> (raw)
In-Reply-To: <20200901045516.GA1561318@ubuntu-n2-xlarge-x86>
On 2020-08-31, Nathan Chancellor wrote:
>On Mon, Aug 31, 2020 at 05:23:21PM -0700, Nick Desaulniers wrote:
>> This reverts commit 87e0d4f0f37fb0c8c4aeeac46fff5e957738df79.
>>
>> This was fixed in clang-6; the minimum supported version of clang in the
>> kernel is clang-10 (10.0.1).
>>
>> Link: https://reviews.llvm.org/rL329300.
>> Link: https://github.com/ClangBuiltLinux/linux/issues/9
>> Suggested-by: Nathan Chancellor <natechancellor@gmail.com>
>> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
>
>Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
How about expanding "This was fixed in clang-6" to be
-fno-merge-all-constants has been the default since clang-6?
(Both gcc|clang -fmerge-all-constants can cause an assertion failure for
the example on https://bugs.llvm.org/show_bug.cgi?id=18538 )
Reviewed-by: Fangrui Song <maskray@google.com>
>> ---
>> Makefile | 9 ---------
>> 1 file changed, 9 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 37739ee53f27..144ac6a073ff 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -932,15 +932,6 @@ KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized)
>> # disable invalid "can't wrap" optimizations for signed / pointers
>> KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
>>
>> -# clang sets -fmerge-all-constants by default as optimization, but this
>> -# is non-conforming behavior for C and in fact breaks the kernel, so we
>> -# need to disable it here generally.
>> -KBUILD_CFLAGS += $(call cc-option,-fno-merge-all-constants)
>> -
>> -# for gcc -fno-merge-all-constants disables everything, but it is fine
>> -# to have actual conforming behavior enabled.
>> -KBUILD_CFLAGS += $(call cc-option,-fmerge-constants)
>> -
>> # Make sure -fstack-check isn't enabled (like gentoo apparently did)
>> KBUILD_CFLAGS += $(call cc-option,-fno-stack-check,)
>>
>> --
>> 2.28.0.402.g5ffc5be6b7-goog
>>
>
>--
>You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
>To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20200901045516.GA1561318%40ubuntu-n2-xlarge-x86.
next prev parent reply other threads:[~2020-09-01 16:56 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-01 0:23 [PATCH v2 0/7] set clang minimum version to 10.0.1 Nick Desaulniers
2020-09-01 0:23 ` [PATCH v2 1/7] compiler-clang: add build check for clang 10.0.1 Nick Desaulniers
2020-09-01 13:51 ` Sedat Dilek
2020-09-01 0:23 ` [PATCH v2 2/7] Revert "kbuild: disable clang's default use of -fmerge-all-constants" Nick Desaulniers
2020-09-01 4:55 ` Nathan Chancellor
2020-09-01 16:55 ` Fangrui Song [this message]
2020-09-01 17:36 ` Sedat Dilek
2020-09-01 0:23 ` [PATCH v2 3/7] Revert "arm64: bti: Require clang >= 10.0.1 for in-kernel BTI support" Nick Desaulniers
2020-09-01 4:55 ` Nathan Chancellor
2020-09-01 0:23 ` [PATCH v2 4/7] Revert "arm64: vdso: Fix compilation with clang older than 8" Nick Desaulniers
2020-09-01 4:56 ` Nathan Chancellor
2020-09-01 0:23 ` [PATCH v2 5/7] Partial revert "ARM: 8905/1: Emit __gnu_mcount_nc when using Clang 10.0.0 or newer" Nick Desaulniers
2020-09-01 4:57 ` Nathan Chancellor
2020-09-01 0:23 ` [PATCH v2 6/7] kasan: Remove mentions of unsupported Clang versions Nick Desaulniers
2020-09-01 4:57 ` Nathan Chancellor
2020-09-01 0:23 ` [PATCH v2 7/7] compiler-gcc: improve version error Nick Desaulniers
2020-09-01 5:00 ` Nathan Chancellor
2020-09-01 8:12 ` Miguel Ojeda
2020-09-01 13:55 ` [PATCH v2 0/7] set clang minimum version to 10.0.1 Sedat Dilek
2020-09-01 20:01 ` Kees Cook
2020-09-02 19:28 ` Nick Desaulniers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200901165558.sgzbui6khedvwy3o@google.com \
--to=maskray@google.com \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@google.com \
--cc=ast@kernel.org \
--cc=clang-built-linux@googlegroups.com \
--cc=daniel@iogearbox.net \
--cc=elver@google.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=natechancellor@gmail.com \
--cc=ndesaulniers@google.com \
--cc=sedat.dilek@gmail.com \
--cc=vincenzo.frascino@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®