Re: [PATCH v9] pgo: add clang's Profile Guided Optimization infrastructure

2021-04-07 Thread Fāng-ruì Sòng
On Wed, Apr 7, 2021 at 2:22 PM Kees Cook wrote: > > On Wed, Apr 07, 2021 at 02:17:04PM -0700, 'Bill Wendling' via Clang Built > Linux wrote: > > From: Sami Tolvanen > > > > Enable the use of clang's Profile-Guided Optimization[1]. To generate a > > profile, the kernel is instrumented with PGO

Re: [PATCH] Replace __toc_start + 0x8000 with .TOC.

2021-03-06 Thread Fāng-ruì Sòng
On Sat, Mar 6, 2021 at 10:25 PM Segher Boessenkool wrote: > > Hi! > > On Sat, Mar 06, 2021 at 09:14:33PM -0800, Fangrui Song wrote: > > TOC relocations are like GOT relocations on other architectures. > > However, unlike other architectures, GNU ld's ppc64 port defines .TOC. > > relative to the

Re: [PATCH 1/2] Makefile: Remove '--gcc-toolchain' flag

2021-03-04 Thread Fāng-ruì Sòng
On Wed, Mar 3, 2021 at 3:07 PM Fangrui Song wrote: > > > On 2021-03-03, Masahiro Yamada wrote: > >Hi. > > > >On Wed, Mar 3, 2021 at 6:44 AM Fangrui Song wrote: > >> > >> Reviewed-by: Fangrui Song > >> > >> Thanks for the clean-up! > >> --gcc-toolchain= is an obsscure way searching for GCC

Re: ERROR: INT DW_ATE_unsigned_1 Error emitting BTF type

2021-02-05 Thread Fāng-ruì Sòng
On Fri, Feb 5, 2021 at 11:21 AM Sedat Dilek wrote: > > On Fri, Feb 5, 2021 at 8:15 PM Sedat Dilek wrote: > > > > On Fri, Feb 5, 2021 at 8:10 PM Yonghong Song wrote: > > > > > > > > > > > > On 2/5/21 11:06 AM, Sedat Dilek wrote: > > > > On Fri, Feb 5, 2021 at 7:53 PM Sedat Dilek > > > > wrote:

Re: [PATCH v7 2/2] Kbuild: implement support for DWARF v5

2021-01-30 Thread Fāng-ruì Sòng
On Sat, Jan 30, 2021 at 3:10 PM Sedat Dilek wrote: > > On Sat, Jan 30, 2021 at 1:44 AM Nick Desaulniers > wrote: > > > > DWARF v5 is the latest standard of the DWARF debug info format. > > > > Feature detection of DWARF5 is onerous, especially given that we've > > removed $(AS), so we must query

Re: [PATCH v6 0/2] Kbuild: DWARF v5 support

2021-01-29 Thread Fāng-ruì Sòng
On Fri, Jan 29, 2021 at 4:46 PM 'Nick Desaulniers' via Clang Built Linux wrote: > > On Fri, Jan 29, 2021 at 4:08 PM Sedat Dilek wrote: > > > > On Fri, Jan 29, 2021 at 8:43 PM Nick Desaulniers > > wrote: > > > > > > DWARF v5 is the latest standard of the DWARF debug info format. > > > > > >

Re: [PATCH] checkpatch: add warning for avoiding .L prefix symbols in assembly files

2021-01-22 Thread Fāng-ruì Sòng
On Fri, Jan 22, 2021 at 12:13 PM Aditya wrote: > > On 23/1/21 12:40 am, Joe Perches wrote: > > On Fri, 2021-01-22 at 18:48 +0530, Aditya wrote: > >> On 21/1/21 12:13 am, Joe Perches wrote: > >>> I believe the test should be: > >>> > >>> if ($realfile =~ /\.S$/ && > >>> $line =~ > >>>

Re: [PATCH v3] x86: Treat R_386_PLT32 as R_386_PC32

2021-01-22 Thread Fāng-ruì Sòng
On Thu, Jan 14, 2021 at 2:48 PM Fangrui Song wrote: > > This is similar to commit b21ebf2fb4cd ("x86: Treat R_X86_64_PLT32 as > R_X86_64_PC32"), but for i386. As far as Linux kernel is concerned, > R_386_PLT32 can be treated the same as R_386_PC32. > > R_386_PC32/R_X86_64_PC32 are PC-relative

Re: [PATCH v2] module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for undefined symbols

2021-01-15 Thread Fāng-ruì Sòng
On Thu, Jan 14, 2021 at 11:04 PM Marco Elver wrote: > > On Thu, 14 Jan 2021 at 22:54, Fangrui Song wrote: > > clang-12 -fno-pic (since > > https://github.com/llvm/llvm-project/commit/a084c0388e2a59b9556f2de008232da3f1d6) > > can emit `call __stack_chk_fail@PLT` instead of `call

Re: [PATCH] module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for undefined symbols

2021-01-14 Thread Fāng-ruì Sòng
On Thu, Jan 14, 2021 at 6:06 AM Jessica Yu wrote: > > +++ Fangrui Song [13/01/21 21:48 -0800]: > >clang-12 -fno-pic (since > >https://github.com/llvm/llvm-project/commit/a084c0388e2a59b9556f2de008232da3f1d6) > >can emit `call __stack_chk_fail@PLT` instead of `call __stack_chk_fail` > >on x86.

Re: [PATCH v2] pgo: add clang's Profile Guided Optimization infrastructure

2021-01-12 Thread Fāng-ruì Sòng
On Tue, Jan 12, 2021 at 9:37 AM 'Nick Desaulniers' via Clang Built Linux wrote: > > On Mon, Jan 11, 2021 at 9:14 PM Bill Wendling wrote: > > > > From: Sami Tolvanen > > > > Enable the use of clang's Profile-Guided Optimization[1]. To generate a > > profile, the kernel is instrumented with PGO

Re: [PATCH] pgo: add clang's Profile Guided Optimization infrastructure

2021-01-11 Thread Fāng-ruì Sòng
On Mon, Jan 11, 2021 at 4:38 PM Bill Wendling wrote: > > On Mon, Jan 11, 2021 at 12:31 PM Fangrui Song wrote: > > On 2021-01-11, Bill Wendling wrote: > > >On Mon, Jan 11, 2021 at 12:12 PM Fangrui Song wrote: > > >> > > >> On 2021-01-11, 'Bill Wendling' via Clang Built Linux wrote: > > >> >From:

Re: [PATCH v3] x86/entry: emit a symbol for register restoring thunk

2021-01-11 Thread Fāng-ruì Sòng
On Mon, Jan 11, 2021 at 4:38 PM Borislav Petkov wrote: > > On Mon, Jan 11, 2021 at 12:38:06PM -0800, Nick Desaulniers wrote: > > Arnd found a randconfig that produces the warning: > > > > arch/x86/entry/thunk_64.o: warning: objtool: missing symbol for insn at > > offset 0x3e > > > > when building

Re: [PATCH v3] x86/entry: emit a symbol for register restoring thunk

2021-01-11 Thread Fāng-ruì Sòng
On Mon, Jan 11, 2021 at 2:09 PM Josh Poimboeuf wrote: > > On Mon, Jan 11, 2021 at 12:58:14PM -0800, Fangrui Song wrote: > > On 2021-01-11, Nick Desaulniers wrote: > > > Arnd found a randconfig that produces the warning: > > > > > > arch/x86/entry/thunk_64.o: warning: objtool: missing symbol for

Re: [PATCH v2 mips-next 2/4] MIPS: vmlinux.lds.S: add ".gnu.attributes" to DISCARDS

2021-01-06 Thread Fāng-ruì Sòng
On Wed, Jan 6, 2021 at 2:07 PM Kees Cook wrote: > > On Wed, Jan 06, 2021 at 08:08:19PM +, Alexander Lobakin wrote: > > Discard GNU attributes at link time as kernel doesn't use it at all. > > Solves a dozen of the following ld warnings (one per every file): > > > > mips-alpine-linux-musl-ld:

Re: [PATCH v2 mips-next 3/4] MIPS: vmlinux.lds.S: catch bad .got, .plt and .rel.dyn at link time

2021-01-06 Thread Fāng-ruì Sòng
On Wed, Jan 6, 2021 at 12:08 PM Alexander Lobakin wrote: > > Catch any symbols placed in .got, .got.plt, .plt, .rel.dyn > or .rela.dyn and check for these sections to be zero-sized > at link time. > > At least two of them were noticed in real builds: > > mips-alpine-linux-musl-ld: warning: orphan

Re: [PATCH mips-next 2/4] MIPS: vmlinux.lds.S: add ".rel.dyn" to DISCARDS

2021-01-04 Thread Fāng-ruì Sòng
On Mon, Jan 4, 2021 at 4:21 AM Alexander Lobakin wrote: > > GCC somehow manages to place some of the symbols from main.c into > .rel.dyn section: > > mips-alpine-linux-musl-ld: warning: orphan section `.rel.dyn' > from `init/main.o' being placed in section `.rel.dyn' > > I couldn't catch up the

Re: [PATCH v8 00/16] Add support for Clang LTO

2020-12-08 Thread Fāng-ruì Sòng
On Tue, Dec 8, 2020 at 1:02 PM Arnd Bergmann wrote: > > On Tue, Dec 8, 2020 at 9:59 PM Arnd Bergmann wrote: > > > > Attaching the config for "ld.lld: error: Never resolved function from > > blockaddress (Producer: 'LLVM12.0.0' Reader: 'LLVM 12.0.0')" > > And here is a new one: "ld.lld: error:

Re: [PATCH v2 3/4] Kbuild: make DWARF version a choice

2020-12-01 Thread Fāng-ruì Sòng
On 2020-12-01, Segher Boessenkool wrote: On Tue, Dec 01, 2020 at 12:38:16PM +0900, Masahiro Yamada wrote: > We can bump -Wa,-gdwarf-2 to -Wa,-gdwarf-3 since GNU actually emits > DWARF v3 DW_AT_ranges (see > https://sourceware.org/bugzilla/show_bug.cgi?id=26850 ) > This can avoid the `warning:

Re: [PATCH v2 3/4] Kbuild: make DWARF version a choice

2020-11-30 Thread Fāng-ruì Sòng
On Mon, Nov 30, 2020 at 10:05 AM Masahiro Yamada wrote: > > On Wed, Nov 4, 2020 at 9:53 AM 'Nick Desaulniers' via Clang Built > Linux wrote: > > > > Modifies CONFIG_DEBUG_INFO_DWARF4 to be a member of a choice. Adds an > > explicit CONFIG_DEBUG_INFO_DWARF2, which is the default. Does so in a > >

Re: [PATCH v15 01/26] Documentation/x86: Add CET description

2020-11-30 Thread Fāng-ruì Sòng
On Mon, Nov 30, 2020 at 10:34 AM Yu, Yu-cheng wrote: > > On 11/30/2020 10:26 AM, Nick Desaulniers wrote: > > (In response to > > https://lore.kernel.org/lkml/20201110162211.9207-2-yu-cheng...@intel.com/) > > > >> These need to be enabled to build a CET-enabled kernel, and Binutils v2.31 > >> and

Re: Error: invalid switch -me200

2020-11-13 Thread Fāng-ruì Sòng
On Fri, Nov 13, 2020 at 4:23 PM Segher Boessenkool wrote: > > On Fri, Nov 13, 2020 at 12:14:18PM -0800, Nick Desaulniers wrote: > > > > > Error: invalid switch -me200 > > > > > Error: unrecognized option -me200 > > > > > > > > 251 cpu-as-$(CONFIG_E200) += -Wa,-me200 > > > > > > > > Are those

Re: Error: invalid switch -me200

2020-11-13 Thread Fāng-ruì Sòng
On Thu, Nov 12, 2020 at 7:22 PM kernel test robot wrote: > > Hi Fangrui, > > FYI, the error/warning still remains. > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > master > head: 585e5b17b92dead8a3aca4e3c9876fbca5f7e0ba > commit:

Re: [PATCH v2] vmlinux.lds.h: Keep .ctors.* with .ctors

2020-10-21 Thread Fāng-ruì Sòng
On Wed, Oct 21, 2020 at 1:09 PM Kees Cook wrote: > > On Wed, Oct 14, 2020 at 09:53:39PM -0700, Fāng-ruì Sòng wrote: > > On Wed, Oct 14, 2020 at 4:04 PM Kees Cook wrote: > > > > index 5430febd34be..b83c00c63997 100644 > > > > --- a/include/asm-generic/vml

Re: [PATCH v2] vmlinux.lds.h: Keep .ctors.* with .ctors

2020-10-14 Thread Fāng-ruì Sòng
On Wed, Oct 14, 2020 at 4:04 PM Kees Cook wrote: > > On Sun, Oct 04, 2020 at 07:57:20PM -0700, Kees Cook wrote: > > Under some circumstances, the compiler generates .ctors.* sections. This > > is seen doing a cross compile of x86_64 from a powerpc64el host: > > > > x86_64-linux-gnu-ld: warning:

Re: [PATCH] arm/build: Always handle .ARM.exidx and .ARM.extab sections

2020-10-12 Thread Fāng-ruì Sòng
On Mon, Oct 12, 2020 at 2:11 PM 'Nick Desaulniers' via Clang Built Linux wrote: > > On Mon, Sep 28, 2020 at 3:49 PM Nathan Chancellor > wrote: > > > > After turning on warnings for orphan section placement, enabling > > CONFIG_UNWINDER_FRAME_POINTER instead of CONFIG_UNWINDER_ARM causes > >

Re: [PATCH v5 13/36] vmlinux.lds.h: add PGO and AutoFDO input sections

2020-08-03 Thread Fāng-ruì Sòng
On 2020-08-03, Andi Kleen wrote: Why is that? Both .text and .text.hot have alignment of 2^4 (default function alignment on x86) by default, so it doesn't seem like it should matter for packing density. Avoiding interspersing cold text among You may lose part of a cache line on each unit

Re: [PATCH v5 13/36] vmlinux.lds.h: add PGO and AutoFDO input sections

2020-08-03 Thread Fāng-ruì Sòng
On 2020-08-03, Arvind Sankar wrote: On Mon, Aug 03, 2020 at 12:05:06PM -0700, Andi Kleen wrote: > However, the history of their being together comes from > > 9bebe9e5b0f3 ("kbuild: Fix .text.unlikely placement") > > which seems to indicate there was some problem with having them separated

Re: [PATCH] vmlinux.lds: consider .text.{hot|unlikely}.* part of .text too

2020-06-22 Thread Fāng-ruì Sòng
On 2020-06-22, Nick Desaulniers wrote: On Wed, Jun 17, 2020 at 2:27 PM Fāng-ruì Sòng wrote: On 2020-06-17, Nick Desaulniers wrote: >ld.bfd's internal linker script considers .text.hot AND .text.hot.* to >be part of .text, as well as .text.unlikely and .text.unlikely.*. >ld.lld wil

Re: [PATCH v2 1/3] vmlinux.lds.h: Add .gnu.version* to DISCARDS

2020-06-22 Thread Fāng-ruì Sòng
On Mon, Jun 22, 2020 at 3:57 PM Kees Cook wrote: > > On Mon, Jun 22, 2020 at 03:52:37PM -0700, Fangrui Song wrote: > > > And it's not in the output: > > > > > > $ readelf -Vs arch/x86/boot/compressed/vmlinux | grep version > > > No version information found in this file. > > > > > > So... for the

Re: [PATCH] vmlinux.lds: consider .text.{hot|unlikely}.* part of .text too

2020-06-17 Thread Fāng-ruì Sòng
-gdb.git;a=commitdiff;h=1de778ed23ce7492c523d5850c6c6dbb34152655 Link: https://reviews.llvm.org/D79600 Reported-by: Jian Cai Debugged-by: Luis Lozano Suggested-by: Fāng-ruì Sòng Tested-by: Luis Lozano Tested-by: Manoj Gupta Signed-off-by: Nick Desaulniers --- include/asm-generic/vmlinux.lds.h | 4