[U-Boot] [PATCH 2/3] build: Drop CONFIG_SPL_BUILD guards in some cases

Tom Rini trini at konsulko.com
Fri Dec 22 03:13:22 UTC 2017


Given gcc-6.1 and later we can now safely have strings discarded when
the functions are unused.  This lets us drop certain cases of not
building something so that we don't have the strings brought in when the
code was discarded.  Simplify the code now by dropping guards we don't
need now.

Cc: Stefano Babic <sbabic at denx.de>
Cc: Fabio Estevam <fabio.estevam at nxp.com>
Cc: Chander Kashyap <k.chander at samsung.com>
Cc: Thomas Abraham <thomas.ab at samsung.com>
Cc: Vipin Kumar <vipin.kumar at st.com>
Cc: Wenyou Yang <wenyou.yang at microchip.com>
Signed-off-by: Tom Rini <trini at konsulko.com>
---
 arch/arm/cpu/arm1136/mx31/Makefile   | 5 +----
 arch/arm/cpu/arm1136/mx35/Makefile   | 5 +----
 arch/arm/cpu/arm926ejs/mx25/Makefile | 6 +-----
 arch/arm/cpu/arm926ejs/mx27/Makefile | 6 +-----
 arch/sandbox/lib/Makefile            | 2 --
 board/atmel/common/Makefile          | 2 --
 board/samsung/arndale/Makefile       | 3 ---
 board/samsung/espresso7420/Makefile  | 2 --
 board/spear/spear600/Makefile        | 4 +---
 9 files changed, 5 insertions(+), 30 deletions(-)

diff --git a/arch/arm/cpu/arm1136/mx31/Makefile b/arch/arm/cpu/arm1136/mx31/Makefile
index dcbd57065bbc..774f352ece81 100644
--- a/arch/arm/cpu/arm1136/mx31/Makefile
+++ b/arch/arm/cpu/arm1136/mx31/Makefile
@@ -8,7 +8,4 @@
 obj-y	+= generic.o
 obj-y	+= timer.o
 obj-y	+= devices.o
-
-ifndef CONFIG_SPL_BUILD
-obj-y  += relocate.o
-endif
+obj-y	+= relocate.o
diff --git a/arch/arm/cpu/arm1136/mx35/Makefile b/arch/arm/cpu/arm1136/mx35/Makefile
index 796db9c7cc75..e4c8e2e6849a 100644
--- a/arch/arm/cpu/arm1136/mx35/Makefile
+++ b/arch/arm/cpu/arm1136/mx35/Makefile
@@ -10,7 +10,4 @@
 obj-y	+= generic.o
 obj-y	+= timer.o
 obj-y	+= mx35_sdram.o
-
-ifndef CONFIG_SPL_BUILD
-obj-y  += relocate.o
-endif
+obj-y	+= relocate.o
diff --git a/arch/arm/cpu/arm926ejs/mx25/Makefile b/arch/arm/cpu/arm926ejs/mx25/Makefile
index ebc0407ef42a..7d608c608255 100644
--- a/arch/arm/cpu/arm926ejs/mx25/Makefile
+++ b/arch/arm/cpu/arm926ejs/mx25/Makefile
@@ -4,8 +4,4 @@
 #
 # SPDX-License-Identifier:	GPL-2.0+
 
-obj-y	= generic.o timer.o reset.o
-
-ifndef CONFIG_SPL_BUILD
-obj-y	+= relocate.o
-endif
+obj-y	+= generic.o timer.o reset.o relocate.o
diff --git a/arch/arm/cpu/arm926ejs/mx27/Makefile b/arch/arm/cpu/arm926ejs/mx27/Makefile
index 0edf1445fe36..7d608c608255 100644
--- a/arch/arm/cpu/arm926ejs/mx27/Makefile
+++ b/arch/arm/cpu/arm926ejs/mx27/Makefile
@@ -4,8 +4,4 @@
 #
 # SPDX-License-Identifier:	GPL-2.0+
 
-obj-y	= generic.o reset.o timer.o
-
-ifndef CONFIG_SPL_BUILD
-obj-y	+= relocate.o
-endif
+obj-y	+= generic.o timer.o reset.o relocate.o
diff --git a/arch/sandbox/lib/Makefile b/arch/sandbox/lib/Makefile
index 2e7802feac8a..a79ade7b1102 100644
--- a/arch/sandbox/lib/Makefile
+++ b/arch/sandbox/lib/Makefile
@@ -8,8 +8,6 @@
 #
 
 obj-y	+= interrupts.o
-ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_PCI)	+= pci_io.o
-endif
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
 obj-$(CONFIG_CMD_BOOTZ) += bootm.o
diff --git a/board/atmel/common/Makefile b/board/atmel/common/Makefile
index 8a6850bc198b..f68dd74953ed 100644
--- a/board/atmel/common/Makefile
+++ b/board/atmel/common/Makefile
@@ -6,7 +6,5 @@
 #
 
 obj-y += board.o
-ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_I2C_EEPROM) += mac_eeprom.o
 obj-$(CONFIG_DM_VIDEO) += video_display.o
-endif
diff --git a/board/samsung/arndale/Makefile b/board/samsung/arndale/Makefile
index be2b3662ade6..01bbc0798ac9 100644
--- a/board/samsung/arndale/Makefile
+++ b/board/samsung/arndale/Makefile
@@ -5,7 +5,4 @@
 #
 
 obj-y	+= arndale_spl.o
-
-ifndef CONFIG_SPL_BUILD
 obj-y	+= arndale.o
-endif
diff --git a/board/samsung/espresso7420/Makefile b/board/samsung/espresso7420/Makefile
index d514dc2a457a..5248265b1f19 100644
--- a/board/samsung/espresso7420/Makefile
+++ b/board/samsung/espresso7420/Makefile
@@ -5,6 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-ifndef CONFIG_SPL_BUILD
 obj-y	+= espresso7420.o
-endif
diff --git a/board/spear/spear600/Makefile b/board/spear/spear600/Makefile
index 7abfb9ad50ad..86a7fc4c7eda 100644
--- a/board/spear/spear600/Makefile
+++ b/board/spear/spear600/Makefile
@@ -5,6 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-ifndef CONFIG_SPL_BUILD
-obj-y	:= spear600.o
-endif
+obj-y	+= spear600.o
-- 
2.7.4



More information about the U-Boot mailing list