public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* can't build modules after clean for powerpc
@ 2011-08-17  0:36 Darren Hart
  2011-08-17  7:49 ` Sam Ravnborg
  0 siblings, 1 reply; 3+ messages in thread
From: Darren Hart @ 2011-08-17  0:36 UTC (permalink / raw)
  To: lkml, ; +Cc: Paul Mackerras, Gary Thomas, Woodhouse, David

According to the Makefile comments and
Documentation/kconfig/makefile.txt, make clean should leave enough
intact to build modules with:

###
# Cleaning is done on three levels.
# make clean     Delete most generated files
#                Leave enough to build external modules

The following line in the arch/powerpc/Makefile prevents that from working:

KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o

External module compilation fails to link as it can't find
arch/powerpc/lib/crtsavres.o.

It appears from the make logs that crtsavres.o is linked in to
built-in.o, and thus vmlinux. If that is the case, it doesn't seem like
crtsavres.o should need to be singled out. What am I missing here?

If I comment it out:

#KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o

my example module builds successfully.

If it is necessary, then we need a means to instruct the top level
makefile to not delete it during "clean". Is there such a directive?

KBUILD_CLEAN_EXCLUDE_MODULES or something?

Thanks,

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: can't build modules after clean for powerpc
  2011-08-17  0:36 can't build modules after clean for powerpc Darren Hart
@ 2011-08-17  7:49 ` Sam Ravnborg
  2011-08-17 19:02   ` Darren Hart
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Ravnborg @ 2011-08-17  7:49 UTC (permalink / raw)
  To: Darren Hart; +Cc: lkml, , Paul Mackerras, Gary Thomas, Woodhouse, David

On Tue, Aug 16, 2011 at 05:36:56PM -0700, Darren Hart wrote:
> According to the Makefile comments and
> Documentation/kconfig/makefile.txt, make clean should leave enough
> intact to build modules with:
> 
> ###
> # Cleaning is done on three levels.
> # make clean     Delete most generated files
> #                Leave enough to build external modules
> 
> The following line in the arch/powerpc/Makefile prevents that from working:
> 
> KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
> 
> External module compilation fails to link as it can't find
> arch/powerpc/lib/crtsavres.o.
> 
> It appears from the make logs that crtsavres.o is linked in to
> built-in.o, and thus vmlinux. If that is the case, it doesn't seem like
> crtsavres.o should need to be singled out. What am I missing here?
> 
> If I comment it out:
> 
> #KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
> 
> my example module builds successfully.
> 
> If it is necessary, then we need a means to instruct the top level
> makefile to not delete it during "clean". Is there such a directive?
> 
> KBUILD_CLEAN_EXCLUDE_MODULES or something?

Hi Darren.
Try this small patch. Untested and cut'n'pasted...

	Sam


diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 166a6a0..7a577f8 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -30,3 +30,6 @@ obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o
 obj-y                  += code-patching.o
 obj-y                  += feature-fixups.o
 obj-$(CONFIG_FTR_FIXUP_SELFTEST) += feature-fixups-test.o
+
+# crtsavres is used by modules - so we need it after "make clean"
+no-clean-files := crtsavres.o


> 
> Thanks,
> 
> -- 
> Darren Hart
> Intel Open Source Technology Center
> Yocto Project - Linux Kernel
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
> 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: can't build modules after clean for powerpc
  2011-08-17  7:49 ` Sam Ravnborg
@ 2011-08-17 19:02   ` Darren Hart
  0 siblings, 0 replies; 3+ messages in thread
From: Darren Hart @ 2011-08-17 19:02 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: lkml, , Paul Mackerras, Gary Thomas, Woodhouse, David

On 08/17/2011 12:49 AM, Sam Ravnborg wrote:
> On Tue, Aug 16, 2011 at 05:36:56PM -0700, Darren Hart wrote:
>> According to the Makefile comments and
>> Documentation/kconfig/makefile.txt, make clean should leave enough
>> intact to build modules with:
>>
>> ###
>> # Cleaning is done on three levels.
>> # make clean     Delete most generated files
>> #                Leave enough to build external modules
>>
>> The following line in the arch/powerpc/Makefile prevents that from working:
>>
>> KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
>>
>> External module compilation fails to link as it can't find
>> arch/powerpc/lib/crtsavres.o.
>>
>> It appears from the make logs that crtsavres.o is linked in to
>> built-in.o, and thus vmlinux. If that is the case, it doesn't seem like
>> crtsavres.o should need to be singled out. What am I missing here?
>>
>> If I comment it out:
>>
>> #KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
>>
>> my example module builds successfully.
>>
>> If it is necessary, then we need a means to instruct the top level
>> makefile to not delete it during "clean". Is there such a directive?
>>
>> KBUILD_CLEAN_EXCLUDE_MODULES or something?
> 
> Hi Darren.
> Try this small patch. Untested and cut'n'pasted...
> 
> 	Sam
> 

Hi Sam,

> 
> diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
> index 166a6a0..7a577f8 100644
> --- a/arch/powerpc/lib/Makefile
> +++ b/arch/powerpc/lib/Makefile
> @@ -30,3 +30,6 @@ obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o
>  obj-y                  += code-patching.o
>  obj-y                  += feature-fixups.o
>  obj-$(CONFIG_FTR_FIXUP_SELFTEST) += feature-fixups-test.o
> +
> +# crtsavres is used by modules - so we need it after "make clean"
> +no-clean-files := crtsavres.o

This doesn't cut it unfortunately:

linux-powerpc-poky-linux-ld: cannot find arch/powerpc/lib/crtsavres.o:
No such file or directory

The .o file is purged by the top level Makefile here:

 clean: $(clean-dirs)
	$(call cmd,rmdirs)
	$(call cmd,rmfiles)
	@find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
		\( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
		-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
		-o -name '*.symtypes' -o -name 'modules.order' \
		-o -name modules.builtin -o -name '.tmp_*.o.*' \
		-o -name '*.gcno' \) -type f -print | xargs rm -f

Which is why I was thinking of something similar to RCS_FIND_IGNORE that
we could use, like KBUILD_FIND_IGNORE_MODULE.

--
Darren

> 
>>
>> Thanks,
>>
>> -- 
>> Darren Hart
>> Intel Open Source Technology Center
>> Yocto Project - Linux Kernel
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>>
>>

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-17 19:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-17  0:36 can't build modules after clean for powerpc Darren Hart
2011-08-17  7:49 ` Sam Ravnborg
2011-08-17 19:02   ` Darren Hart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox