diff mbox

kbuild: make KBUILD_NOCMDDEP=1 handle empty built-in.o

Message ID 1303837564-18062-1-git-send-email-rabin@rab.in (mailing list archive)
State New, archived
Headers show

Commit Message

Rabin Vincent April 26, 2011, 5:06 p.m. UTC
Fix building with KBUILD_NOCMDDEP=1, which currently does not work
because it does not build built-in.o with no dependencies:

  LD      fs/notify/built-in.o
ld: cannot find fs/notify/dnotify/built-in.o: No such file or directory
ld: cannot find fs/notify/inotify/built-in.o: No such file or directory
ld: cannot find fs/notify/fanotify/built-in.o: No such file or directory

Signed-off-by: Rabin Vincent <rabin@rab.in>
---
 scripts/Kbuild.include |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Comments

Rabin Vincent May 11, 2011, 5:30 p.m. UTC | #1
On Tue, Apr 26, 2011 at 22:36, Rabin Vincent <rabin@rab.in> wrote:
> Fix building with KBUILD_NOCMDDEP=1, which currently does not work
> because it does not build built-in.o with no dependencies:
>
>  LD      fs/notify/built-in.o
> ld: cannot find fs/notify/dnotify/built-in.o: No such file or directory
> ld: cannot find fs/notify/inotify/built-in.o: No such file or directory
> ld: cannot find fs/notify/fanotify/built-in.o: No such file or directory
>
> Signed-off-by: Rabin Vincent <rabin@rab.in>

Any comments on this patch?  I found KBUILD_NOCMDDEP useful
when hunting down a bug that appeared only in a certain compiler
version.  Used it to build some files using one compiler and the rest
using the other.  It would be nice if it worked out of the box; it will
after this patch.

> ---
>  scripts/Kbuild.include |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
> index ed2773e..fd31781 100644
> --- a/scripts/Kbuild.include
> +++ b/scripts/Kbuild.include
> @@ -187,6 +187,10 @@ ifneq ($(KBUILD_NOCMDDEP),1)
>  # User may override this check using make KBUILD_NOCMDDEP=1
>  arg-check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \
>                     $(filter-out $(cmd_$@),   $(cmd_$(1))) )
> +else
> +# Ensure that files with no dependencies are built.
> +built-check = $(filter $(origin cmd_$@), undefined)
> +arg-check = $(if $(strip $(obj-y)),,$(built-check))
>  endif
>
>  # >'< substitution is for echo to work,
> --
> 1.7.4.1
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index ed2773e..fd31781 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -187,6 +187,10 @@  ifneq ($(KBUILD_NOCMDDEP),1)
 # User may override this check using make KBUILD_NOCMDDEP=1
 arg-check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \
                     $(filter-out $(cmd_$@),   $(cmd_$(1))) )
+else
+# Ensure that files with no dependencies are built.
+built-check = $(filter $(origin cmd_$@), undefined)
+arg-check = $(if $(strip $(obj-y)),,$(built-check))
 endif
 
 # >'< substitution is for echo to work,