s390/decompressor: support extra debug flags
authorVasily Gorbik <gor@linux.ibm.com>
Thu, 28 Jun 2018 17:22:21 +0000 (19:22 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 2 Jul 2018 10:32:24 +0000 (12:32 +0200)
Since decompressor cflags and aflags are made from scratch add extra
debug flags when CONFIG_DEBUG_INFO is enabled.

Also adds support for CONFIG_DEBUG_INFO_DWARF4 option.

Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/Makefile

index d25fbc17016427ad1f06e274d37cdea0fb2624ff..eee6703093c32e884f00bd07554511a8ccb090f6 100644 (file)
@@ -16,12 +16,16 @@ KBUILD_AFLAGS_MODULE += -fPIC
 KBUILD_CFLAGS_MODULE += -fPIC
 KBUILD_AFLAGS  += -m64
 KBUILD_CFLAGS  += -m64
+aflags_dwarf   := -Wa,-gdwarf-2
 KBUILD_AFLAGS_DECOMPRESSOR := -m64 -D__ASSEMBLY__
+KBUILD_AFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),$(aflags_dwarf))
 KBUILD_CFLAGS_DECOMPRESSOR := -m64 -O2
 KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY
 KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float
 KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables
 KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-option,-ffreestanding)
+KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g)
+KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,))
 UTS_MACHINE    := s390x
 STACK_SIZE     := 16384
 CHECKFLAGS     += -D__s390__ -D__s390x__