stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/4] x86_64: Change .weak to SYM_FUNC_START_WEAK for arch/x86/lib/mem*_64.S
       [not found] ` <20201104005343.4192504-1-ndesaulniers@google.com>
@ 2020-11-04  0:53   ` Nick Desaulniers
  2020-11-04  0:53   ` [PATCH v2 2/4] Kbuild: do not emit debug info for assembly with LLVM_IAS=1 Nick Desaulniers
  1 sibling, 0 replies; 9+ messages in thread
From: Nick Desaulniers @ 2020-11-04  0:53 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Jakub Jelinek, Linux Kbuild mailing list,
	Linux Kernel Mailing List, linux-toolchains, clang-built-linux,
	Fangrui Song, Nathan Chancellor, Sedat Dilek, Dmitry Golovin,
	Alistair Delva, Sami Tolvanen, stable

From: Fangrui Song <maskray@google.com>

Commit 393f203f5fd5 ("x86_64: kasan: add interceptors for
memset/memmove/memcpy functions") added .weak directives to
arch/x86/lib/mem*_64.S instead of changing the existing ENTRY macros to
WEAK. This can lead to the assembly snippet `.weak memcpy ... .globl
memcpy` which will produce a STB_WEAK memcpy with GNU as but STB_GLOBAL
memcpy with LLVM's integrated assembler before LLVM 12. LLVM 12 (since
https://reviews.llvm.org/D90108) will error on such an overridden symbol
binding.

Commit ef1e03152cb0 ("x86/asm: Make some functions local") changed ENTRY in
arch/x86/lib/memcpy_64.S to SYM_FUNC_START_LOCAL, which was ineffective due to
the preceding .weak directive.

Use the appropriate SYM_FUNC_START_WEAK instead.

Fixes: 393f203f5fd5 ("x86_64: kasan: add interceptors for memset/memmove/memcpy functions")
Fixes: ef1e03152cb0 ("x86/asm: Make some functions local")
Reported-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Fangrui Song <maskray@google.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Cc: <stable@vger.kernel.org>
---
 arch/x86/lib/memcpy_64.S  | 4 +---
 arch/x86/lib/memmove_64.S | 4 +---
 arch/x86/lib/memset_64.S  | 4 +---
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/arch/x86/lib/memcpy_64.S b/arch/x86/lib/memcpy_64.S
index 037faac46b0c..1e299ac73c86 100644
--- a/arch/x86/lib/memcpy_64.S
+++ b/arch/x86/lib/memcpy_64.S
@@ -16,8 +16,6 @@
  * to a jmp to memcpy_erms which does the REP; MOVSB mem copy.
  */
 
-.weak memcpy
-
 /*
  * memcpy - Copy a memory block.
  *
@@ -30,7 +28,7 @@
  * rax original destination
  */
 SYM_FUNC_START_ALIAS(__memcpy)
-SYM_FUNC_START_LOCAL(memcpy)
+SYM_FUNC_START_WEAK(memcpy)
 	ALTERNATIVE_2 "jmp memcpy_orig", "", X86_FEATURE_REP_GOOD, \
 		      "jmp memcpy_erms", X86_FEATURE_ERMS
 
diff --git a/arch/x86/lib/memmove_64.S b/arch/x86/lib/memmove_64.S
index 7ff00ea64e4f..41902fe8b859 100644
--- a/arch/x86/lib/memmove_64.S
+++ b/arch/x86/lib/memmove_64.S
@@ -24,9 +24,7 @@
  * Output:
  * rax: dest
  */
-.weak memmove
-
-SYM_FUNC_START_ALIAS(memmove)
+SYM_FUNC_START_WEAK(memmove)
 SYM_FUNC_START(__memmove)
 
 	mov %rdi, %rax
diff --git a/arch/x86/lib/memset_64.S b/arch/x86/lib/memset_64.S
index 9ff15ee404a4..0bfd26e4ca9e 100644
--- a/arch/x86/lib/memset_64.S
+++ b/arch/x86/lib/memset_64.S
@@ -6,8 +6,6 @@
 #include <asm/alternative-asm.h>
 #include <asm/export.h>
 
-.weak memset
-
 /*
  * ISO C memset - set a memory block to a byte value. This function uses fast
  * string to get better performance than the original function. The code is
@@ -19,7 +17,7 @@
  *
  * rax   original destination
  */
-SYM_FUNC_START_ALIAS(memset)
+SYM_FUNC_START_WEAK(memset)
 SYM_FUNC_START(__memset)
 	/*
 	 * Some CPUs support enhanced REP MOVSB/STOSB feature. It is recommended
-- 
2.29.1.341.ge80a0c044ae-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 2/4] Kbuild: do not emit debug info for assembly with LLVM_IAS=1
       [not found] ` <20201104005343.4192504-1-ndesaulniers@google.com>
  2020-11-04  0:53   ` [PATCH v2 1/4] x86_64: Change .weak to SYM_FUNC_START_WEAK for arch/x86/lib/mem*_64.S Nick Desaulniers
@ 2020-11-04  0:53   ` Nick Desaulniers
  2020-11-05  6:58     ` Nathan Chancellor
  1 sibling, 1 reply; 9+ messages in thread
From: Nick Desaulniers @ 2020-11-04  0:53 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Jakub Jelinek, Linux Kbuild mailing list,
	Linux Kernel Mailing List, linux-toolchains, clang-built-linux,
	Fangrui Song, Nathan Chancellor, Sedat Dilek, Dmitry Golovin,
	Alistair Delva, Nick Desaulniers, stable

Clang's integrated assembler produces the warning for assembly files:

warning: DWARF2 only supports one section per compilation unit

If -Wa,-gdwarf-* is unspecified, then debug info is not emitted.  This
will be re-enabled for new DWARF versions in a follow up patch.

Enables defconfig+CONFIG_DEBUG_INFO to build cleanly with
LLVM=1 LLVM_IAS=1 for x86_64 and arm64.

Cc: <stable@vger.kernel.org>
Link: https://github.com/ClangBuiltLinux/linux/issues/716
Reported-by: Nathan Chancellor <natechancellor@gmail.com>
Suggested-by: Dmitry Golovin <dima@golovin.in>
Suggested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Makefile b/Makefile
index f353886dbf44..75b1a3dcbf30 100644
--- a/Makefile
+++ b/Makefile
@@ -826,7 +826,9 @@ else
 DEBUG_CFLAGS	+= -g
 endif
 
+ifndef LLVM_IAS
 KBUILD_AFLAGS	+= -Wa,-gdwarf-2
+endif
 
 ifdef CONFIG_DEBUG_INFO_DWARF4
 DEBUG_CFLAGS	+= -gdwarf-4
-- 
2.29.1.341.ge80a0c044ae-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 2/4] Kbuild: do not emit debug info for assembly with LLVM_IAS=1
  2020-11-04  0:53   ` [PATCH v2 2/4] Kbuild: do not emit debug info for assembly with LLVM_IAS=1 Nick Desaulniers
