linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfs: stop CONFIG_XFS_DEBUG from changing compiler flags
@ 2020-04-09  8:08 Arnd Bergmann
  2020-04-09 12:51 ` Brian Foster
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arnd Bergmann @ 2020-04-09  8:08 UTC (permalink / raw)
  To: Darrick J. Wong, linux-xfs
  Cc: Arnd Bergmann, Christoph Hellwig, Brian Foster, Dave Chinner,
	Eric Sandeen, Masahiro Yamada, linux-kernel

I ran into a linker warning in XFS that originates from a mismatch
between libelf, binutils and objtool when certain files in the kernel
are built with "gcc -g":

x86_64-linux-ld: fs/xfs/xfs_trace.o: unable to initialize decompress status for section .debug_info

After some discussion, nobody could identify why xfs sets this flag
here. CONFIG_XFS_DEBUG used to enable lots of unrelated settings, but
now its main purpose is to enable extra consistency checks and assertions
that are unrelated to the debug info.

Remove the Makefile logic to set the flag here. If anyone relies
on the debug info, this can simply be enabled again with the global
CONFIG_DEBUG_INFO option.

Suggested-by: Christoph Hellwig <hch@infradead.org>
Link: https://lore.kernel.org/lkml/20200409074130.GD21033@infradead.org/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/xfs/Makefile | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
index 4f95df476181..ff94fb90a2ee 100644
--- a/fs/xfs/Makefile
+++ b/fs/xfs/Makefile
@@ -7,8 +7,6 @@
 ccflags-y += -I $(srctree)/$(src)		# needed for trace events
 ccflags-y += -I $(srctree)/$(src)/libxfs
 
-ccflags-$(CONFIG_XFS_DEBUG) += -g
-
 obj-$(CONFIG_XFS_FS)		+= xfs.o
 
 # this one should be compiled first, as the tracing macros can easily blow up
-- 
2.26.0


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

* Re: [PATCH] xfs: stop CONFIG_XFS_DEBUG from changing compiler flags
  2020-04-09  8:08 [PATCH] xfs: stop CONFIG_XFS_DEBUG from changing compiler flags Arnd Bergmann
@ 2020-04-09 12:51 ` Brian Foster
  2020-04-09 15:50 ` Allison Collins
  2020-04-10  1:01 ` Dave Chinner
  2 siblings, 0 replies; 4+ messages in thread
From: Brian Foster @ 2020-04-09 12:51 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Darrick J. Wong, linux-xfs, Christoph Hellwig, Dave Chinner,
	Eric Sandeen, Masahiro Yamada, linux-kernel

On Thu, Apr 09, 2020 at 10:08:56AM +0200, Arnd Bergmann wrote:
> I ran into a linker warning in XFS that originates from a mismatch
> between libelf, binutils and objtool when certain files in the kernel
> are built with "gcc -g":
> 
> x86_64-linux-ld: fs/xfs/xfs_trace.o: unable to initialize decompress status for section .debug_info
> 
> After some discussion, nobody could identify why xfs sets this flag
> here. CONFIG_XFS_DEBUG used to enable lots of unrelated settings, but
> now its main purpose is to enable extra consistency checks and assertions
> that are unrelated to the debug info.
> 
> Remove the Makefile logic to set the flag here. If anyone relies
> on the debug info, this can simply be enabled again with the global
> CONFIG_DEBUG_INFO option.
> 
> Suggested-by: Christoph Hellwig <hch@infradead.org>
> Link: https://lore.kernel.org/lkml/20200409074130.GD21033@infradead.org/
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

Seems reasonable.

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/Makefile | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
> index 4f95df476181..ff94fb90a2ee 100644
> --- a/fs/xfs/Makefile
> +++ b/fs/xfs/Makefile
> @@ -7,8 +7,6 @@
>  ccflags-y += -I $(srctree)/$(src)		# needed for trace events
>  ccflags-y += -I $(srctree)/$(src)/libxfs
>  
> -ccflags-$(CONFIG_XFS_DEBUG) += -g
> -
>  obj-$(CONFIG_XFS_FS)		+= xfs.o
>  
>  # this one should be compiled first, as the tracing macros can easily blow up
> -- 
> 2.26.0
> 


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

