Skip to contentSkip to conversation

tools: enable img2srec for "all" target

PATCH New Mike Frysinger 5 participants 21 messages Aug 15, 2010 – Nov 15, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 tools: enable img2srec for "all" target

---
 tools/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
tools/Makefile +1 -0
index 749d994..ea271bf 100644
@@ -41,6 +41,7 @@ include $(TOPDIR)/config.mk
 # Enable all the config-independent tools
 ifneq ($(HOST_TOOLS_ALL),)
 CONFIG_LCD_LOGO = y
+CONFIG_CMD_LOADS = y
 CONFIG_CMD_NET = y
 CONFIG_INCA_IP = y
 CONFIG_NETCONSOLE = y
Signature · 1 line
1.7.2
#1 lore raw

PATCH 2/4 tools: update .gitignore

---
 tools/.gitignore |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
tools/.gitignore +5 -0
index cb067a4..07f21a3 100644
@@ -9,3 +9,8 @@
 /ubsha1
 /inca-swap-bytes
 /*.exe
+/easylogo/easylogo
+/env/crc32.c
+/env/fw_printenv
+/gdb/gdbcont
+/gdb/gdbsend
Signature · 1 line
1.7.2
#2 lore raw

PATCH 2/4 tools: update .gitignore

Dear Mike Frysinger,

Quoted 4 lines · In message <[email protected]> you wrote:
---
 tools/.gitignore |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Applied to "next" branch. Thanks

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
Time is fluid ... like a river with currents, eddies, backwash.
	-- Spock, "The City on the Edge of Forever", stardate 3134.0
#3 lore raw

PATCH 3/4 unify toplevel tools targets

In reply to Mike Frysinger

Most tool subdirs do not rely on a configured tree, so move those targets out of the config checks and unify them in the process.

Also add an easylogo target so people can easily build that.

Also add these new tool targets to the 'tools-all' target.

---
 Makefile |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)
Makefile +11 -12
index 4f1cb1b..fc328df 100644
@@ -397,14 +397,8 @@ $(TIMESTAMP_FILE):
 		@LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@
 		@LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@
 
-gdbtools:
-		$(MAKE) -C tools/gdb all || exit 1
-
 updater:
-		$(MAKE) -C tools/updater all || exit 1
-
-env:
-		$(MAKE) -C tools/env all MTD_VERSION=${MTD_VERSION} || exit 1
+		$(MAKE) -C tools/updater all
 
 # Explicitly make _depend in subdirs containing multiple targets to prevent
 # parallel sub-makes creating .depend files simultaneously.
@@ -459,17 +453,22 @@ $(obj)include/autoconf.mk: $(obj)include/config.h
 else	# !config.mk
 all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
 $(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \
-$(filter-out tools,$(SUBDIRS)) $(TIMESTAMP_FILE) $(VERSION_FILE) gdbtools \
-updater env depend dep tags ctags etags cscope $(obj)System.map:
+$(filter-out tools,$(SUBDIRS)) $(TIMESTAMP_FILE) $(VERSION_FILE) \
+updater depend dep tags ctags etags cscope $(obj)System.map:
 	@echo "System not configured - see README" >&2
 	@ exit 1
 
 tools:
-	$(MAKE) -C tools
-tools-all:
-	$(MAKE) -C tools HOST_TOOLS_ALL=y
+	$(MAKE) -C $@ all
 endif	# config.mk
 
+easylogo env gdb:
+	$(MAKE) -C tools/$@ all MTD_VERSION=${MTD_VERSION}
+gdbtools: gdb
+
+tools-all: easylogo env gdb
+	$(MAKE) -C tools HOST_TOOLS_ALL=y
+
 .PHONY : CHANGELOG
 CHANGELOG:
 	git log --no-merges U-Boot-1_1_5.. | \
Signature · 1 line
1.7.2
#4 lore raw

PATCH 3/4 unify toplevel tools targets

Dear Mike Frysinger,

Quoted 11 lines · In message <[email protected]> you wrote:

Most tool subdirs do not rely on a configured tree, so move those targets out of the config checks and unify them in the process.

Also add an easylogo target so people can easily build that.

Also add these new tool targets to the 'tools-all' target.

---
 Makefile |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

Applied to "next" branch. Thanks

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
panic: kernel trap (ignored)
#5 lore raw

PATCH 4/4 tools/env: use host build flags

In reply to Mike Frysinger

Convert the tools/env/Makefile to use the same host tool syntax as the other tool subdirs.

---
 tools/env/Makefile |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
tools/env/Makefile +3 -3
index 2df631e..f893040 100644
@@ -26,16 +26,16 @@ include $(TOPDIR)/config.mk
 SRCS	:= $(obj)crc32.c  fw_env.c  fw_env_main.c
 HEADERS	:= fw_env.h
 
-CPPFLAGS := -Wall -DUSE_HOSTCC -I$(SRCTREE)/include
+HOSTCFLAGS += -Wall -DUSE_HOSTCC -I$(SRCTREE)/include
 
 ifeq ($(MTD_VERSION),old)
-CPPFLAGS += -DMTD_OLD
+HOSTCFLAGS += -DMTD_OLD
 endif
 
 all:	$(obj)fw_printenv
 
 $(obj)fw_printenv:	$(SRCS) $(HEADERS)
-	$(CROSS_COMPILE)gcc $(CPPFLAGS) $(SRCS) -o $(obj)fw_printenv
+	$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $(SRCS)
 
 clean:
 	rm -f $(obj)fw_printenv $(obj)crc32.c
Signature · 1 line
1.7.2
#6 lore raw

PATCH 4/4 tools/env: use host build flags

Dear Mike Frysinger,

Quoted 7 lines · In message <[email protected]> you wrote:

Convert the tools/env/Makefile to use the same host tool syntax as the other tool subdirs.

---
 tools/env/Makefile |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Applied to "next" branch. Thanks

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
"UNIX was not designed to stop you from doing stupid things,  because
that would also stop you from doing clever things."       - Doug Gwyn
#7 lore raw

PATCH 4/4 tools/env: use host build flags

Hi,

Quoted 6 lines

Dear Mike Frysinger,

Quoted 3 lines · In message <[email protected]> you wrote:

Convert the tools/env/Makefile to use the same host tool syntax as the other tool subdirs.

Quoted 6 lines
Quoted 4 lines
---
 tools/env/Makefile |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Applied to "next" branch. Thanks

It just occurred to me that this will no longer cross compile the fw_env tool - effectively rendering the tool useless for me.

Mike, what _exactly_ was the reason to drop cross compilation?

Cheers
Detlev

Signature · 7 lines
By all means let's be open-minded, but not so open-minded that our
brains drop out.
                                                -- Richard Dawkins
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#8 lore raw

PATCH 4/4 tools/env: use host build flags

Dear Detlev Zundel,

Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 2 lines

Applied to "next" branch. Thanks

It just occurred to me that this will no longer cross compile the fw_env tool - effectively rendering the tool useless for me.

Argh... Indeed, that's broken.

Quoted 1 line

Mike, what _exactly_ was the reason to drop cross compilation?

Mike, I think we should revert that commit?

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
"There is nothing new under the sun, but there are lots of old things
we don't know yet."                                  - Ambrose Bierce
#9 lore raw

PATCH 4/4 tools/env: use host build flags

Quoted 6 lines · Wolfgang Denk

Dear Detlev Zundel,

Quoted 3 lines · In message <[email protected]> you wrote:
Quoted 2 lines

Applied to "next" branch. Thanks

Quoted 8 lines
Quoted 2 lines

It just occurred to me that this will no longer cross compile the fw_env tool - effectively rendering the tool useless for me.

Argh... Indeed, that's broken.

Quoted 1 line

Mike, what _exactly_ was the reason to drop cross compilation?

Mike, I think we should revert that commit?

I ran into this issue this week too.

Reverting is one option. I also tried Daniel Hobi's patch "tools/env:
cleanup host build flags" and that worked for me.

Steve

#10 lore raw

PATCH 4/4 tools/env: use host build flags

Hi Steve,

Quoted 11 lines · Steve Sakoman
Quoted 5 lines · Wolfgang Denk
Quoted 2 lines · In message <[email protected]> you wrote:

It just occurred to me that this will no longer cross compile the fw_env tool - effectively rendering the tool useless for me.

Argh... Indeed, that's broken.

I ran into this issue this week too.

Reverting is one option. I also tried Daniel Hobi's patch "tools/env:
cleanup host build flags" and that worked for me.

You are refering to this WIP patch:

http://article.gmane.org/gmane.comp.boot-loaders.u-boot/86236

It makes the fw_env tool Makefile similar to the imls Makefile and solves the errno inclusion problem reported by Detlev.

I still think we need a third set of CC, CFLAGS, SRCS, etc defines for compiling tools running on the target. However, we probably can default to the combination CC+HOSTCFLAGS for most platforms.

Best regards,
Daniel

#11 lore raw

PATCH 4/4 tools/env: use host build flags

In reply to Detlev Zundel
Quoted 10 lines · On Monday, November 08, 2010 13:15:38 Detlev Zundel wrote:
Quoted 5 lines
Quoted 2 lines · Mike Frysinger

Convert the tools/env/Makefile to use the same host tool syntax as the other tool subdirs.

Applied to "next" branch. Thanks

It just occurred to me that this will no longer cross compile the fw_env tool - effectively rendering the tool useless for me.

Mike, what _exactly_ was the reason to drop cross compilation?

nothing was "dropped". you need to set your HOSTCC correctly for the host on which you want tools to compile.

this is like arguing that none of the tools in tools/Makefile cross-compile. they do. i simply fixed tools/env/Makefile to operate the same.
-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/20101110/4446ffd3/attachment.pgp

#12 lore raw

PATCH 4/4 tools/env: use host build flags

Dear Mike Frysinger,

Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 2 lines

Mike, what _exactly_ was the reason to drop cross compilation?

nothing was "dropped". you need to set your HOSTCC correctly for the host on which you want tools to compile.

But it is WRONG to use HOSTCC for fw_* - these are _target_ tools, and they need to be CROSS compiled.

Quoted 2 lines

this is like arguing that none of the tools in tools/Makefile cross-compile. they do. i simply fixed tools/env/Makefile to operate the same.

Seems this was not a fix, but introduced an error. Dp you agree to revert that commit?

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 more we disagree, the more chance there is that at least  one  of
us is right.
#13 lore raw

PATCH 4/4 tools/env: use host build flags

Quoted 8 lines · On Wednesday, November 10, 2010 14:54:17 Wolfgang Denk wrote:
Quoted 4 lines · Mike Frysinger
Quoted 1 line

Mike, what _exactly_ was the reason to drop cross compilation?

nothing was "dropped". you need to set your HOSTCC correctly for the host on which you want tools to compile.

But it is WRONG to use HOSTCC for fw_* - these are _target_ tools, and they need to be CROSS compiled.

so do what i said -- set the HOSTCC to the host you want the tools to run on. this will work for *all* tools instead of arbitrarily picking some to use HOSTCC while picking others to use CROSS.

Quoted 6 lines
Quoted 3 lines

this is like arguing that none of the tools in tools/Makefile cross-compile. they do. i simply fixed tools/env/Makefile to operate the same.

Seems this was not a fix, but introduced an error. Dp you agree to revert that commit?

of course i disagree. this change is a fix in my mind.
-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/20101110/653fc75a/attachment.pgp

#14 lore raw

PATCH 4/4 tools/env: use host build flags

Dear Mike Frysinger,

Quoted 4 lines · In message <[email protected]> you wrote:

so do what i said -- set the HOSTCC to the host you want the tools to run on. this will work for *all* tools instead of arbitrarily picking some to use HOSTCC while picking others to use CROSS.

Why are you so ignorant?

There are tools that are supposed to run on the build host (like mkimage or gen_eth_addr), and there are tools that are supposed to run on the target (like fw_*).

Your "one size fits all" approach is broken.

Quoted 4 lines
Quoted 2 lines

Seems this was not a fix, but introduced an error. Dp you agree to revert that commit?

of course i disagree. this change is a fix in my mind.

Please reconsider. This has been working for nearly a decade, and now it's broken. I want to see this fixed. If needed, by reverting the commit that broke it.

Best regards,

Wolfgang Denk

Signature · 6 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
Programmer's Lament: (Shakespeare, Macbeth, Act I, Scene vii)
        "That we but teach bloody instructions,
        which, being taught, return to plague the inventor..."
#15 lore raw

PATCH 4/4 tools/env: use host build flags

Quoted 6 lines · On Wednesday, November 10, 2010 17:29:52 Wolfgang Denk wrote:
Quoted 3 lines · Mike Frysinger

so do what i said -- set the HOSTCC to the host you want the tools to run on. this will work for *all* tools instead of arbitrarily picking some to use HOSTCC while picking others to use CROSS.

Why are you so ignorant?

cut the crap

Quoted 3 lines

There are tools that are supposed to run on the build host (like mkimage or gen_eth_addr), and there are tools that are supposed to run on the target (like fw_*).

you're assuming too much here as well. i need to support cross-compiling all the tools for when the build==host==target and build!=host==target and build!=host!=target. this is the stuff i hit every day with package managers and distro setups.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Seems this was not a fix, but introduced an error. Dp you agree to revert that commit?

of course i disagree. this change is a fix in my mind.

Please reconsider. This has been working for nearly a decade, and now it's broken. I want to see this fixed. If needed, by reverting the commit that broke it.

it's been working for your specific use cases. it hasnt been working without pains for everyone.
-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/20101110/1a43ac06/attachment.pgp

#16 lore raw

PATCH 4/4 tools/env: use host build flags

Dear Mike Frysinger,

Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

Seems this was not a fix, but introduced an error. Dp you agree to revert that commit?

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

of course i disagree. this change is a fix in my mind.

Please reconsider. This has been working for nearly a decade, and now it's broken. I want to see this fixed. If needed, by reverting the commit that broke it.

it's been working for your specific use cases. it hasnt been working without pains for everyone.

I agree you have a point.

But it is a change in behaviour, and what it makes worse it that it's an undocumented one. Users who have been doing the same thing for a decade suddenly find their old scripts are not working any more, and there it even a hint of what they do now.

If we decide that such a change makes sense, then it must be explained and documented properly.

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
In English, every word can be verbed.  Would that it were  so  in our
programming languages.
#17 lore raw

PATCH 4/4 tools/env: use host build flags

Quoted 15 lines · On Sunday, November 14, 2010 16:59:33 Wolfgang Denk wrote:
Quoted 11 lines · Mike Frysinger
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Seems this was not a fix, but introduced an error. Dp you agree to revert that commit?

of course i disagree. this change is a fix in my mind.

Please reconsider. This has been working for nearly a decade, and now it's broken. I want to see this fixed. If needed, by reverting the commit that broke it.

it's been working for your specific use cases. it hasnt been working without pains for everyone.

I agree you have a point.

Quoted 7 lines

But it is a change in behaviour, and what it makes worse it that it's an undocumented one. Users who have been doing the same thing for a decade suddenly find their old scripts are not working any more, and there it even a hint of what they do now.

If we decide that such a change makes sense, then it must be explained and documented properly.

i guess i can try harder to goad Daniel into getting his work going
-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/20101115/ec96b446/attachment.pgp

#18 lore raw

PATCH 1/4 tools: enable img2srec for "all" target

In reply to Mike Frysinger

Dear Mike Frysinger,

Quoted 10 lines · In message <[email protected]> you wrote:
---
 tools/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
tools/Makefile +0 -0
index 749d994..ea271bf 100644

tools/Makefile include $(TOPDIR)/config.mk · line 47

Quoted 7 lines
tools/Makefile +1 -0
@@ -41,6 +41,7 @@ include $(TOPDIR)/config.mk
 # Enable all the config-independent tools
 ifneq ($(HOST_TOOLS_ALL),)
 CONFIG_LCD_LOGO = y
+CONFIG_CMD_LOADS = y
 CONFIG_CMD_NET = y
 CONFIG_INCA_IP = y
 CONFIG_NETCONSOLE = y

Do we really need this? Only very few people will ever need the img2srec tool, so why build it for everybody?

Best regards,

Wolfgang Denk

Signature · 8 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
You'll learn something  about  men  and  women  --  the  way  they're
supposed  to  be. Caring for each other, being happy with each other,
being good to each other. That's what we call love. You'll like  that
a lot.
	-- Kirk, "The Apple", stardate 3715.6
#19 lore raw

PATCH 1/4 tools: enable img2srec for "all" target

Quoted 11 lines · On Sunday, September 12, 2010 15:39:06 Wolfgang Denk wrote:
Quoted 10 lines · Mike Frysinger
tools/Makefile +0 -0
index 749d994..ea271bf 100644
@@ -41,6 +41,7 @@ include $(TOPDIR)/config.mk
 
 # Enable all the config-independent tools
 ifneq ($(HOST_TOOLS_ALL),)
 CONFIG_LCD_LOGO = y
 
Quoted 8 lines
Quoted 5 lines
tools/Makefile +1 -0
+CONFIG_CMD_LOADS = y
 

CONFIG_CMD_NET = y
CONFIG_INCA_IP = y
CONFIG_NETCONSOLE = y

Do we really need this? Only very few people will ever need the img2srec tool, so why build it for everybody?

it is only built when people do make tools-all, not make tools, and in this case, yes, i think we should be building it
-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/20100912/8da55728/attachment.pgp

#20 lore raw

PATCH 1/4 tools: enable img2srec for "all" target

In reply to Mike Frysinger

Dear Mike Frysinger,

Quoted 4 lines · In message <[email protected]> you wrote:
---
 tools/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Applied to "next" after editing the subject to say "tools-all" instead of "all" (which misled me).

Best regards,

Wolfgang Denk

Signature · 9 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
I don't care if you *ARE* on a bondage-and-discipline  post-technical
system  pawned off by the nation's largest oughta-be-illegal monopoly
who cannot escape the sins of their forefathers -- namely, using  the
wrong  slash for directories when the C language and its brethren use
it for something else that's very important.
         -- Tom Christiansen in <[email protected]>