@ 2020-11-05  6:58     ` Nathan Chancellor
  2020-11-05  7:26       ` Fangrui Song
  2020-11-09 18:28       ` Nick Desaulniers
  0 siblings, 2 replies; 9+ messages in thread
From: Nathan Chancellor @ 2020-11-05  6:58 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: Masahiro Yamada, Jakub Jelinek, Linux Kbuild mailing list,
	Linux Kernel Mailing List, linux-toolchains, clang-built-linux,
	Fangrui Song, Sedat Dilek, Dmitry Golovin, Alistair Delva,
	stable

On Tue, Nov 03, 2020 at 04:53:41PM -0800, Nick Desaulniers wrote:
> Clang's integrated assembler produces the warning for assembly files:
> 
> warning: DWARF2 only supports one section per compilation unit
> 
> If -Wa,-gdwarf-* is unspecified, then debug info is not emitted.  This

Is this something that should be called out somewhere? If I understand
this correctly, LLVM_IAS=1 + CONFIG_DEBUG_INFO=y won't work? Maybe this
should be handled in Kconfig?

> will be re-enabled for new DWARF versions in a follow up patch.
> 
> Enables defconfig+CONFIG_DEBUG_INFO to build cleanly with
> LLVM=1 LLVM_IAS=1 for x86_64 and arm64.
> 
> Cc: <stable@vger.kernel.org>
> Link: https://github.com/ClangBuiltLinux/linux/issues/716
> Reported-by: Nathan Chancellor <natechancellor@gmail.com>
> Suggested-by: Dmitry Golovin <dima@golovin.in>

If you happen to respin, Dmitry deserves a Reported-by tag too :)

> Suggested-by: Sedat Dilek <sedat.dilek@gmail.com>
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

Regardless of the other two comments, this is fine as is as a fix for
stable to unblock Android + CrOS since we have been running something
similar to it in CI:

Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>

> ---
>  Makefile | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Makefile b/Makefile
> index f353886dbf44..75b1a3dcbf30 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -826,7 +826,9 @@ else
>  DEBUG_CFLAGS	+= -g
>  endif
>  
> +ifndef LLVM_IAS

Nit: this should probably match the existing LLVM_IAS check

ifneq ($(LLVM_IAS),1)

>  KBUILD_AFLAGS	+= -Wa,-gdwarf-2
> +endif
>  
>  ifdef CONFIG_DEBUG_INFO_DWARF4
>  DEBUG_CFLAGS	+= -gdwarf-4
> -- 
> 2.29.1.341.ge80a0c044ae-goog
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 2/4] Kbuild: do not emit debug info for assembly with LLVM_IAS=1
  2020-11-05  6:58     ` Nathan Chancellor
