]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ctf: fix CONFIG_CTF && !CONFIG_DTRACE and CONFIG_DT_DISABLE_CTF
authorNick Alcock <nick.alcock@oracle.com>
Thu, 14 Jul 2016 17:05:24 +0000 (18:05 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Tue, 19 Jul 2016 11:05:09 +0000 (12:05 +0100)
These combinations of config options, one of which should enable
CTF without enabling DTrace, the other one of which should enable
DTrace without enabling CTF, are both broken.

Fix them by making the CTF <-> DT_DISABLE_CTF relationship bidirectional,
by making dwarf2ctf compilation depend properly on CONFIG_CTF rather than
CONFIG_DTRACE, and by fixing the newly-introduced order-only dependency
of CTF on the sdtinfo stubs files so that it is only enforced when
both CTF and DTrace are enabled.

Orabug: 23859082
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Reviewed-By: Todd Vierling <todd.vierling@oracle.com>
kernel/ctf/Kconfig
scripts/Makefile
scripts/Makefile.modpost
scripts/dwarf2ctf/Makefile

index 571e26c51b9687518273771c6232aad334f89b6b..692258af194c28b633cfe9cc8d391c53b46f277f 100644 (file)
@@ -2,7 +2,7 @@ config CTF
        bool "Compact Type Format generation"
        default n
        select STRIP_ASM_SYMS
-       depends on DEBUG_INFO && !DEBUG_INFO_REDUCED && !DEBUG_INFO_SPLIT && !DEBUG_INFO_DWARF4
+       depends on DEBUG_INFO && !DEBUG_INFO_REDUCED && !DEBUG_INFO_SPLIT && !DEBUG_INFO_DWARF4 && !DT_DISABLE_CTF
        help
          Emit a compact, compressed description of the kernel's datatypes and
          global variables into .ctf sections in kernel modules.  A module
index ab907e9284bd0cb774ddca8b4f211ecdd7e5e59e..9f00a7c7f8670c5eee951ccf25e1cc5db0ad5aed 100644 (file)
@@ -51,7 +51,7 @@ build_docproc: $(obj)/docproc
 
 subdir-$(CONFIG_MODVERSIONS) += genksyms
 subdir-y                     += mod
-subdir-$(CONFIG_DTRACE)      += dwarf2ctf
+subdir-$(CONFIG_CTF)         += dwarf2ctf
 subdir-$(CONFIG_SECURITY_SELINUX) += selinux
 subdir-$(CONFIG_DTC)         += dtc
 subdir-$(CONFIG_GDB_SCRIPTS) += gdb
index 8a94bea22553bf345819a10cb2a72700da7b5273..6b522fac214455cc4e7f9e6df21106c8ebea4279 100644 (file)
@@ -144,6 +144,7 @@ $(modules:.ko=.sdtstub.o): %.sdtstub.o: %.sdtstub.S
        $(call if_changed,as_o_S)
 
 module-sdt-modular-prereq = %.sdtstub.o
+sdtinfo-prereq = $(modules:.ko=.sdtinfo.c)
 
 else
 
@@ -151,6 +152,7 @@ $(modules:.ko=.mod.o): %.mod.o: %.mod.c FORCE
        $(call if_changed_dep,cc_o_c)
 
 module-sdt-modular-prereq =
+sdtinfo-prereq =
 
 endif
 
@@ -218,7 +220,7 @@ define add-ctf-filelists-cmd
        $(foreach file,$(1),$(call add-ctf-filelist-cmd,$(file)))
 endef
 
-$(ctf-filelist): $(builtins) $(modules:.ko=.o) | $(modules:.ko=.sdtinfo.c)
+$(ctf-filelist): $(builtins) $(modules:.ko=.o) | $(sdtinfo-prereq)
        @rm -f $(ctf-filelist);
        @mkdir -p $(ctf-dir);
        $(call add-ctf-filelists-cmd,$^)
@@ -227,7 +229,7 @@ $(ctf-filelist): $(builtins) $(modules:.ko=.o) | $(modules:.ko=.sdtinfo.c)
 # the names of the generated CTF files for the builtins are so variable.
 # (Standalone modules get their own per-module stamp files.)
 # The stamp file then depends on the .o files for the modules, and on the
-# sdtinfo files (for the same reason that the sdtstub does).
+# sdtinfo files, if any (for the same reason that the sdtstub does).
 $(ctf-stamp): $(ctf-filelist)
        $(call if_changed,ctf)
        @shopt -s nullglob; \
index 73a0016fce92051da9c4ddad3663f62d72862c7d..800dc20e1a15d2a255916dfb3c49761bd1d7f193 100644 (file)
@@ -1,5 +1,4 @@
-ifdef CONFIG_DTRACE
-ifndef CONFIG_DT_DISABLE_CTF
+ifdef CONFIG_CTF
 hostprogs-y    := dwarf2ctf
 always         := $(hostprogs-y)
 
@@ -10,4 +9,3 @@ HOSTCFLAGS_dwarf2ctf.o := $(shell pkg-config --cflags glib-2.0) -I$(srctree)/scr
 
 HOSTLOADLIBES_dwarf2ctf := -ldtrace-ctf -lelf -ldw $(shell pkg-config --libs glib-2.0) -lz
 endif
-endif