* Re: [PATCH] xfs: stop CONFIG_XFS_DEBUG from changing compiler flags
  2020-04-09  8:08 [PATCH] xfs: stop CONFIG_XFS_DEBUG from changing compiler flags Arnd Bergmann
  2020-04-09 12:51 ` Brian Foster
@ 2020-04-09 15:50 ` Allison Collins
  2020-04-10  1:01 ` Dave Chinner
  2 siblings, 0 replies; 4+ messages in thread
From: Allison Collins @ 2020-04-09 15:50 UTC (permalink / raw)
  To: Arnd Bergmann, Darrick J. Wong, linux-xfs
  Cc: Christoph Hellwig, Brian Foster, Dave Chinner, Eric Sandeen,
	Masahiro Yamada, linux-kernel



On 4/9/20 1:08 AM, Arnd Bergmann wrote:
> I ran into a linker warning in XFS that originates from a mismatch
> between libelf, binutils and objtool when certain files in the kernel
> are built with "gcc -g":
> 
> x86_64-linux-ld: fs/xfs/xfs_trace.o: unable to initialize decompress status for section .debug_info
> 
> After some discussion, nobody could identify why xfs sets this flag
> here. CONFIG_XFS_DEBUG used to enable lots of unrelated settings, but
> now its main purpose is to enable extra consistency checks and assertions
> that are unrelated to the debug info.
> 
> Remove the Makefile logic to set the flag here. If anyone relies
> on the debug info, this can simply be enabled again with the global
> CONFIG_DEBUG_INFO option.
> 
> Suggested-by: Christoph Hellwig <hch@infradead.org>
> Link: https://urldefense.com/v3/__https://lore.kernel.org/lkml/20200409074130.GD21033@infradead.org/__;!!GqivPVa7Brio!JzJUQORI8aWjYFMvoyVmkgYSofJexLQn7p16KvP39F-NjuIzEXWqypgw0FnCyrdFtmZm$
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Ok, looks good
Reviewed-by: Allison Collins <allison.henderson@oracle.com>

> ---
>   fs/xfs/Makefile | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
> index 4f95df476181..ff94fb90a2ee 100644
> --- a/fs/xfs/Makefile
> +++ b/fs/xfs/Makefile
> @@ -7,8 +7,6 @@
>   ccflags-y += -I $(srctree)/$(src)		# needed for trace events
>   ccflags-y += -I $(srctree)/$(src)/libxfs
>   
> -ccflags-$(CONFIG_XFS_DEBUG) += -g
> -
>   obj-$(CONFIG_XFS_FS)		+= xfs.o
>   
>   # this one should be compiled first, as the tracing macros can easily blow up
> 

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

* Re: [PATCH] xfs: stop CONFIG_XFS_DEBUG from changing compiler flags
  2020-04-09  8:08 [PATCH] xfs: stop CONFIG_XFS_DEBUG from changing compiler flags Arnd Bergmann
  2020-04-09 12:51 ` Brian Foster
  2020-04-09 15:50 ` Allison Collins
@ 2020-04-10  1:01 ` Dave Chinner
  2 siblings, 0 replies; 4+ messages in thread
From: Dave Chinner @ 2020-04-10  1:01 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Darrick J. Wong, linux-xfs, Christoph Hellwig, Brian Foster,
	Dave Chinner, Eric Sandeen, Masahiro Yamada, linux-kernel

On Thu, Apr 09, 2020 at 10:08:56AM +0200, Arnd Bergmann wrote:
> I ran into a linker warning in XFS that originates from a mismatch
> between libelf, binutils and objtool when certain files in the kernel
> are built with "gcc -g":
> 
> x86_64-linux-ld: fs/xfs/xfs_trace.o: unable to initialize decompress status for section .debug_info
> 
> After some discussion, nobody could identify why xfs sets this flag
> here. CONFIG_XFS_DEBUG used to enable lots of unrelated settings, but
> now its main purpose is to enable extra consistency checks and assertions
> that are unrelated to the debug info.

I'm pretty sure it was needed for the original kgdb integration back
in the early 2000s. That was when SGI used to patch their XFS dev
tree with kgdb and debug symbols were needed by the custom kgdb
modules that were ported across from the Irix kernel debugger.

ISTR that the early kcrash kernel dump analysis tools (again,
originated from the Irix "icrash" kernel dump tools) had custom XFS
debug scripts that needed also the debug info to work correctly...

Which is a long way of saying "we don't need it anymore" instead of
"nobody knows why it was set"... :)

With an update to commit message:

Reviewed-by: Dave Chinner <dchinner@redhat.com>
-- 
Dave Chinner
david@fromorbit.com

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

end of thread, other threads:[~2020-04-10  1:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09  8:08 [PATCH] xfs: stop CONFIG_XFS_DEBUG from changing compiler flags Arnd Bergmann
2020-04-09 12:51 ` Brian Foster
2020-04-09 15:50 ` Allison Collins
2020-04-10  1:01 ` Dave Chinner

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).