@ 2020-11-05  7:26       ` Fangrui Song
  2020-11-09 18:28       ` Nick Desaulniers
  1 sibling, 0 replies; 9+ messages in thread
From: Fangrui Song @ 2020-11-05  7:26 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Nick Desaulniers, Masahiro Yamada, Jakub Jelinek,
	Linux Kbuild mailing list, Linux Kernel Mailing List,
	linux-toolchains, clang-built-linux, Sedat Dilek, Dmitry Golovin,
	Alistair Delva, stable


On 2020-11-04, Nathan Chancellor wrote:
>On Tue, Nov 03, 2020 at 04:53:41PM -0800, Nick Desaulniers wrote:
>> Clang's integrated assembler produces the warning for assembly files:
>>
>> warning: DWARF2 only supports one section per compilation unit
>>
>> If -Wa,-gdwarf-* is unspecified, then debug info is not emitted.  This
>
>Is this something that should be called out somewhere? If I understand
>this correctly, LLVM_IAS=1 + CONFIG_DEBUG_INFO=y won't work? Maybe this
>should be handled in Kconfig?
>
>> will be re-enabled for new DWARF versions in a follow up patch.
>>
>> Enables defconfig+CONFIG_DEBUG_INFO to build cleanly with
>> LLVM=1 LLVM_IAS=1 for x86_64 and arm64.
>>
>> Cc: <stable@vger.kernel.org>
>> Link: https://github.com/ClangBuiltLinux/linux/issues/716
>> Reported-by: Nathan Chancellor <natechancellor@gmail.com>
>> Suggested-by: Dmitry Golovin <dima@golovin.in>
>
>If you happen to respin, Dmitry deserves a Reported-by tag too :)
>
>> Suggested-by: Sedat Dilek <sedat.dilek@gmail.com>
>> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
>
>Regardless of the other two comments, this is fine as is as a fix for
>stable to unblock Android + CrOS since we have been running something
>similar to it in CI:
>
>Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
>
>> ---
>>  Makefile | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/Makefile b/Makefile
>> index f353886dbf44..75b1a3dcbf30 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -826,7 +826,9 @@ else
>>  DEBUG_CFLAGS	+= -g
>>  endif
>>
>> +ifndef LLVM_IAS
>
>Nit: this should probably match the existing LLVM_IAS check
>
>ifneq ($(LLVM_IAS),1)
>
>>  KBUILD_AFLAGS	+= -Wa,-gdwarf-2
>> +endif
>>
>>  ifdef CONFIG_DEBUG_INFO_DWARF4
>>  DEBUG_CFLAGS	+= -gdwarf-4
>> --
>> 2.29.1.341.ge80a0c044ae-goog
>>

The root cause is that DWARF v2 has no DW_AT_ranges, so it cannot
represent non-contiguous address ranges. It seems that GNU as -gdwarf-3
emits DW_AT_ranges as well and emits an entry for a non-executable section.
In any case, the option is of very low value, at least for LLVM.


Reviewed-by: Fangrui Song <maskray@google.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 2/4] Kbuild: do not emit debug info for assembly with LLVM_IAS=1
  2020-11-05  6:58     ` Nathan Chancellor
  2020-11-05  7:26       ` Fangrui Song
@ 2020-11-09 18:28       ` Nick Desaulniers
  2020-11-09 18:35         ` [PATCH v3] " Nick Desaulniers
  1 sibling, 1 reply; 9+ messages in thread
From: Nick Desaulniers @ 2020-11-09 18:28 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Masahiro Yamada, Jakub Jelinek, Linux Kbuild mailing list,
	Linux Kernel Mailing List, linux-toolchains, clang-built-linux,
	Fangrui Song, Sedat Dilek, Dmitry Golovin, Alistair Delva,
	# 3.4.x

On Wed, Nov 4, 2020 at 10:58 PM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> On Tue, Nov 03, 2020 at 04:53:41PM -0800, Nick Desaulniers wrote:
> > Clang's integrated assembler produces the warning for assembly files:
> >
> > warning: DWARF2 only supports one section per compilation unit
> >
> > If -Wa,-gdwarf-* is unspecified, then debug info is not emitted.  This
>
> Is this something that should be called out somewhere? If I understand
> this correctly, LLVM_IAS=1 + CONFIG_DEBUG_INFO=y won't work? Maybe this
> should be handled in Kconfig?

Specifically, debug info will not be emitted, for assembler source
files. It will still be emitted for C source files (via -gdwarf-*).
-Wa,-gdwarf-* only affects assembler file sources.

>
> > will be re-enabled for new DWARF versions in a follow up patch.
> >
> > Enables defconfig+CONFIG_DEBUG_INFO to build cleanly with
> > LLVM=1 LLVM_IAS=1 for x86_64 and arm64.
> >
> > Cc: <stable@vger.kernel.org>
> > Link: https://github.com/ClangBuiltLinux/linux/issues/716
> > Reported-by: Nathan Chancellor <natechancellor@gmail.com>
> > Suggested-by: Dmitry Golovin <dima@golovin.in>
>
> If you happen to respin, Dmitry deserves a Reported-by tag too :)

Sure.

>
> > Suggested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
>
> Regardless of the other two comments, this is fine as is as a fix for
> stable to unblock Android + CrOS since we have been running something
> similar to it in CI:
>
> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
>
> > ---
> >  Makefile | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/Makefile b/Makefile
> > index f353886dbf44..75b1a3dcbf30 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -826,7 +826,9 @@ else
> >  DEBUG_CFLAGS += -g
> >  endif
> >
> > +ifndef LLVM_IAS
>
> Nit: this should probably match the existing LLVM_IAS check

Sure, will send a v3.  Going to just send this for now, as it's
blocking some downstream work I'm trying to get done in Android.

>
> ifneq ($(LLVM_IAS),1)
>
> >  KBUILD_AFLAGS        += -Wa,-gdwarf-2
> > +endif
> >
> >  ifdef CONFIG_DEBUG_INFO_DWARF4
> >  DEBUG_CFLAGS += -gdwarf-4
> > --
> > 2.29.1.341.ge80a0c044ae-goog
> >



-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v3] Kbuild: do not emit debug info for assembly with LLVM_IAS=1
  2020-11-09 18:28       ` Nick Desaulniers
@ 2020-11-09 18:35         ` Nick Desaulniers
  2020-11-16 23:41           ` Nick Desaulniers
  0 siblings, 1 reply; 9+ messages in thread
From: Nick Desaulniers @ 2020-11-09 18:35 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Linux Kbuild mailing list, Linux Kernel Mailing List,
	linux-toolchains, clang-built-linux, Fangrui Song,
	Nathan Chancellor, Sedat Dilek, Dmitry Golovin, Alistair Delva,
	Nick Desaulniers, stable

Clang's integrated assembler produces the warning for assembly files:

warning: DWARF2 only supports one section per compilation unit

If -Wa,-gdwarf-* is unspecified, then debug info is not emitted for
assembly sources (it is still emitted for C sources).  This will be
re-enabled for newer DWARF versions in a follow up patch.

Enables defconfig+CONFIG_DEBUG_INFO to build cleanly with
LLVM=1 LLVM_IAS=1 for x86_64 and arm64.

Cc: <stable@vger.kernel.org>
Link: https://github.com/ClangBuiltLinux/linux/issues/716
Reported-by: Dmitry Golovin <dima@golovin.in>
Reported-by: Nathan Chancellor <natechancellor@gmail.com>
Suggested-by: Dmitry Golovin <dima@golovin.in>
Suggested-by: Nathan Chancellor <natechancellor@gmail.com>
Suggested-by: Sedat Dilek <sedat.dilek@gmail.com>
Reviewed-by: Fangrui Song <maskray@google.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Makefile b/Makefile
index f353886dbf44..7e899d356902 100644
--- a/Makefile
+++ b/Makefile
@@ -826,7 +826,9 @@ else
 DEBUG_CFLAGS	+= -g
 endif
 
+ifneq ($(LLVM_IAS),1)
 KBUILD_AFLAGS	+= -Wa,-gdwarf-2
+endif
 
 ifdef CONFIG_DEBUG_INFO_DWARF4
 DEBUG_CFLAGS	+= -gdwarf-4
-- 
2.29.2.222.g5d2a92d10f8-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v3] Kbuild: do not emit debug info for assembly with LLVM_IAS=1
  2020-11-09 18:35         ` [PATCH v3] " Nick Desaulniers
