All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] btrfs-progs: build: generate all dependency files
@ 2017-09-14 10:10 Naohiro Aota
  2017-09-14 10:10 ` [PATCH 2/2] btrfs: build: omit unnecessary -MD flag Naohiro Aota
  2017-09-14 12:41 ` [PATCH 1/2] btrfs-progs: build: generate all dependency files David Sterba
  0 siblings, 2 replies; 5+ messages in thread
From: Naohiro Aota @ 2017-09-14 10:10 UTC (permalink / raw)
  To: linux-btrfs; +Cc: dsterba

We're missing several dependency files like:

$ diff -u <(find -name '*.o'|cut -d. -f2|sort) <(find -name '*.o.d'|cut -d. -f2|sort)
--- /proc/self/fd/11    2017-09-14 18:17:44.460564620 +0900
+++ /proc/self/fd/12    2017-09-14 18:17:44.460564620 +0900
@@ -3,7 +3,6 @@
 /btrfs-corrupt-block
 /btrfs-debug-tree
 /btrfs-find-root
-/btrfs-list
 /btrfs-map-logical
 /btrfs-select-super
 /btrfstune
@@ -29,11 +28,6 @@
 /cmds-scrub
 /cmds-send
 /cmds-subvolume
-/convert/common
-/convert/main
-/convert/source-ext2
-/convert/source-fs
-/convert/source-reiserfs
 /ctree
 /dir-item
 /disk-io
<snip>

This is due to moving things out of objects and cmds_objects variables. Such
missing dependency files cause mis-building of some source files (try touch
utils.h; make mkfs/main.o).

This patch introduce a new variable "all_objects" to keep all the objects and
use the variable to generate proper dependency file building rules.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 Makefile |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index a114eca..c00dff6 100644
--- a/Makefile
+++ b/Makefile
@@ -121,6 +121,9 @@ libbtrfs_headers = send-stream.h send-utils.h send.h kernel-lib/rbtree.h btrfs-l
 convert_objects = convert/main.o convert/common.o convert/source-fs.o \
 		  convert/source-ext2.o convert/source-reiserfs.o
 mkfs_objects = mkfs/main.o mkfs/common.o
+image_objects = image/main.o
+all_objects = $(objects) $(cmds_objects) $(libbtrfs_objects) $(convert_objects) \
+	      $(mkfs_objects) $(image_objects)
 
 TESTS = fsck-tests.sh convert-tests.sh
 
@@ -591,5 +594,5 @@ uninstall:
 	cd $(DESTDIR)$(bindir); $(RM) -f -- btrfsck fsck.btrfs $(progs_install)
 
 ifneq ($(MAKECMDGOALS),clean)
--include $(objects:.o=.o.d) $(cmds_objects:.o=.o.d) $(subst .btrfs,, $(filter-out btrfsck.o.d, $(progs:=.o.d)))
+-include $(all_objects:.o=.o.d) $(subst .btrfs,, $(filter-out btrfsck.o.d, $(progs:=.o.d)))
 endif


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

* [PATCH 2/2] btrfs: build: omit unnecessary -MD flag
  2017-09-14 10:10 [PATCH 1/2] btrfs-progs: build: generate all dependency files Naohiro Aota
@ 2017-09-14 10:10 ` Naohiro Aota
  2017-09-14 12:42   ` David Sterba
  2017-09-14 12:41 ` [PATCH 1/2] btrfs-progs: build: generate all dependency files David Sterba
  1 sibling, 1 reply; 5+ messages in thread
From: Naohiro Aota @ 2017-09-14 10:10 UTC (permalink / raw)
  To: linux-btrfs; +Cc: dsterba

According to gcc(1), "-MD is equivalent to -M -MF file, except that -E is not
implied." Since the rule in the Makefile is just generating dependency file
and not building object file, it is no use to have "-MD" here. Also, it's
overridden and conflicting with the following "-MM" flag. I guess we can drop
it.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index c00dff6..60c802a 100644
--- a/Makefile
+++ b/Makefile
@@ -264,7 +264,7 @@ else
 endif
 
 %.o.d: %.c
-	$(Q)$(CC) -MD -MM -MG -MF $@ -MT $(@:.o.d=.o) -MT $(@:.o.d=.static.o) -MT $@ $(CFLAGS) $<
+	$(Q)$(CC) -MM -MG -MF $@ -MT $(@:.o.d=.o) -MT $(@:.o.d=.static.o) -MT $@ $(CFLAGS) $<
 
 #
 # Pick from per-file variables, btrfs_*_cflags


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

* Re: [PATCH 1/2] btrfs-progs: build: generate all dependency files
  2017-09-14 10:10 [PATCH 1/2] btrfs-progs: build: generate all dependency files Naohiro Aota
  2017-09-14 10:10 ` [PATCH 2/2] btrfs: build: omit unnecessary -MD flag Naohiro Aota
@ 2017-09-14 12:41 ` David Sterba
  2017-09-15  2:34   ` Naohiro Aota
  1 sibling, 1 reply; 5+ messages in thread
From: David Sterba @ 2017-09-14 12:41 UTC (permalink / raw)
  To: Naohiro Aota; +Cc: linux-btrfs

On Thu, Sep 14, 2017 at 07:10:46PM +0900, Naohiro Aota wrote:
> We're missing several dependency files like:
> 
> $ diff -u <(find -name '*.o'|cut -d. -f2|sort) <(find -name '*.o.d'|cut -d. -f2|sort)
>    --- /proc/self/fd/11    2017-09-14 18:17:44.460564620 +0900
>    +++ /proc/self/fd/12    2017-09-14 18:17:44.460564620 +0900

Please note that an actual diff in the changelog is understood as start
of the patch by git-am, indenting the --- or +++ lines makes it work
again.

> @@ -3,7 +3,6 @@
>  /btrfs-corrupt-block
>  /btrfs-debug-tree
>  /btrfs-find-root
> -/btrfs-list
>  /btrfs-map-logical
>  /btrfs-select-super
>  /btrfstune
> @@ -29,11 +28,6 @@
>  /cmds-scrub
>  /cmds-send
>  /cmds-subvolume
> -/convert/common
> -/convert/main
> -/convert/source-ext2
> -/convert/source-fs
> -/convert/source-reiserfs
>  /ctree
>  /dir-item
>  /disk-io
> <snip>
> 
> This is due to moving things out of objects and cmds_objects variables. Such
> missing dependency files cause mis-building of some source files (try touch
> utils.h; make mkfs/main.o).
> 
> This patch introduce a new variable "all_objects" to keep all the objects and
> use the variable to generate proper dependency file building rules.
> 
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>

Applied, thanks.

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

* Re: [PATCH 2/2] btrfs: build: omit unnecessary -MD flag
  2017-09-14 10:10 ` [PATCH 2/2] btrfs: build: omit unnecessary -MD flag Naohiro Aota
@ 2017-09-14 12:42   ` David Sterba
  0 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2017-09-14 12:42 UTC (permalink / raw)
  To: Naohiro Aota; +Cc: linux-btrfs

On Thu, Sep 14, 2017 at 07:10:56PM +0900, Naohiro Aota wrote:
> According to gcc(1), "-MD is equivalent to -M -MF file, except that -E is not
> implied." Since the rule in the Makefile is just generating dependency file
> and not building object file, it is no use to have "-MD" here. Also, it's
> overridden and conflicting with the following "-MM" flag. I guess we can drop
> it.
> 
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>

Applied, thanks.

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

* Re: [PATCH 1/2] btrfs-progs: build: generate all dependency files
  2017-09-14 12:41 ` [PATCH 1/2] btrfs-progs: build: generate all dependency files David Sterba
@ 2017-09-15  2:34   ` Naohiro Aota
  0 siblings, 0 replies; 5+ messages in thread
From: Naohiro Aota @ 2017-09-15  2:34 UTC (permalink / raw)
  To: dsterba, linux-btrfs

On 2017年09月14日 21:41, David Sterba wrote:
> On Thu, Sep 14, 2017 at 07:10:46PM +0900, Naohiro Aota wrote:
>> We're missing several dependency files like:
>>
>> $ diff -u <(find -name '*.o'|cut -d. -f2|sort) <(find -name '*.o.d'|cut -d. -f2|sort)
>>    --- /proc/self/fd/11    2017-09-14 18:17:44.460564620 +0900
>>    +++ /proc/self/fd/12    2017-09-14 18:17:44.460564620 +0900
> 
> Please note that an actual diff in the changelog is understood as start
> of the patch by git-am, indenting the --- or +++ lines makes it work
> again.

Oops, I forgot about that limitation. Thank you for the fix.

> 
>> @@ -3,7 +3,6 @@
>>  /btrfs-corrupt-block
>>  /btrfs-debug-tree
>>  /btrfs-find-root
>> -/btrfs-list
>>  /btrfs-map-logical
>>  /btrfs-select-super
>>  /btrfstune
>> @@ -29,11 +28,6 @@
>>  /cmds-scrub
>>  /cmds-send
>>  /cmds-subvolume
>> -/convert/common
>> -/convert/main
>> -/convert/source-ext2
>> -/convert/source-fs
>> -/convert/source-reiserfs
>>  /ctree
>>  /dir-item
>>  /disk-io
>> <snip>
>>
>> This is due to moving things out of objects and cmds_objects variables. Such
>> missing dependency files cause mis-building of some source files (try touch
>> utils.h; make mkfs/main.o).
>>
>> This patch introduce a new variable "all_objects" to keep all the objects and
>> use the variable to generate proper dependency file building rules.
>>
>> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> 
> Applied, thanks.
> 

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

end of thread, other threads:[~2017-09-15  2:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-14 10:10 [PATCH 1/2] btrfs-progs: build: generate all dependency files Naohiro Aota
2017-09-14 10:10 ` [PATCH 2/2] btrfs: build: omit unnecessary -MD flag Naohiro Aota
2017-09-14 12:42   ` David Sterba
2017-09-14 12:41 ` [PATCH 1/2] btrfs-progs: build: generate all dependency files David Sterba
2017-09-15  2:34   ` Naohiro Aota

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.