linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2] MIPS: Kconfig: Select ARCH_WANT_FRAME_POINTERS
@ 2020-11-16  9:55 Tiezhu Yang
  2020-11-16 15:14 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 3+ messages in thread
From: Tiezhu Yang @ 2020-11-16  9:55 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel, Xuefeng Li

Select ARCH_WANT_FRAME_POINTERS to fix the following build error under
CONFIG_DEBUG_ATOMIC_SLEEP:

  CC      arch/mips/kernel/signal.o
{standard input}: Assembler messages:
{standard input}:1775: Error: Unable to parse register name $fp
scripts/Makefile.build:283: recipe for target 'arch/mips/kernel/signal.o' failed
make[2]: *** [arch/mips/kernel/signal.o] Error 1
scripts/Makefile.build:500: recipe for target 'arch/mips/kernel' failed
make[1]: *** [arch/mips/kernel] Error 2
Makefile:1799: recipe for target 'arch/mips' failed
make: *** [arch/mips] Error 2

I think it is useful to get debugging information as described in the
following texts:

lib/Kconfig.debug
config FRAME_POINTER
        bool "Compile the kernel with frame pointers"
        ...
        default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS
        help
          If you say Y here the resulting kernel image will be slightly
          larger and slower, but it gives very useful debugging information
          in case of kernel bugs. (precise oopses/stacktraces/warnings)

Documentation/dev-tools/kgdb.rst
This option inserts code into the compiled executable which saves
the frame information in registers or on the stack at different points
which allows a debugger such as gdb to more accurately construct stack
back traces while debugging the kernel.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---

v2: Update the commit message to correct the typo "to into" to "into"

 arch/mips/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index ddaff19..4a4c791 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -15,6 +15,7 @@ config MIPS
 	select ARCH_USE_QUEUED_RWLOCKS
 	select ARCH_USE_QUEUED_SPINLOCKS
 	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
+	select ARCH_WANT_FRAME_POINTERS
 	select ARCH_WANT_IPC_PARSE_VERSION
 	select BUILDTIME_TABLE_SORT
 	select CLONE_BACKWARDS
-- 
2.1.0


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

* Re: [RFC PATCH v2] MIPS: Kconfig: Select ARCH_WANT_FRAME_POINTERS
  2020-11-16  9:55 [RFC PATCH v2] MIPS: Kconfig: Select ARCH_WANT_FRAME_POINTERS Tiezhu Yang
@ 2020-11-16 15:14 ` Thomas Bogendoerfer
  2020-11-17  2:17   ` Tiezhu Yang
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Bogendoerfer @ 2020-11-16 15:14 UTC (permalink / raw)
  To: Tiezhu Yang; +Cc: linux-mips, linux-kernel, Xuefeng Li

On Mon, Nov 16, 2020 at 05:55:06PM +0800, Tiezhu Yang wrote:
> Select ARCH_WANT_FRAME_POINTERS to fix the following build error under
> CONFIG_DEBUG_ATOMIC_SLEEP:
> 
>   CC      arch/mips/kernel/signal.o
> {standard input}: Assembler messages:
> {standard input}:1775: Error: Unable to parse register name $fp
> scripts/Makefile.build:283: recipe for target 'arch/mips/kernel/signal.o' failed
> make[2]: *** [arch/mips/kernel/signal.o] Error 1
> scripts/Makefile.build:500: recipe for target 'arch/mips/kernel' failed
> make[1]: *** [arch/mips/kernel] Error 2
> Makefile:1799: recipe for target 'arch/mips' failed
> make: *** [arch/mips] Error 2

I don't see this error and to me it looks strange to fix that with
enablding frame pointers... What gcc is this ?

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

* Re: [RFC PATCH v2] MIPS: Kconfig: Select ARCH_WANT_FRAME_POINTERS
  2020-11-16 15:14 ` Thomas Bogendoerfer
@ 2020-11-17  2:17   ` Tiezhu Yang
  0 siblings, 0 replies; 3+ messages in thread
From: Tiezhu Yang @ 2020-11-17  2:17 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel, Xuefeng Li

On 11/16/2020 11:14 PM, Thomas Bogendoerfer wrote:
> On Mon, Nov 16, 2020 at 05:55:06PM +0800, Tiezhu Yang wrote:
>> Select ARCH_WANT_FRAME_POINTERS to fix the following build error under
>> CONFIG_DEBUG_ATOMIC_SLEEP:
>>
>>    CC      arch/mips/kernel/signal.o
>> {standard input}: Assembler messages:
>> {standard input}:1775: Error: Unable to parse register name $fp
>> scripts/Makefile.build:283: recipe for target 'arch/mips/kernel/signal.o' failed
>> make[2]: *** [arch/mips/kernel/signal.o] Error 1
>> scripts/Makefile.build:500: recipe for target 'arch/mips/kernel' failed
>> make[1]: *** [arch/mips/kernel] Error 2
>> Makefile:1799: recipe for target 'arch/mips' failed
>> make: *** [arch/mips] Error 2
> I don't see this error and to me it looks strange to fix that with
> enablding frame pointers... What gcc is this ?

I found this build error used with gcc 4.9.4.
I try it used with gcc 7.3.1 and it has no problem.
We can use new gcc version to avoid this build error.

Additionally, I want to know whether ARCH_WANT_FRAME_POINTERS
is necessary for MIPS to get more debugging info, with this
config we can enable the config FRAME_POINTER by default and
disable it manually.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Makefile#n790
ifdef CONFIG_FRAME_POINTER
KBUILD_CFLAGS   += -fno-omit-frame-pointer -fno-optimize-sibling-calls

Thanks,
Tiezhu


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

end of thread, other threads:[~2020-11-17  2:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16  9:55 [RFC PATCH v2] MIPS: Kconfig: Select ARCH_WANT_FRAME_POINTERS Tiezhu Yang
2020-11-16 15:14 ` Thomas Bogendoerfer
2020-11-17  2:17   ` Tiezhu Yang

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