@ 2020-11-16 23:41           ` Nick Desaulniers
       [not found]             ` <CA+SOCLJTg6U+Ddop_5O-baVR42va3vGAvMQ62o9H6rd+10aKrw@mail.gmail.com>
  0 siblings, 1 reply; 9+ messages in thread
From: Nick Desaulniers @ 2020-11-16 23:41 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Linux Kbuild mailing list, Linux Kernel Mailing List,
	linux-toolchains, clang-built-linux, Fangrui Song,
	Nathan Chancellor, Sedat Dilek, Dmitry Golovin, Alistair Delva,
	# 3.4.x

Hi Masahiro, have you had time to review v3 of this patch?

On Mon, Nov 9, 2020 at 10:35 AM Nick Desaulniers
<ndesaulniers@google.com> wrote:
>
> Clang's integrated assembler produces the warning for assembly files:
>
> warning: DWARF2 only supports one section per compilation unit
>
> If -Wa,-gdwarf-* is unspecified, then debug info is not emitted for
> assembly sources (it is still emitted for C sources).  This will be
> re-enabled for newer DWARF versions in a follow up patch.
>
> Enables defconfig+CONFIG_DEBUG_INFO to build cleanly with
> LLVM=1 LLVM_IAS=1 for x86_64 and arm64.
>
> Cc: <stable@vger.kernel.org>
> Link: https://github.com/ClangBuiltLinux/linux/issues/716
> Reported-by: Dmitry Golovin <dima@golovin.in>
> Reported-by: Nathan Chancellor <natechancellor@gmail.com>
> Suggested-by: Dmitry Golovin <dima@golovin.in>
> Suggested-by: Nathan Chancellor <natechancellor@gmail.com>
> Suggested-by: Sedat Dilek <sedat.dilek@gmail.com>
> Reviewed-by: Fangrui Song <maskray@google.com>
> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
> ---
>  Makefile | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index f353886dbf44..7e899d356902 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -826,7 +826,9 @@ else
>  DEBUG_CFLAGS   += -g
>  endif
>
> +ifneq ($(LLVM_IAS),1)
>  KBUILD_AFLAGS  += -Wa,-gdwarf-2
> +endif
>
>  ifdef CONFIG_DEBUG_INFO_DWARF4
>  DEBUG_CFLAGS   += -gdwarf-4
> --
> 2.29.2.222.g5d2a92d10f8-goog
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3] Kbuild: do not emit debug info for assembly with LLVM_IAS=1
       [not found]             ` <CA+SOCLJTg6U+Ddop_5O-baVR42va3vGAvMQ62o9H6rd+10aKrw@mail.gmail.com>
@ 2020-11-23 18:42               ` Nick Desaulniers
  2020-11-24 18:44                 ` Masahiro Yamada
  0 siblings, 1 reply; 9+ messages in thread
From: Nick Desaulniers @ 2020-11-23 18:42 UTC (permalink / raw)
  To: Masahiro Yamada, Masahiro Yamada
  Cc: Linux Kbuild mailing list, Linux Kernel Mailing List,
	linux-toolchains, clang-built-linux, Fangrui Song,
	Nathan Chancellor, Sedat Dilek, Dmitry Golovin, Alistair Delva,
	# 3.4.x, Jian Cai

Hi Masahiro,
I would appreciate any feedback you have on this patch.

On Fri, Nov 20, 2020 at 3:58 PM Jian Cai <jiancai@google.com> wrote:
>
> I also verified that with this patch Chrome OS devices booted with either GNU assembler or LLVM's integrated assembler. With this patch, IAS no longer produces extra warnings compared to GNU as on Chrome OS and would remove the last blocker of enabling IAS on it.
>
> Tested-by: Jian Cai <jiancai@google.com> # Compile-tested on mainline (with defconfig) and boot-tested on ChromeOS (with olddefconfig).
>
>
> On Mon, Nov 16, 2020 at 3:41 PM 'Nick Desaulniers' via Clang Built Linux <clang-built-linux@googlegroups.com> wrote:
>>
>> Hi Masahiro, have you had time to review v3 of this patch?
>>
>> On Mon, Nov 9, 2020 at 10:35 AM Nick Desaulniers
>> <ndesaulniers@google.com> wrote:
>> >
>> > Clang's integrated assembler produces the warning for assembly files:
>> >
>> > warning: DWARF2 only supports one section per compilation unit
>> >
>> > If -Wa,-gdwarf-* is unspecified, then debug info is not emitted for
>> > assembly sources (it is still emitted for C sources).  This will be
>> > re-enabled for newer DWARF versions in a follow up patch.
>> >
>> > Enables defconfig+CONFIG_DEBUG_INFO to build cleanly with
>> > LLVM=1 LLVM_IAS=1 for x86_64 and arm64.
>> >
>> > Cc: <stable@vger.kernel.org>
>> > Link: https://github.com/ClangBuiltLinux/linux/issues/716
>> > Reported-by: Dmitry Golovin <dima@golovin.in>
>> > Reported-by: Nathan Chancellor <natechancellor@gmail.com>
>> > Suggested-by: Dmitry Golovin <dima@golovin.in>
>> > Suggested-by: Nathan Chancellor <natechancellor@gmail.com>
>> > Suggested-by: Sedat Dilek <sedat.dilek@gmail.com>
>> > Reviewed-by: Fangrui Song <maskray@google.com>
>> > Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
>> > Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
>> > ---
>> >  Makefile | 2 ++
>> >  1 file changed, 2 insertions(+)
>> >
>> > diff --git a/Makefile b/Makefile
>> > index f353886dbf44..7e899d356902 100644
>> > --- a/Makefile
>> > +++ b/Makefile
>> > @@ -826,7 +826,9 @@ else
>> >  DEBUG_CFLAGS   += -g
>> >  endif
>> >
>> > +ifneq ($(LLVM_IAS),1)
>> >  KBUILD_AFLAGS  += -Wa,-gdwarf-2
>> > +endif
>> >
>> >  ifdef CONFIG_DEBUG_INFO_DWARF4
>> >  DEBUG_CFLAGS   += -gdwarf-4
>> > --
>> > 2.29.2.222.g5d2a92d10f8-goog
>> >
>>
>>
>> --
>> Thanks,
>> ~Nick Desaulniers
>>
>> --
>> 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/CAKwvOdnxAr7UdjUiuttj%3Dbz1_voK1qUvpOvSY35qOZ60%2BE8LBA%40mail.gmail.com.



-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3] Kbuild: do not emit debug info for assembly with LLVM_IAS=1
  2020-11-23 18:42               ` Nick Desaulniers
@ 2020-11-24 18:44                 ` Masahiro Yamada
  0 siblings, 0 replies; 9+ messages in thread
From: Masahiro Yamada @ 2020-11-24 18:44 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: Linux Kbuild mailing list, Linux Kernel Mailing List,
	linux-toolchains, clang-built-linux, Fangrui Song,
	Nathan Chancellor, Sedat Dilek, Dmitry Golovin, Alistair Delva,
	# 3.4.x, Jian Cai

On Tue, Nov 24, 2020 at 3:42 AM Nick Desaulniers
<ndesaulniers@google.com> wrote:
>
> Hi Masahiro,
> I would appreciate any feedback you have on this patch.
>

Applied to linux-kbuild. Thanks.




> On Fri, Nov 20, 2020 at 3:58 PM Jian Cai <jiancai@google.com> wrote:
> >
> > I also verified that with this patch Chrome OS devices booted with either GNU assembler or LLVM's integrated assembler. With this patch, IAS no longer produces extra warnings compared to GNU as on Chrome OS and would remove the last blocker of enabling IAS on it.
> >
> > Tested-by: Jian Cai <jiancai@google.com> # Compile-tested on mainline (with defconfig) and boot-tested on ChromeOS (with olddefconfig).
> >
> >
> > On Mon, Nov 16, 2020 at 3:41 PM 'Nick Desaulniers' via Clang Built Linux <clang-built-linux@googlegroups.com> wrote:
> >>
> >> Hi Masahiro, have you had time to review v3 of this patch?
> >>
> >> On Mon, Nov 9, 2020 at 10:35 AM Nick Desaulniers
> >> <ndesaulniers@google.com> wrote:
> >> >
> >> > Clang's integrated assembler produces the warning for assembly files:
> >> >
> >> > warning: DWARF2 only supports one section per compilation unit
> >> >
> >> > If -Wa,-gdwarf-* is unspecified, then debug info is not emitted for
> >> > assembly sources (it is still emitted for C sources).  This will be
> >> > re-enabled for newer DWARF versions in a follow up patch.
> >> >
> >> > Enables defconfig+CONFIG_DEBUG_INFO to build cleanly with
> >> > LLVM=1 LLVM_IAS=1 for x86_64 and arm64.
> >> >
> >> > Cc: <stable@vger.kernel.org>
> >> > Link: https://github.com/ClangBuiltLinux/linux/issues/716
> >> > Reported-by: Dmitry Golovin <dima@golovin.in>
> >> > Reported-by: Nathan Chancellor <natechancellor@gmail.com>
> >> > Suggested-by: Dmitry Golovin <dima@golovin.in>
> >> > Suggested-by: Nathan Chancellor <natechancellor@gmail.com>
> >> > Suggested-by: Sedat Dilek <sedat.dilek@gmail.com>
> >> > Reviewed-by: Fangrui Song <maskray@google.com>
> >> > Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
> >> > Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
> >> > ---
> >> >  Makefile | 2 ++
> >> >  1 file changed, 2 insertions(+)
> >> >
> >> > diff --git a/Makefile b/Makefile
> >> > index f353886dbf44..7e899d356902 100644
> >> > --- a/Makefile
> >> > +++ b/Makefile
> >> > @@ -826,7 +826,9 @@ else
> >> >  DEBUG_CFLAGS   += -g
> >> >  endif
> >> >
> >> > +ifneq ($(LLVM_IAS),1)
> >> >  KBUILD_AFLAGS  += -Wa,-gdwarf-2
> >> > +endif
> >> >
> >> >  ifdef CONFIG_DEBUG_INFO_DWARF4
> >> >  DEBUG_CFLAGS   += -gdwarf-4
> >> > --
> >> > 2.29.2.222.g5d2a92d10f8-goog
> >> >
> >>
> >>
> >> --
> >> Thanks,
> >> ~Nick Desaulniers
> >>
> >> --
> >> 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/CAKwvOdnxAr7UdjUiuttj%3Dbz1_voK1qUvpOvSY35qOZ60%2BE8LBA%40mail.gmail.com.
>
>
>
> --
> Thanks,
> ~Nick Desaulniers



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-11-24 18:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAK7LNAST0Ma4bGGOA_HATzYAmRhZG=x_X=8p_9dKGX7bYc2FMA@mail.gmail.com>
     [not found] ` <20201104005343.4192504-1-ndesaulniers@google.com>
2020-11-04  0:53   ` [PATCH v2 1/4] x86_64: Change .weak to SYM_FUNC_START_WEAK for arch/x86/lib/mem*_64.S Nick Desaulniers
2020-11-04  0:53   ` [PATCH v2 2/4] Kbuild: do not emit debug info for assembly with LLVM_IAS=1 Nick Desaulniers
2020-11-05  6:58     ` Nathan Chancellor
2020-11-05  7:26       ` Fangrui Song
2020-11-09 18:28       ` Nick Desaulniers
2020-11-09 18:35         ` [PATCH v3] " Nick Desaulniers
2020-11-16 23:41           ` Nick Desaulniers
     [not found]             ` <CA+SOCLJTg6U+Ddop_5O-baVR42va3vGAvMQ62o9H6rd+10aKrw@mail.gmail.com>
2020-11-23 18:42               ` Nick Desaulniers
2020-11-24 18:44                 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).