env: don't generate callback list entries for SPL
PATCH 1/1 env: don't generate callback list entries for SPL
SPL doesn't use the environment. These list entries prevent the functions from being garbage-collected, even though nothing will look at the list. This caused several SPL builds (e.g. P2020RDB-PC_NAND) to break due to size limitations.
A static inline function is used to provide a context in which we can consume the callback, and thus avoid unused function warnings.
--- include/env_callback.h | 8 ++++++++ 1 file changed, 8 insertions(+)
include/env_callback.h +8 -0
@@ -68,8 +68,16 @@ void env_callback_init(ENTRY *var_entry);* when associated through the ".callbacks" environment variable, the callback * will be executed any time the variable is inserted, overwritten, or deleted. */ +#ifdef CONFIG_SPL_BUILD +#define U_BOOT_ENV_CALLBACK (name, callback) \ + static inline void _u_boot_env_noop_##name(void) \ + { \ + (void)callback; \ + } +#else #define U_BOOT_ENV_CALLBACK (name, callback) \ ll_entry_declare(struct env_clbk_tbl, name, env_clbk, env_clbk) = \ {#name, callback} +#endif #endif /* __ENV_CALLBACK_H__ */
Signature · 1 line
1.7.9.5
PATCH 1/1 env: don't generate callback list entries for SPL
Hi Scott,
Quoted 9 lines · Scott Wood
SPL doesn't use the environment. These list entries prevent the functions from being garbage-collected, even though nothing will look at the list. This caused several SPL builds (e.g. P2020RDB-PC_NAND) to break due to size limitations.
A static inline function is used to provide a context in which we can consume the callback, and thus avoid unused function warnings.
Signed-off-by Scott Wood <[email protected]>
Sorry about that.
PATCH 1/1 env: don't generate callback list entries for SPL
In reply to Scott WoodQuoted 4 lines · Scott Wood
SPL doesn't use the environment. These list entries prevent the functions from being garbage-collected, even though nothing will look at the list. This caused several SPL builds (e.g. P2020RDB-PC_NAND) to break due to size limitations.
SPL with networking support uses the environment, so you need to toss CONFIG_SPL_NET_SUPPORT into the test. That said, it's not an interactive environment and this might push that area over the size limit too (in the USB case, which is already pretty tight).
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121217/0dbd78e8/attachment.pgp>
PATCH 1/1 env: don't generate callback list entries for SPL
Quoted 4 lines · Tom Rini
Quoted 2 lines · Scott Wood
SPL doesn't use the environment. These list entries prevent the functions from being garbage-collected, even though nothing will
Quoted 8 lines
look at
Quoted 2 lines
the list. This caused several SPL builds (e.g. P2020RDB-PC_NAND) to break due to size limitations.
SPL with networking support uses the environment, so you need to toss
CONFIG_SPL_NET_SUPPORTinto the test. That said, it's not an interactive environment and this might push that area over the size limit too (in the USB case, which is already pretty tight).
OK, I saw "env_*" stuff in the "ifndef CONFIG_SPL_BUILD" section, but later some of it shows up in "ifdef CONFIG_SPL_BUILD" as well.
So, do you want a v2, or is it OK because it's not interactive? In the latter case should env_callback.o be removed from the SPL build?
Also, env_nvedit.o, env_common.o, and env_flash.o are included for SPL regardless of CONFIG_SPL_NET_SUPPORT. In fact it looks like env_nvedit.o will be included twice if CONFIG_SPL_NET_SUPPORT is enabled. :-P
-Scott
PATCH 1/1 env: don't generate callback list entries for SPL
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 15 lines · Scott Wood
Quoted 5 lines · Tom Rini
Quoted 3 lines · Scott Wood
SPL doesn't use the environment. These list entries prevent the functions from being garbage-collected, even though nothing will
Quoted 8 lines
look at
Quoted 2 lines
the list. This caused several SPL builds (e.g. P2020RDB-PC_NAND) to break due to size limitations.
SPL with networking support uses the environment, so you need to toss
CONFIG_SPL_NET_SUPPORTinto the test. That said, it's not an interactive environment and this might push that area over the size limit too (in the USB case, which is already pretty tight).
Quoted 6 lines
OK, I saw "env_*" stuff in the "ifndef
CONFIG_SPL_BUILD" section, but later some of it shows up in "ifdefCONFIG_SPL_BUILD" as well.So, do you want a v2, or is it OK because it's not interactive? In the latter case should env_callback.o be removed from the SPL build?
Lets do a v2 (since the commit message would have been wrong) and add in a comment saying SPL doesn't have interactive environment, so we don't need this code.
Quoted 4 lines
Also, env_nvedit.o, env_common.o, and env_flash.o are included for SPL regardless of
CONFIG_SPL_NET_SUPPORT. In fact it looks like env_nvedit.o will be included twice ifCONFIG_SPL_NET_SUPPORTis enabled. :-P
Since I'd assume 'sort' in make isn't sort -u, I'm not sure how it's filtering out the dupes unless we don't really need it afterall, am335x_evm builds with CONFIG_SPL_NET_SUPPORT enabled. I'm curious now, so I'm poking it.
- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
iQIcBAEBAgAGBQJQz26oAAoJENk4IS6UOR1WpL0QAJY0PussCOcq+B4Rr2eagtQj e4glJMGst//JKi8hhGac35QhbyAXIJJDO++QET6PUxItUs+ltPci9884gSfe3wvp 6mSB3UKtKVHhMckcVptOTDhrDqwBCDBUFEPKosONJTYRP0s0vOj3E92bAU+z0CJ4 JyVj94lEvstdNxUKHKxRsxu6PF+okSOb/q9X0efx/boxeuyqPUoT15B0zNrtz4kd G31Efjy0sP1HrSp73zvSFoVV2N6p+MbKoFJgxM8seRg+JsPRj7DYCnuGn1l/Hj9m vc+2UMsf9az8+p1333QejYgtFYEmcvrwXXrp4Dcg2e1DCD2mEpmVtCkdI3SFdKvs CbHUuJ9Uc3CACjo4TtH5V7ZiiDwC8+gsO1ucxmng7/Ezr1XCFLOs4nJZKTUXiqwh ZBXaGaApBTCi8vClPyH6jYycjgnKIT3R5bcWIjD8ArhpOypy1J3V2/xqqCJhmyzD gZa1Ym0NXnJ2bSdu2RWcYGyGOt9BLdlpr3nMb03ZdRr2jiy3KktGh2gptDGhz8jk HQ9IS3jUXEQK4QD+UoKYdNfUSbC3G6e6ISM8otCHDVQO4cef/04bT3sBnvo/oUwD RiBSxEDE/Gs9m4UHRuroI3bS+bqNjjdmQXSnq39cST3z+y6qMs7TpkN0iHKWoikz /d7+lr2MD61cneVS5/cj
=kOOU
-----END PGP SIGNATURE-----
PATCH 1/1 env: don't generate callback list entries for SPL
Dear Tom,
Quoted 5 lines · In message <[email protected]> you wrote:
Since I'd assume 'sort' in make isn't sort -u, I'm not sure how it's filtering out the dupes unless we don't really need it afterall,
am335x_evmbuilds withCONFIG_SPL_NET_SUPPORTenabled. I'm curious now, so I'm poking it.
Wrong assumption.
RTFM shows:
`$(sort LIST)'
Sorts the words of LIST in lexical order, removing duplicate words. The output is a list of words separated by single spaces. Thus,
$(sort foo bar lose)
returns the value `bar foo lose'.
Incidentally, since `sort' removes duplicate words, you can use it for this purpose even if you don't care about the sort order.
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
[Doctors and Bartenders], We both get the same two kinds of customers
-- the living and the dying.
-- Dr. Boyce, "The Menagerie" ("The Cage"), stardate unknownPATCH 1/1 env: don't generate callback list entries for SPL
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 17 lines · Wolfgang Denk
Dear Tom,
Quoted 5 lines · In message <[email protected]> you wrote:
Since I'd assume 'sort' in make isn't sort -u, I'm not sure how it's filtering out the dupes unless we don't really need it afterall,
am335x_evmbuilds withCONFIG_SPL_NET_SUPPORTenabled. I'm curious now, so I'm poking it.Wrong assumption.
RTFM shows:
`$(sort LIST)' Sorts the words of LIST in lexical order, removing duplicate words. The output is a list of words separated by single spaces. Thus,
Quoted 6 lines
$(sort foo bar lose)
returns the value `bar foo lose'.
Incidentally, since `sort' removes duplicate words, you can use it for this purpose even if you don't care about the sort order.
Which means the Makefile is just a tad messy instead, thanks.
- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
iQIcBAEBAgAGBQJQz3lzAAoJENk4IS6UOR1WaSoP/AifZ5fTG9NiguJJnT9/q3D/ 9smKp39e8BfrtZ3QVk3ivlyN1fe6Ssgltl6VBBRc2oianwHAlxmb0+LDCC/X/WOc 88HYt7P1zmvkPWoaZ3H43qfYhTTmNviAk56w9bqIfGv6KC5a05+D9USCvP3X0EJ6 4uXKpwHj8V5+Tmi2GAvm1modeSVUvHvgko7Kte5QsrIYAiLq35nIAdjHwwPuv9zL HI484xsOYaRWfOGdphzJ/5io9dohWwwHzyEHyJYq/fQ3al777fEWQHxt6ZEcVkTO ysM/G2G0JxS3Btuq7R5LwJxKdzFKruTUtWwgoCi1YTVsSttAZ+z4p6py3Ju+81EF HplhQDpyNH/9OkSWMq5+IUDHgiNZKsSuE0AqLTFl/5C5zhni+y54mJ4mL3/jknfq aswCopSURTPsCnUBp9cdyq0wMBEUY8TjdnfLR5igM34YryL96oLTQiGwhMiGxwQN c1xXfyN4r+Fmalcb/5aeNa4+YBxdsVWntz958M3g59i59mETbWEWYlR1spqzl0FD DCQVdIo+h0HKNkPWHonBx9CCMzW59NGqGvfgAgD3FxRJwF+loQ/hKlIRNguOhY0F oFVKPq1kzm3AQkNrX/1fJHMXUNLKNyBTLKTRSH0sfqA2yaWlGChL6yyNJzfCgweH PyY7VaRODfQ/Ivra8FaL
=/G2K
-----END PGP SIGNATURE-----
PATCH 1/1 env: don't generate callback list entries for SPL
Hi Tom,
Quoted 27 lines · Tom Rini
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Quoted 23 lines · Wolfgang Denk
Dear Tom,
Quoted 5 lines · In message <[email protected]> you wrote:
Since I'd assume 'sort' in make isn't sort -u, I'm not sure how it's filtering out the dupes unless we don't really need it afterall,
am335x_evmbuilds withCONFIG_SPL_NET_SUPPORTenabled. I'm curious now, so I'm poking it.Wrong assumption.
RTFM shows:
`$(sort LIST)' Sorts the words of LIST in lexical order, removing duplicate words. The output is a list of words separated by single spaces. Thus,
$(sort foo bar lose)
returns the value `bar foo lose'.
Incidentally, since `sort' removes duplicate words, you can use it for this purpose even if you don't care about the sort order.
Not only can you, that's the only reason it's added to those Makefiles.
Quoted 1 line
Which means the
Makefileis just a tad messy instead, thanks.
-Joe