Skip to contentSkip to conversation

fw_env.h: include autoconf.h

PATCH In review Marcel Ziswiler 3 participants 5 messages Apr 14, 2015 – May 7, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fw_env.h: include autoconf.h

From: Max Krummenacher <[email protected]>

Without this, when CONFIG_ENV_VARS_UBOOT_CONFIG is active we get a compile time error when doing 'make env'.
In file included from tools/env/fw_env.c:117:0:
include/env_default.h:110:11: error: expected ?}? before ?CONFIG_SYS_ARCH?

When building U-Boot this is included indirectly by the compiler switch -include /home/trdx/git.toradex.com/u-boot-2014.10-toradex/include/linux/kconfig.h

---
This is an issue on all tegra boards due CONFIG_ENV_VARS_UBOOT_CONFIG being defined in the tegra-common.h header file.

I already did reported this once last November but did not get any useful insights back then:

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

 tools/env/fw_env.h | 1 +
 1 file changed, 1 insertion(+)
tools/env/fw_env.h +1 -0
index aff471b..d6faf34 100644
@@ -13,6 +13,7 @@
 #else
 #include <config.h>
 #endif
+#include <generated/autoconf.h>
 
 /*
  * To build the utility with the static configuration
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/1 fw_env.h: include autoconf.h

Quoted 11 lines · Marcel Ziswiler

From: Max Krummenacher <[email protected]>

Without this, when CONFIG_ENV_VARS_UBOOT_CONFIG is active we get a compile time error when doing 'make env'.
In file included from tools/env/fw_env.c:117:0:
include/env_default.h:110:11: error: expected ?}? before ?CONFIG_SYS_ARCH?

When building U-Boot this is included indirectly by the compiler switch -include /home/trdx/git.toradex.com/u-boot-2014.10-toradex/include/linux/kconfig.h

Quoted 8 lines

---
This is an issue on all tegra boards due CONFIG_ENV_VARS_UBOOT_CONFIG being defined in the tegra-common.h header file.

I already did reported this once last November but did not get any useful insights back then:

Ug. I'm cc'ing a few distro people since this makes it further clear that by whatever name a distro packages fw_setenv/fw_getenv these are really machine (to the extent U-Boot is built) specific applications due to the need to include a copy of the default environment so that we can support making sure that variables that aren't supposed to be overwritten are not overwritten (see the fw_getdefenv call in tools/env/fw_env.c::fw_env_write).

I'll let Masahiro comment on if this is the best way to fix the compile problem.

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/20150416/71ff2878/attachment.sig>
#2 lore raw

PATCH 1/1 fw_env.h: include autoconf.h

Quoted 2 lines · Tom Rini

I'll let Masahiro comment on if this is the best way to fix the compile problem.

What's the status on this one?

#3 lore raw

PATCH 1/1 fw_env.h: include autoconf.h

In reply to Tom Rini

Hi Tom, Marcel,

Sorry for my late reply. I missed this message.

2015-04-17 2:20 GMT+09:00 Tom Rini <[email protected]>:

Quoted 13 lines · Marcel Ziswiler
Quoted 12 lines

From: Max Krummenacher <[email protected]>

Without this, when CONFIG_ENV_VARS_UBOOT_CONFIG is active we get a compile time error when doing 'make env'.
In file included from tools/env/fw_env.c:117:0:
include/env_default.h:110:11: error: expected ?}? before ?CONFIG_SYS_ARCH?

When building U-Boot this is included indirectly by the compiler switch -include /home/trdx/git.toradex.com/u-boot-2014.10-toradex/include/linux/kconfig.h

Quoted 8 lines
Quoted 8 lines

---
This is an issue on all tegra boards due CONFIG_ENV_VARS_UBOOT_CONFIG being defined in the tegra-common.h header file.

I already did reported this once last November but did not get any useful insights back then:

I've just recalled this issue.
In fact, it was reported by another person and I posted a patch last November (but it's been dismissed long and I also finally forgot about it...)

http://patchwork.ozlabs.org/patch/417192/

Quoted 10 lines

Ug. I'm cc'ing a few distro people since this makes it further clear that by whatever name a distro packages fw_setenv/fw_getenv these are really machine (to the extent U-Boot is built) specific applications due to the need to include a copy of the default environment so that we can support making sure that variables that aren't supposed to be overwritten are not overwritten (see the fw_getdefenv call in tools/env/fw_env.c::fw_env_write).

I'll let Masahiro comment on if this is the best way to fix the compile problem.

I do not like host applications to include such machine-specific stuff. Maybe, we should rewrite this tool as
a generic host-program + a separate machine environment file.

Anyway, we should have not left a build error long, so thanks for fixing it!

Signature · 2 lines
Best Regards
Masahiro Yamada
#4 lore raw
In reply to Marcel Ziswiler
Quoted 7 lines · Marcel Ziswiler

From: Max Krummenacher <[email protected]>

Without this, when CONFIG_ENV_VARS_UBOOT_CONFIG is active we get a compile time error when doing 'make env'.
In file included from tools/env/fw_env.c:117:0:
include/env_default.h:110:11: error: expected ?}? before ?CONFIG_SYS_ARCH?

Quoted 6 lines

When building U-Boot this is included indirectly by the compiler switch -include /home/trdx/git.toradex.com/u-boot-2014.10-toradex/include/linux/kconfig.h

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/20150505/8f0d644c/attachment.sig>