Add LDFLAGS-u-boot variable and move some linker option to this
Subsystems (4)
PATCH 1/1 Add LDFLAGS-u-boot variable and move some linker option to this
This move linker option used by the last of u-boot in LDFLAGS_u-boot variable. And the option to use in ld uses LDFLAGS variable.
--- Makefile | 2 +- arch/blackfin/config.mk | 3 ++- arch/i386/config.mk | 3 ++- arch/nios2/config.mk | 2 +- arch/powerpc/config.mk | 4 ++-- arch/sh/config.mk | 2 +- arch/sh/cpu/sh2/config.mk | 4 +++- config.mk | 8 +++++--- 8 files changed, 17 insertions(+), 11 deletions(-)
Makefile +1 -1
@@ -369,7 +369,7 @@ $(obj)u-boot.dis: $(obj)u-boot GEN_UBOOT = \ UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \ sed -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\ - cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \ + cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__OBJS) \ --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \ -Map u-boot.map -o u-boot $(obj)u-boot: depend \
arch/blackfin/config.mk +2 -1
@@ -30,7 +30,8 @@ CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE))) PLATFORM_RELFLAGS += -ffixed-P3 -fomit-frame-pointer -mno-fdpic PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN -LDFLAGS += --gc-sections -m elf32bfin +LDFLAGS_u-boot += --gc-sections +LDFLAGS += -m elf32bfin PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections PLATFORM_CPPFLAGS += -DBFIN_CPU='"$(CONFIG_BFIN_CPU)"'
arch/i386/config.mk +2 -1
@@ -35,5 +35,6 @@ PLATFORM_CPPFLAGS += $(call cc-option, -fno-stack-protector) PLATFORM_CPPFLAGS += $(call cc-option, -mpreferred-stack-boundary=2) PLATFORM_CPPFLAGS += -DCONFIG_I386 -D__I386__ -LDFLAGS += --cref --gc-sections +LDFLAGS += --cref +LDFLAGS_u-boot += --gc-sections PLATFORM_RELFLAGS += -ffunction-sections
arch/nios2/config.mk +1 -1
@@ -31,5 +31,5 @@ PLATFORM_CPPFLAGS += -G0 LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds -LDFLAGS += --gc-sections +LDFLAGS_u-boot += --gc-sections PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
arch/powerpc/config.mk +2 -2
@@ -24,10 +24,10 @@ CROSS_COMPILE ?= ppc_8xx- STANDALONE_LOAD_ADDR = 0x40000 - +LDFLAGS_u-boot = --gc-sections PLATFORM_RELFLAGS += -mrelocatable -ffunction-sections -fdata-sections PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__ -PLATFORM_LDFLAGS += -n --gc-sections +PLATFORM_LDFLAGS += -n ifdef CONFIG_SYS_LDSCRIPT # need to strip off double quotes
arch/sh/config.mk +1 -1
@@ -30,5 +30,5 @@ endif PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__ PLATFORM_LDFLAGS += -e $(CONFIG_SYS_TEXT_BASE) --defsym reloc_dst=$(CONFIG_SYS_TEXT_BASE) - +LDFLAGS_u-boot = --gc-sections LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds
arch/sh/cpu/sh2/config.mk +3 -1
@@ -21,6 +21,8 @@ # MA 02111-1307 USA # # +ENDIANNESS += -EB + PLATFORM_CPPFLAGS += -m3e -mb PLATFORM_RELFLAGS += -ffixed-r13 -PLATFORM_LDFLAGS += -EB +PLATFORM_LDFLAGS += $(ENDIANNESS)
config.mk +5 -3
@@ -204,9 +204,11 @@ endif AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS) -LDFLAGS += -Bstatic -T $(obj)u-boot.lds $(PLATFORM_LDFLAGS) +LDFLAGS += $(PLATFORM_LDFLAGS) + +LDFLAGS_u-boot += -Bstatic -T $(obj)u-boot.lds $(PLATFORM_LDFLAGS) ifneq ($(CONFIG_SYS_TEXT_BASE),) -LDFLAGS += -Ttext $(CONFIG_SYS_TEXT_BASE) +LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE) endif # Location of a usable BFD library, where we define "usable" as
@@ -262,7 +264,7 @@ $(obj)%.s: %.c # If the list of objects to link is empty, just create an empty built-in.o cmd_link_o_target = $(if $(strip $1),\ - $(LD) -r -o $@ $1 ,\ + $(LD) $(LDFLAGS) -r -o $@ $1,\ rm -f $@; $(AR) rcs $@ ) #########################################################################
Signature · 1 line
1.7.2.3
PATCH 1/1 Add LDFLAGS-u-boot variable and move some linker option to this
Dear Nobuhiro Iwamatsu,
Quoted 2 lines · In message <[email protected]> you wrote:
This move linker option used by the last of u-boot in LDFLAGS_u-boot variable. And the option to use in ld uses LDFLAGS variable.
Can you please explain why this would be needed?
arch/blackfin/config.mk CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE))) · line 33
Quoted 2 lines
arch/blackfin/config.mk +1
-1-LDFLAGS += --gc-sections -m elf32bfin +LDFLAGS_u-boot += --gc-sections
The name "LDFLAGS_u-boot" may actually work here, but iut is inconsistent with other such variables names, and using '-' in a name is probably not a good idea either.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Star Trek Lives!
PATCH 1/1 Add LDFLAGS-u-boot variable and move some linker option to this
Quoted 5 lines · On Monday, December 27, 2010 05:47:54 Wolfgang Denk wrote:
Quoted 2 lines · Nobuhiro Iwamatsu
This move linker option used by the last of u-boot in LDFLAGS_u-boot variable. And the option to use in ld uses LDFLAGS variable.
Can you please explain why this would be needed?
he explained in the previous thread why we need to split things. there are flags that are needed for all linker options and there are flags needed just for the final u-boot link.
Quoted 6 lines
arch/blackfin/config.mk CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE))) · line 33
Quoted 2 lines
arch/blackfin/config.mk +1
-1-LDFLAGS += --gc-sections -m elf32bfin +LDFLAGS_u-boot += --gc-sectionsThe name "LDFLAGS_u-boot" may actually work here, but iut is inconsistent with other such variables names, and using '-' in a name is probably not a good idea either.
it isnt inconsistent. the convention is $(XFLAGS_$(@F)) and we just happen to be creating a file here which is named "u-boot". dashes in variable names isnt a problem for make. otherwise you're basically banning creating files in the u-boot tree with dashes in their filenames.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20101227/c9d76dcf/attachment.pgp
PATCH 1/1 Add LDFLAGS-u-boot variable and move some linker option to this
Dear Mike Frysinger,
Quoted 10 lines · In message <[email protected]> you wrote:
Quoted 6 lines
Quoted 2 lines · Nobuhiro Iwamatsu
This move linker option used by the last of u-boot in LDFLAGS_u-boot variable. And the option to use in ld uses LDFLAGS variable.
Can you please explain why this would be needed?
he explained in the previous thread why we need to split things. there are flags that are needed for all linker options and there are flags needed just for the final u-boot link.
Such an explanation belongs into the commit message.
Quoted 8 lines
Quoted 6 lines
arch/blackfin/config.mk CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE))) · line 33
Quoted 2 lines
arch/blackfin/config.mk +1
-1-LDFLAGS += --gc-sections -m elf32bfin +LDFLAGS_u-boot += --gc-sectionsThe name "LDFLAGS_u-boot" may actually work here, but iut is inconsistent with other such variables names, and using '-' in a name is probably not a good idea either.
it isnt inconsistent. the convention is $(XFLAGS_$(@F)) and we just happen to
Can you please point me to an example where this has been used in U-Boot before? Or why do you call this a convention?
I fail to see a reason this is needed or even useful here.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The sight of death frightens them [Earthers]. -- Kras the Klingon, "Friday's Child", stardate 3497.2
PATCH 1/1 Add LDFLAGS-u-boot variable and move some linker option to this
Quoted 5 lines · On Monday, December 27, 2010 13:58:08 Wolfgang Denk wrote:
Quoted 4 lines · Mike Frysinger
Quoted 4 lines
Quoted 2 lines · Nobuhiro Iwamatsu
This move linker option used by the last of u-boot in LDFLAGS_u-boot variable. And the option to use in ld uses LDFLAGS variable.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Can you please explain why this would be needed?
he explained in the previous thread why we need to split things. there are flags that are needed for all linker options and there are flags needed just for the final u-boot link.
Such an explanation belongs into the commit message.
yes, but that isnt what you asked
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
arch/blackfin/config.mk CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE))) · line 33
Quoted 2 lines
arch/blackfin/config.mk +1
-1-LDFLAGS += --gc-sections -m elf32bfin +LDFLAGS_u-boot += --gc-sectionsThe name "LDFLAGS_u-boot" may actually work here, but iut is inconsistent with other such variables names, and using '-' in a name is probably not a good idea either.
Quoted 5 lines
Quoted 2 lines
it isnt inconsistent. the convention is $(XFLAGS_$(@F)) and we just happen to
Can you please point me to an example where this has been used in U-Boot before? Or why do you call this a convention?
(1) it's what's used in Linux and every build system based on that (kbuild)
(2) u-boot is slowly moving to the conventions already in use by Linux
(3) u-boot already uses this specific convention for every .c/.s/.S file -- simply look at the bottom of config.mk
it makes perfect sense to keep the existing syntax and extend LDFLAGS behavior to it rather than coming up with some new specific variable that only applies to the final link of u-boot. otherwise every other final link we have in u- boot will need its own random style (examples, standalone, spl, ...). -mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20101227/205265c0/attachment.pgp
PATCH 1/1 Add LDFLAGS-u-boot variable and move some linker option to this
Dear Mike Frysinger,
Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines · Nobuhiro Iwamatsu
This move linker option used by the last of u-boot in LDFLAGS_u-boot variable. And the option to use in ld uses LDFLAGS variable.
Can you please explain why this would be needed?
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
he explained in the previous thread why we need to split things. there are flags that are needed for all linker options and there are flags needed just for the final u-boot link.
Such an explanation belongs into the commit message.
yes, but that isnt what you asked
This is just your quibblerish interpretation.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
it isnt inconsistent. the convention is $(XFLAGS_$(@F)) and we just happen to
Can you please point me to an example where this has been used in U-Boot before? Or why do you call this a convention?
(1) it's what's used in Linux and every build system based on that (kbuild)
So let's out on record that this is NOT an accepted convention in U-Boot.
Quoted 1 line
(2) u-boot is slowly moving to the conventions already in use by Linux
Oh, is it?
Quoted 2 lines
(3) u-boot already uses this specific convention for every .c/.s/.S file --> simply look at the bottom of config.mk
Well, applying your strict interpretation I see this:
...
258 ######################################################################### 259
260 # If the list of objects to link is empty, just create an empty built-in.o 261 cmd_link_o_target = $(if $(strip $1),\
262 $(LD) -r -o $@ $1 ,\
263 rm -f $@; $(AR) rcs $@ )
264
265 #########################################################################
And I see no trace of any $(XFLAGS_$(@F)) there.
Actually I see no trace of any $(XFLAGS_$(@F)) anywhere; the closest we have is this:
245 ALL_AFLAGS = $(AFLAGS) $(AFLAGS_$(BCURDIR)/$(@F)) $(AFLAGS_$(BCURDIR)) 246 ALL_CFLAGS = $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR))
Quoted 4 lines
it makes perfect sense to keep the existing syntax and extend LDFLAGS behavior to it rather than coming up with some new specific variable that only applies to the final link of u-boot. otherwise every other final link we have in u- boot will need its own random style (examples, standalone, spl, ...).
Maybe you a are even right. But you might find it easier to get your arguments considered if you'd use a more constructive way to present it.
And in any way, my statementt was and is that such explanations must
be included with the commit message. Period.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Bei genauerem Hinsehen ist die Arbeit weniger langweilig als das Vergn?gen. -- Charles Baudelaire
PATCH 1/1 Add LDFLAGS-u-boot variable and move some linker option to this
Quoted 1 line · On Monday, December 27, 2010 18:23:17 Wolfgang Denk wrote:
And I see no trace of any $(XFLAGS_$(@F)) there.
it's fairly obvious that the "X" is for you to replace as a matching char -mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20101227/1ec276ca/attachment.pgp
PATCH 1/1 Add LDFLAGS-u-boot variable and move some linker option to this
In reply to Nobuhiro IwamatsuQuoted 2 lines · On Monday, December 27, 2010 02:00:24 Nobuhiro Iwamatsu wrote:
This move linker option used by the last of u-boot in LDFLAGS_u-boot variable. And the option to use in ld uses LDFLAGS variable.
Nobuhiro: could you repost with an updated changelog please ? talk about how the the linker needs to use the proper endian/bfd flags even when doing partial linking.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20101229/a7dfa47d/attachment.pgp
PATCH 1/1 Add LDFLAGS-u-boot variable and move some linker option to this
Hi,
Quoted 7 lines · Mike Frysinger
Quoted 2 lines · On Monday, December 27, 2010 02:00:24 Nobuhiro Iwamatsu wrote:
This move linker option used by the last of u-boot in LDFLAGS_u-boot variable. And the option to use in ld uses LDFLAGS variable.
Nobuhiro: could you repost with an updated changelog please ? talk about how the the linker needs to use the proper endian/bfd flags even when doing partial linking.
Sorry, I had long vacation.
I am going to report new patch.
Thanks,
Nobuhiro
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110105/de1e3ad9/attachment.pgp