* [PATCH] tools: gpio: Correctly add make dependencies for gpio_utils
@ 2019-11-12 22:10 Laura Abbott
2019-11-13 12:47 ` Bartosz Golaszewski
0 siblings, 1 reply; 2+ messages in thread
From: Laura Abbott @ 2019-11-12 22:10 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski; +Cc: Laura Abbott, linux-gpio, linux-kernel
gpio tools fail to build correctly with make parallelization:
$ make -s -j24
ld: gpio-utils.o: file not recognized: file truncated
make[1]: *** [/home/labbott/linux_upstream/tools/build/Makefile.build:145: lsgpio-in.o] Error 1
make: *** [Makefile:43: lsgpio-in.o] Error 2
make: *** Waiting for unfinished jobs....
This is because gpio-utils.o is used across multiple targets.
Fix this by making gpio-utios.o a proper dependency.
Signed-off-by: Laura Abbott <labbott@redhat.com>
---
I made a similar fix to iio tools
lore.kernel.org/r/20191018172908.3761-1-labbott@redhat.com
---
tools/gpio/Build | 1 +
tools/gpio/Makefile | 10 +++++++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/gpio/Build b/tools/gpio/Build
index 620c1937d957..4141f35837db 100644
--- a/tools/gpio/Build
+++ b/tools/gpio/Build
@@ -1,3 +1,4 @@
+gpio-utils-y += gpio-utils.o
lsgpio-y += lsgpio.o gpio-utils.o
gpio-hammer-y += gpio-hammer.o gpio-utils.o
gpio-event-mon-y += gpio-event-mon.o gpio-utils.o
diff --git a/tools/gpio/Makefile b/tools/gpio/Makefile
index 1178d302757e..6080de58861f 100644
--- a/tools/gpio/Makefile
+++ b/tools/gpio/Makefile
@@ -35,11 +35,15 @@ $(OUTPUT)include/linux/gpio.h: ../../include/uapi/linux/gpio.h
prepare: $(OUTPUT)include/linux/gpio.h
+GPIO_UTILS_IN := $(output)gpio-utils-in.o
+$(GPIO_UTILS_IN): prepare FORCE
+ $(Q)$(MAKE) $(build)=gpio-utils
+
#
# lsgpio
#
LSGPIO_IN := $(OUTPUT)lsgpio-in.o
-$(LSGPIO_IN): prepare FORCE
+$(LSGPIO_IN): prepare FORCE $(OUTPUT)gpio-utils-in.o
$(Q)$(MAKE) $(build)=lsgpio
$(OUTPUT)lsgpio: $(LSGPIO_IN)
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
@@ -48,7 +52,7 @@ $(OUTPUT)lsgpio: $(LSGPIO_IN)
# gpio-hammer
#
GPIO_HAMMER_IN := $(OUTPUT)gpio-hammer-in.o
-$(GPIO_HAMMER_IN): prepare FORCE
+$(GPIO_HAMMER_IN): prepare FORCE $(OUTPUT)gpio-utils-in.o
$(Q)$(MAKE) $(build)=gpio-hammer
$(OUTPUT)gpio-hammer: $(GPIO_HAMMER_IN)
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
@@ -57,7 +61,7 @@ $(OUTPUT)gpio-hammer: $(GPIO_HAMMER_IN)
# gpio-event-mon
#
GPIO_EVENT_MON_IN := $(OUTPUT)gpio-event-mon-in.o
-$(GPIO_EVENT_MON_IN): prepare FORCE
+$(GPIO_EVENT_MON_IN): prepare FORCE $(OUTPUT)gpio-utils-in.o
$(Q)$(MAKE) $(build)=gpio-event-mon
$(OUTPUT)gpio-event-mon: $(GPIO_EVENT_MON_IN)
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
--
2.21.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tools: gpio: Correctly add make dependencies for gpio_utils
2019-11-12 22:10 [PATCH] tools: gpio: Correctly add make dependencies for gpio_utils Laura Abbott
@ 2019-11-13 12:47 ` Bartosz Golaszewski
0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2019-11-13 12:47 UTC (permalink / raw)
To: Laura Abbott; +Cc: Linus Walleij, linux-gpio, LKML
wt., 12 lis 2019 o 23:10 Laura Abbott <labbott@redhat.com> napisał(a):
>
>
> gpio tools fail to build correctly with make parallelization:
>
> $ make -s -j24
> ld: gpio-utils.o: file not recognized: file truncated
> make[1]: *** [/home/labbott/linux_upstream/tools/build/Makefile.build:145: lsgpio-in.o] Error 1
> make: *** [Makefile:43: lsgpio-in.o] Error 2
> make: *** Waiting for unfinished jobs....
>
> This is because gpio-utils.o is used across multiple targets.
> Fix this by making gpio-utios.o a proper dependency.
>
> Signed-off-by: Laura Abbott <labbott@redhat.com>
> ---
> I made a similar fix to iio tools
> lore.kernel.org/r/20191018172908.3761-1-labbott@redhat.com
> ---
> tools/gpio/Build | 1 +
> tools/gpio/Makefile | 10 +++++++---
> 2 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/tools/gpio/Build b/tools/gpio/Build
> index 620c1937d957..4141f35837db 100644
> --- a/tools/gpio/Build
> +++ b/tools/gpio/Build
> @@ -1,3 +1,4 @@
> +gpio-utils-y += gpio-utils.o
> lsgpio-y += lsgpio.o gpio-utils.o
> gpio-hammer-y += gpio-hammer.o gpio-utils.o
> gpio-event-mon-y += gpio-event-mon.o gpio-utils.o
> diff --git a/tools/gpio/Makefile b/tools/gpio/Makefile
> index 1178d302757e..6080de58861f 100644
> --- a/tools/gpio/Makefile
> +++ b/tools/gpio/Makefile
> @@ -35,11 +35,15 @@ $(OUTPUT)include/linux/gpio.h: ../../include/uapi/linux/gpio.h
>
> prepare: $(OUTPUT)include/linux/gpio.h
>
> +GPIO_UTILS_IN := $(output)gpio-utils-in.o
> +$(GPIO_UTILS_IN): prepare FORCE
> + $(Q)$(MAKE) $(build)=gpio-utils
> +
> #
> # lsgpio
> #
> LSGPIO_IN := $(OUTPUT)lsgpio-in.o
> -$(LSGPIO_IN): prepare FORCE
> +$(LSGPIO_IN): prepare FORCE $(OUTPUT)gpio-utils-in.o
> $(Q)$(MAKE) $(build)=lsgpio
> $(OUTPUT)lsgpio: $(LSGPIO_IN)
> $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
> @@ -48,7 +52,7 @@ $(OUTPUT)lsgpio: $(LSGPIO_IN)
> # gpio-hammer
> #
> GPIO_HAMMER_IN := $(OUTPUT)gpio-hammer-in.o
> -$(GPIO_HAMMER_IN): prepare FORCE
> +$(GPIO_HAMMER_IN): prepare FORCE $(OUTPUT)gpio-utils-in.o
> $(Q)$(MAKE) $(build)=gpio-hammer
> $(OUTPUT)gpio-hammer: $(GPIO_HAMMER_IN)
> $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
> @@ -57,7 +61,7 @@ $(OUTPUT)gpio-hammer: $(GPIO_HAMMER_IN)
> # gpio-event-mon
> #
> GPIO_EVENT_MON_IN := $(OUTPUT)gpio-event-mon-in.o
> -$(GPIO_EVENT_MON_IN): prepare FORCE
> +$(GPIO_EVENT_MON_IN): prepare FORCE $(OUTPUT)gpio-utils-in.o
> $(Q)$(MAKE) $(build)=gpio-event-mon
> $(OUTPUT)gpio-event-mon: $(GPIO_EVENT_MON_IN)
> $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
> --
> 2.21.0
>
Applied for fixes, thanks!
Bartosz
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-11-13 12:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-12 22:10 [PATCH] tools: gpio: Correctly add make dependencies for gpio_utils Laura Abbott
2019-11-13 12:47 ` Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).