Makefile: remove BUILD_TAG from KBUILD_CFLAGS
Subsystems (2)
PATCH v3 1/1 Makefile: remove BUILD_TAG from KBUILD_CFLAGS
From: Stephen Warren <[email protected]>
If BUILD_TAG is part of KBUILD_CFLAGS, then any time the value changes, all files get rebuilt. In a continuous integration environment, the value will change every build. This wastes time, assuming that incremental builds would otherwise occur.
To solve this, remove BUILD_TAG from KBUILD_CFLAGS and add it to CFLAGS for just the one file that uses it. This does have the disadvantage that if any other files want to use the flag, we'll need to duplicate this custom CFLAGS setup logic. However, it seems unlikely we'll need this.
An alternative would be to add BUILD_TAG to the "local version" and remove the special case code from display_options.c. However, that would affect the format of the U-Boot signon message, which may negatively affect people looking for specific data there. The approach of using file-specific CFLAGS was suggested by Masahiro Yamada.
---
v3: Undo accidental removal of bch.o.
v2: Set CFLAGS on display_options.c rather than modifying scripts/setlocalversion to add BUILD_TAG to the local version.
--- Makefile | 4 ---- lib/Makefile | 1 + 2 files changed, 1 insertion(+), 4 deletions(-)
Makefile +0 -4
@@ -562,10 +562,6 @@ else KBUILD_CFLAGS += -O2 endif -ifdef BUILD_TAG -KBUILD_CFLAGS += -DBUILD_TAG='"$(BUILD_TAG)"' -endif - KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector) KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks)
lib/Makefile +1 -0
@@ -67,6 +67,7 @@ obj-$(CONFIG_ADDR_MAP) += addr_map.o obj-y += hashtable.o obj-y += errno.o obj-y += display_options.o +CFLAGS_display_options.o := $(if $(BUILD_TAG),-DBUILD_TAG='"$(BUILD_TAG)"') obj-$(CONFIG_BCH) += bch.o obj-y += crc32.o obj-y += ctype.o
Signature · 1 line
2.7.0
PATCH v3 1/1 Makefile: remove BUILD_TAG from KBUILD_CFLAGS
Quoted 12 lines · Stephen Warren
From: Stephen Warren <[email protected]>
If
BUILD_TAGis part ofKBUILD_CFLAGS, then any time the value changes, all files get rebuilt. In a continuous integration environment, the value will change every build. This wastes time, assuming that incremental builds would otherwise occur.To solve this, remove
BUILD_TAGfromKBUILD_CFLAGSand add it to CFLAGS for just the one file that uses it. This does have the disadvantage that if any other files want to use the flag, we'll need to duplicate this custom CFLAGS setup logic. However, it seems unlikely we'll need this.
Quoted 7 lines
An alternative would be to add
BUILD_TAGto the "local version" and remove the special case code fromdisplay_options.c. However, that would affect the format of the U-Boot signon message, which may negatively affect people looking for specific data there. The approach of using file-specific CFLAGS was suggested by Masahiro Yamada.Signed-off-by Stephen Warren <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160210/31a85690/attachment.sig>
PATCH v3 1/1 Makefile: remove BUILD_TAG from KBUILD_CFLAGS
In reply to Stephen Warren2016-02-11 7:16 GMT+09:00 Stephen Warren <[email protected]>:
Quoted 18 lines
From: Stephen Warren <[email protected]>
If
BUILD_TAGis part ofKBUILD_CFLAGS, then any time the value changes, all files get rebuilt. In a continuous integration environment, the value will change every build. This wastes time, assuming that incremental builds would otherwise occur.To solve this, remove
BUILD_TAGfromKBUILD_CFLAGSand add it to CFLAGS for just the one file that uses it. This does have the disadvantage that if any other files want to use the flag, we'll need to duplicate this custom CFLAGS setup logic. However, it seems unlikely we'll need this.An alternative would be to add
BUILD_TAGto the "local version" and remove the special case code fromdisplay_options.c. However, that would affect the format of the U-Boot signon message, which may negatively affect people looking for specific data there. The approach of using file-specific CFLAGS was suggested by Masahiro Yamada.
Quoted 5 lines
Signed-off-by Stephen Warren <[email protected]>---
v3: Undo accidental removal of bch.o.
v2: Set CFLAGS ondisplay_options.crather than modifyingscripts/setlocalversionto addBUILD_TAGto the local version.
Signature · 2 lines
Best Regards Masahiro Yamada
PATCH v3 1/1 Makefile: remove BUILD_TAG from KBUILD_CFLAGS
Quoted 19 lines · Masahiro Yamada
2016-02-11 7:16 GMT+09:00 Stephen Warren <[email protected]>:
Quoted 18 lines
From: Stephen Warren <[email protected]>
If
BUILD_TAGis part ofKBUILD_CFLAGS, then any time the value changes, all files get rebuilt. In a continuous integration environment, the value will change every build. This wastes time, assuming that incremental builds would otherwise occur.To solve this, remove
BUILD_TAGfromKBUILD_CFLAGSand add it to CFLAGS for just the one file that uses it. This does have the disadvantage that if any other files want to use the flag, we'll need to duplicate this custom CFLAGS setup logic. However, it seems unlikely we'll need this.An alternative would be to add
BUILD_TAGto the "local version" and remove the special case code fromdisplay_options.c. However, that would affect the format of the U-Boot signon message, which may negatively affect people looking for specific data there. The approach of using file-specific CFLAGS was suggested by Masahiro Yamada.
Quoted 8 lines
Quoted 5 lines
Signed-off-by Stephen Warren <[email protected]>---
v3: Undo accidental removal of bch.o.
v2: Set CFLAGS ondisplay_options.crather than modifyingscripts/setlocalversionto addBUILD_TAGto the local version.Reviewed-by Masahiro Yamada <[email protected]>
PATCH v3 1/1 Makefile: remove BUILD_TAG from KBUILD_CFLAGS
In reply to Stephen WarrenQuoted 18 lines · Stephen Warren
From: Stephen Warren <[email protected]>
If
BUILD_TAGis part ofKBUILD_CFLAGS, then any time the value changes, all files get rebuilt. In a continuous integration environment, the value will change every build. This wastes time, assuming that incremental builds would otherwise occur.To solve this, remove
BUILD_TAGfromKBUILD_CFLAGSand add it to CFLAGS for just the one file that uses it. This does have the disadvantage that if any other files want to use the flag, we'll need to duplicate this custom CFLAGS setup logic. However, it seems unlikely we'll need this.An alternative would be to add
BUILD_TAGto the "local version" and remove the special case code fromdisplay_options.c. However, that would affect the format of the U-Boot signon message, which may negatively affect people looking for specific data there. The approach of using file-specific CFLAGS was suggested by Masahiro Yamada.
Quoted 4 lines
Signed-off-by Stephen Warren <[email protected]>Reviewed-by Tom Rini <[email protected]>Reviewed-by Masahiro Yamada <[email protected]>Acked-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160215/a843e7d4/attachment.sig>