All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Nathan Lynch <nathanl@linux.ibm.com>,
	Fabiano Rosas <farosas@linux.ibm.com>,
	llvm@lists.linux.dev, Nicholas Piggin <npiggin@gmail.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Joel Stanley <joel@jms.id.au>,
	"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>,
	linuxppc-dev@lists.ozlabs.org, Daniel Axtens <dja@axtens.net>
Subject: Re: [PATCH kernel 2/3] powerpc/llvm: Sample config for LLVM LTO
Date: Wed, 16 Feb 2022 12:28:47 +1100	[thread overview]
Message-ID: <535eefe8-c332-4c66-30d0-c792911ee4d5@ozlabs.ru> (raw)
In-Reply-To: <CAKwvOdmJspxuNh-K-CeLJh4X4GGVYJWH29HnjJwuRL+jcN9G5w@mail.gmail.com>



On 2/12/22 11:05, Nick Desaulniers wrote:
> On Thu, Feb 10, 2022 at 6:31 PM Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
>>
>> The config is a copy of ppc64_defconfig with a few tweaks. This could be
>> a smaller config to merge into ppc64_defconfig but unfortunately
>> merger does not allow disabling already enabled options.
> 
> Cool series!
> 
>>
>> This is a command line to compile the kernel using the upstream llvm:
>>
>> make -j64 O=/home/aik/pbuild/kernels-llvm/ \
>>   "KCFLAGS=-Wmissing-braces -Wno-array-bounds" \
>>   ARCH=powerpc LLVM_IAS=1 ppc64le_lto_defconfig CC=clang LLVM=1
> 
> That command line invocation is kind of a mess, and many things
> shouldn't be necessary.
> 
> O= is just noise; if folks are doing in tree builds then that doesn't
> add anything meaningful.
> KCFLAGS= why? I know -Warray-bounds is being worked on actively, but
> do we have instances of -Wmissing-braces at the moment? Let's get
> those fixed up.
> LLVM_IAS=1 is implied by LLVM=1.
> CC=clang is implied by LLVM=1
> 
> why add a new config? I think it would be simpler to just show command
> line invocations of `./scripts/config -e` and `make`. No new config
> required.



I should have added "RFC" in this one as the purpose of the patch is to 
show what works right now and not for actual submission.


>>
>> Forces CONFIG_BTRFS_FS=y to make CONFIG_ZSTD_COMPRESS=y to fix:
>> ld.lld: error: linking module flags 'Code Model': IDs have conflicting values in 'lib/built-in.a(entropy_common.o at 5332)' and 'ld-temp.o'
>>
>> because modules are linked with -mcmodel=large but the kernel uses -mcmodel=medium
> 
> Please file a bug about this.
> https://github.com/ClangBuiltLinux/linux/issues
> 
>>
>> Enables CONFIG_USERFAULTFD=y as otherwise vm_userfaultfd_ctx becomes
>> 0 bytes long and clang sanitizer crashes as
>> https://bugs.llvm.org/show_bug.cgi?id=500375

> 
> The above hyperlink doesn't work for me. Upstream llvm just moved from
> bugzilla to github issue tracker.


aah this is the correct one:
https://bugs.llvm.org/show_bug.cgi?id=50037

> 
> https://github.com/llvm/llvm-project/issues

oh ok.

>>
>> Disables CONFIG_FTR_FIXUP_SELFTEST as it uses FTR_SECTION_ELSE with
>> conditional branches. There are other places like this and the following
>> patches address that.
>>
>> Disables CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT as CONFIG_HAS_LTO_CLANG
>> depends on it being disabled. In order to avoid disabling way too many
>> options (like DYNAMIC_FTRACE/FUNCTION_TRACER), this converts
>> FTRACE_MCOUNT_USE_RECORDMCOUNT from def_bool to bool.
>>
>> Note that even with this config there is a good chance that LTO
>> is going to fail linking vmlinux because of the "bc" problem.
> 
> I think rather than adding a new config with LTO enabled and a few
> things turned off, it would be better to not allow LTO to be
> selectable if those things are turned on, until the combination of the
> two are fixed.

Well, if I want people to try this thing, I kinda need to provide an 
easy way to allow LTO. The new config seemed the easiest (== the 
shortest) :)

WARNING: multiple messages have this Message-ID (diff)
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: llvm@lists.linux.dev, linuxppc-dev@lists.ozlabs.org,
	Nicholas Piggin <npiggin@gmail.com>,
	Nathan Lynch <nathanl@linux.ibm.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Joel Stanley <joel@jms.id.au>,
	Fabiano Rosas <farosas@linux.ibm.com>,
	Daniel Axtens <dja@axtens.net>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Subject: Re: [PATCH kernel 2/3] powerpc/llvm: Sample config for LLVM LTO
Date: Wed, 16 Feb 2022 12:28:47 +1100	[thread overview]
Message-ID: <535eefe8-c332-4c66-30d0-c792911ee4d5@ozlabs.ru> (raw)
In-Reply-To: <CAKwvOdmJspxuNh-K-CeLJh4X4GGVYJWH29HnjJwuRL+jcN9G5w@mail.gmail.com>



On 2/12/22 11:05, Nick Desaulniers wrote:
> On Thu, Feb 10, 2022 at 6:31 PM Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
>>
>> The config is a copy of ppc64_defconfig with a few tweaks. This could be
>> a smaller config to merge into ppc64_defconfig but unfortunately
>> merger does not allow disabling already enabled options.
> 
> Cool series!
> 
>>
>> This is a command line to compile the kernel using the upstream llvm:
>>
>> make -j64 O=/home/aik/pbuild/kernels-llvm/ \
>>   "KCFLAGS=-Wmissing-braces -Wno-array-bounds" \
>>   ARCH=powerpc LLVM_IAS=1 ppc64le_lto_defconfig CC=clang LLVM=1
> 
> That command line invocation is kind of a mess, and many things
> shouldn't be necessary.
> 
> O= is just noise; if folks are doing in tree builds then that doesn't
> add anything meaningful.
> KCFLAGS= why? I know -Warray-bounds is being worked on actively, but
> do we have instances of -Wmissing-braces at the moment? Let's get
> those fixed up.
> LLVM_IAS=1 is implied by LLVM=1.
> CC=clang is implied by LLVM=1
> 
> why add a new config? I think it would be simpler to just show command
> line invocations of `./scripts/config -e` and `make`. No new config
> required.



I should have added "RFC" in this one as the purpose of the patch is to 
show what works right now and not for actual submission.


>>
>> Forces CONFIG_BTRFS_FS=y to make CONFIG_ZSTD_COMPRESS=y to fix:
>> ld.lld: error: linking module flags 'Code Model': IDs have conflicting values in 'lib/built-in.a(entropy_common.o at 5332)' and 'ld-temp.o'
>>
>> because modules are linked with -mcmodel=large but the kernel uses -mcmodel=medium
> 
> Please file a bug about this.
> https://github.com/ClangBuiltLinux/linux/issues
> 
>>
>> Enables CONFIG_USERFAULTFD=y as otherwise vm_userfaultfd_ctx becomes
>> 0 bytes long and clang sanitizer crashes as
>> https://bugs.llvm.org/show_bug.cgi?id=500375

> 
> The above hyperlink doesn't work for me. Upstream llvm just moved from
> bugzilla to github issue tracker.


aah this is the correct one:
https://bugs.llvm.org/show_bug.cgi?id=50037

> 
> https://github.com/llvm/llvm-project/issues

oh ok.

>>
>> Disables CONFIG_FTR_FIXUP_SELFTEST as it uses FTR_SECTION_ELSE with
>> conditional branches. There are other places like this and the following
>> patches address that.
>>
>> Disables CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT as CONFIG_HAS_LTO_CLANG
>> depends on it being disabled. In order to avoid disabling way too many
>> options (like DYNAMIC_FTRACE/FUNCTION_TRACER), this converts
>> FTRACE_MCOUNT_USE_RECORDMCOUNT from def_bool to bool.
>>
>> Note that even with this config there is a good chance that LTO
>> is going to fail linking vmlinux because of the "bc" problem.
> 
> I think rather than adding a new config with LTO enabled and a few
> things turned off, it would be better to not allow LTO to be
> selectable if those things are turned on, until the combination of the
> two are fixed.

Well, if I want people to try this thing, I kinda need to provide an 
easy way to allow LTO. The new config seemed the easiest (== the 
shortest) :)

  reply	other threads:[~2022-02-16  1:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11  2:31 [PATCH kernel 0/3] powerpc/llvm/lto: Enable CONFIG_LTO_CLANG_THIN=y Alexey Kardashevskiy
2022-02-11  2:31 ` Alexey Kardashevskiy
2022-02-11  2:31 ` [PATCH kernel 1/3] powerpc/64: Allow LLVM LTO builds Alexey Kardashevskiy
2022-02-11  2:31   ` Alexey Kardashevskiy
2022-02-11  2:31 ` [PATCH kernel 2/3] powerpc/llvm: Sample config for LLVM LTO Alexey Kardashevskiy
2022-02-11  2:31   ` Alexey Kardashevskiy
2022-02-11 11:44   ` Naveen N. Rao
2022-02-11 11:44     ` Naveen N. Rao
2022-02-12  0:05   ` Nick Desaulniers
2022-02-12  0:05     ` Nick Desaulniers
2022-02-16  1:28     ` Alexey Kardashevskiy [this message]
2022-02-16  1:28       ` Alexey Kardashevskiy
2022-02-11  2:31 ` [PATCH kernel 3/3] powerpc/llvm/lto: Workaround conditional branches in FTR_SECTION_ELSE Alexey Kardashevskiy
2022-02-11  2:31   ` Alexey Kardashevskiy
2022-02-11  6:44   ` Russell Currey

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=535eefe8-c332-4c66-30d0-c792911ee4d5@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=dja@axtens.net \
    --cc=farosas@linux.ibm.com \
    --cc=joel@jms.id.au \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=nathanl@linux.ibm.com \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=ndesaulniers@google.com \
    --cc=npiggin@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.