Hi Herbert, > -----Original Message----- > From: Herbert Xu [mailto:herbert@xxxxxxxxxxxxxxxxxxx] > Sent: Thursday, June 20, 2019 3:40 PM > To: Steve French <stfrench@xxxxxxxxxxxxx>; linux-cifs@xxxxxxxxxxxxxxx > Cc: Yamada, Masahiro/山田 真弘 <yamada.masahiro@xxxxxxxxxxxxx> > Subject: cifs: Fix tracing build error with O= > > Currently if you build the kernel with O= then fs/cifs fails with: > > $ make O=build > ... > CC [M] fs/cifs/trace.o > In file included from ../fs/cifs/trace.h:846:0, > from ../fs/cifs/trace.c:8: > ../include/trace/define_trace.h:95:43: fatal error: ./trace.h: No such > file or directory > #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) > ^ > compilation terminated. Which kernel version are you testing? I cannot reproduce the build error on the latest Linus tree. $ make O=build allmodconfig fs/cifs/ perfectly works for me. In fact, Kbuild automatically adds "-I $(srctree)/$(src)" for O=... building See this code: https://github.com/torvalds/linux/blob/v5.2-rc5/scripts/Makefile.lib#L144 So, I wonder why you need to duplicate "-I $(srctree)/$(src)" Thanks. > > The reason is that -I$(src) expands to -Ifs/cifs which does not > work with O=. This patch fixes it by adding srctree to the front. > > Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> > > diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile > index 51af69a1a328..616163deee18 100644 > --- a/fs/cifs/Makefile > +++ b/fs/cifs/Makefile > @@ -2,7 +2,7 @@ > # > # Makefile for Linux CIFS/SMB2/SMB3 VFS client > # > -ccflags-y += -I$(src) # needed for trace events > +ccflags-y += -I$(srctree)/$(src) # needed for trace > events > obj-$(CONFIG_CIFS) += cifs.o > > cifs-y := trace.o cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o > \ > -- > Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> > Home Page: http://gondor.apana.org.au/~herbert/ > PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt