From: Nick Alcock Date: Thu, 14 Jul 2016 17:05:24 +0000 (+0100) Subject: ctf: fix CONFIG_CTF && !CONFIG_DTRACE and CONFIG_DT_DISABLE_CTF X-Git-Tag: v4.1.12-92~59^2~2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a65f50e6b73076ad4518c745a4e518c70746a663;p=users%2Fjedix%2Flinux-maple.git ctf: fix CONFIG_CTF && !CONFIG_DTRACE and CONFIG_DT_DISABLE_CTF 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 Reviewed-By: Todd Vierling --- diff --git a/kernel/ctf/Kconfig b/kernel/ctf/Kconfig index 571e26c51b96..692258af194c 100644 --- a/kernel/ctf/Kconfig +++ b/kernel/ctf/Kconfig @@ -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 diff --git a/scripts/Makefile b/scripts/Makefile index ab907e9284bd..9f00a7c7f867 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -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 diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 8a94bea22553..6b522fac2144 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -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; \ diff --git a/scripts/dwarf2ctf/Makefile b/scripts/dwarf2ctf/Makefile index 73a0016fce92..800dc20e1a15 100644 --- a/scripts/dwarf2ctf/Makefile +++ b/scripts/dwarf2ctf/Makefile @@ -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