Fix: tests/Kbuild for older kernels
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 15 Jul 2016 15:29:33 +0000 (11:29 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 15 Jul 2016 15:34:40 +0000 (11:34 -0400)
Older kernels (e.g. 2.6.38.8) don't seem to handle subdirectory in the
same way as recent kernels (e.g. 4.6). As a result, building LTTng
out-of-tree within a kernel modified to have LTTng as a built-in addon
fails with CONFIG_LTTNG=m.

$ make all O=../kernel_builddir
.....
  CC [M]  lttng/probes/lttng-kprobes.o
  CC [M]  lttng/probes/lttng-kretprobes.o
  LD      lttng/tests/built-in.o
  CC [M]  lttng/tests/probes/lttng-test.o
Assembler messages:
Fatal error: can't create lttng/tests/probes/lttng-test.o: No such
file or directory
/media/awallin/sda1/home/awallin/src/lttng-test/linux-2.6/scripts/Makefile.build:264:
recipe for target 'lttng/tests/probes/lttng-test.o' failed
make[3]: *** [lttng/tests/probes/lttng-test.o] Error 2
/media/awallin/sda1/home/awallin/src/lttng-test/linux-2.6/scripts/Makefile.build:403:
recipe for target 'lttng/tests' failed
make[2]: *** [lttng/tests] Error 2
/media/awallin/sda1/home/awallin/src/lttng-test/linux-2.6/Makefile:946:
recipe for target 'lttng' failed
make[1]: *** [lttng] Error 2
make[1]: Leaving directory
'/media/awallin/sda1/home/awallin/src/lttng-test/kernel_builddir'
Makefile:146: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

$tree ../kernel_builddir/lttng/tests/
../kernel_builddir/lttng/tests/
└── built-in.o

Reported-by: Anders Wallin <anders.wallin@windriver.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/Kbuild

index 340b71bbdb9f710561e1d63b513c8dd1b032e744..5e49007abc0d41eb95441be4aaec2fde67c8b571 100644 (file)
@@ -4,8 +4,10 @@ include $(TOP_LTTNG_MODULES_DIR)/Makefile.ABI.workarounds
 
 ccflags-y += -I$(TOP_LTTNG_MODULES_DIR)
 
-obj-$(CONFIG_LTTNG) += probes/lttng-test.o
+obj-$(CONFIG_LTTNG) += lttng-test.o
+lttng-test-objs := probes/lttng-test.o
 
-obj-$(CONFIG_LTTNG) += clock-plugin/lttng-clock-plugin-test.o
+obj-$(CONFIG_LTTNG) += lttng-clock-plugin-test.o
+lttng-clock-plugin-test-objs := clock-plugin/lttng-clock-plugin-test.o
 
 # vim:syntax=make
This page took 0.025498 seconds and 4 git commands to generate.