Re: [PATCH 3/6] kbuild: add arch specific post-link pass

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> diff --git a/Makefile b/Makefile
> index 1d26fdb..20d3bfd 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -954,8 +954,14 @@ include/generated/autoksyms.h: FORCE
>        cmd_link-vmlinux = $(CONFIG_SHELL) $< $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux)
>  quiet_cmd_link-vmlinux = LINK    $@
>  
> +# Optional arch pass after final link
> +ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
> +      cmd_postlink-vmlinux = \
> +          $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
> +
>  vmlinux: scripts/link-vmlinux.sh vmlinux_prereq $(vmlinux-deps) FORCE
>  	+$(call if_changed,link-vmlinux)
> +	+$(call if_changed,postlink-vmlinux)
>  
>  # Build samples along the rest of the kernel
>  ifdef CONFIG_SAMPLES
> @@ -1279,6 +1285,7 @@ $(clean-dirs):
>  
>  vmlinuxclean:
>  	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean
> +	$(Q)$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) clean)
>  
>  clean: archclean vmlinuxclean
>  
Another option would be to embed the logic in the link-vmlinux shell script.
It is much simpler for normal humans to read and understand shell scripts,
and it would be simpler too.


> diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
> index 1366a94..a3e862e 100644
> --- a/scripts/Makefile.modpost
> +++ b/scripts/Makefile.modpost
> @@ -121,8 +121,14 @@ quiet_cmd_ld_ko_o = LD [M]  $@
>                               $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \
>                               -o $@ $(filter-out FORCE,$^)
>  
> +# Optional arch pass after final link
> +ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
> +      cmd_postlink-ko = \
> +          $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
> +
>  $(modules): %.ko :%.o %.mod.o FORCE
>  	$(call if_changed,ld_ko_o)
> +	+$(call if_changed,postlink-ko)
For modules we have no script, so here we need this.

	Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux