* [U-Boot] [PATCH] env: don't generate callback list entries for SPL
@ 2012-12-15 0:54 Scott Wood
2012-12-15 7:04 ` Joe Hershberger
2012-12-17 14:52 ` Tom Rini
0 siblings, 2 replies; 8+ messages in thread
From: Scott Wood @ 2012-12-15 0:54 UTC (permalink / raw)
To: u-boot
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 <scottwood@freescale.com>
---
include/env_callback.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/env_callback.h b/include/env_callback.h
index 47fdc6f..c583120 100644
--- a/include/env_callback.h
+++ b/include/env_callback.h
@@ -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__ */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] env: don't generate callback list entries for SPL
2012-12-15 0:54 [U-Boot] [PATCH] env: don't generate callback list entries for SPL Scott Wood
@ 2012-12-15 7:04 ` Joe Hershberger
2012-12-17 14:52 ` Tom Rini
1 sibling, 0 replies; 8+ messages in thread
From: Joe Hershberger @ 2012-12-15 7:04 UTC (permalink / raw)
To: u-boot
Hi Scott,
On Fri, Dec 14, 2012 at 6:54 PM, Scott Wood <scottwood@freescale.com> wrote:
> 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 <scottwood@freescale.com>
Sorry about that.
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] env: don't generate callback list entries for SPL
2012-12-15 0:54 [U-Boot] [PATCH] env: don't generate callback list entries for SPL Scott Wood
2012-12-15 7:04 ` Joe Hershberger
@ 2012-12-17 14:52 ` Tom Rini
2012-12-17 18:53 ` Scott Wood
1 sibling, 1 reply; 8+ messages in thread
From: Tom Rini @ 2012-12-17 14:52 UTC (permalink / raw)
To: u-boot
On Fri, Dec 14, 2012 at 06:54:05PM -0600, Scott Wood wrote:
> 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).
--
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>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] env: don't generate callback list entries for SPL
2012-12-17 14:52 ` Tom Rini
@ 2012-12-17 18:53 ` Scott Wood
2012-12-17 19:12 ` Tom Rini
0 siblings, 1 reply; 8+ messages in thread
From: Scott Wood @ 2012-12-17 18:53 UTC (permalink / raw)
To: u-boot
On 12/17/2012 08:52:59 AM, Tom Rini wrote:
> On Fri, Dec 14, 2012 at 06:54:05PM -0600, Scott Wood wrote:
>
> > 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).
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] env: don't generate callback list entries for SPL
2012-12-17 18:53 ` Scott Wood
@ 2012-12-17 19:12 ` Tom Rini
2012-12-17 19:55 ` Wolfgang Denk
0 siblings, 1 reply; 8+ messages in thread
From: Tom Rini @ 2012-12-17 19:12 UTC (permalink / raw)
To: u-boot
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 12/17/12 13:53, Scott Wood wrote:
> On 12/17/2012 08:52:59 AM, Tom Rini wrote:
>> On Fri, Dec 14, 2012 at 06:54:05PM -0600, Scott Wood wrote:
>>
>>> 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).
>
> 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?
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.
> 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
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-----
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] env: don't generate callback list entries for SPL
2012-12-17 19:12 ` Tom Rini
@ 2012-12-17 19:55 ` Wolfgang Denk
2012-12-17 19:58 ` Tom Rini
0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Denk @ 2012-12-17 19:55 UTC (permalink / raw)
To: u-boot
Dear Tom,
In message <50CF6EA8.4050200@ti.com> 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_evm builds with CONFIG_SPL_NET_SUPPORT enabled. 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
--
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 unknown
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] env: don't generate callback list entries for SPL
2012-12-17 19:55 ` Wolfgang Denk
@ 2012-12-17 19:58 ` Tom Rini
2012-12-17 20:11 ` Joe Hershberger
0 siblings, 1 reply; 8+ messages in thread
From: Tom Rini @ 2012-12-17 19:58 UTC (permalink / raw)
To: u-boot
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 12/17/12 14:55, Wolfgang Denk wrote:
> Dear Tom,
>
> In message <50CF6EA8.4050200@ti.com> 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_evm builds with CONFIG_SPL_NET_SUPPORT enabled.
>> 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.
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-----
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] env: don't generate callback list entries for SPL
2012-12-17 19:58 ` Tom Rini
@ 2012-12-17 20:11 ` Joe Hershberger
0 siblings, 0 replies; 8+ messages in thread
From: Joe Hershberger @ 2012-12-17 20:11 UTC (permalink / raw)
To: u-boot
Hi Tom,
On Mon, Dec 17, 2012 at 1:58 PM, Tom Rini <trini@ti.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 12/17/12 14:55, Wolfgang Denk wrote:
>> Dear Tom,
>>
>> In message <50CF6EA8.4050200@ti.com> 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_evm builds with CONFIG_SPL_NET_SUPPORT enabled.
>>> 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.
> Which means the Makefile is just a tad messy instead, thanks.
-Joe
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-12-17 20:11 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-15 0:54 [U-Boot] [PATCH] env: don't generate callback list entries for SPL Scott Wood
2012-12-15 7:04 ` Joe Hershberger
2012-12-17 14:52 ` Tom Rini
2012-12-17 18:53 ` Scott Wood
2012-12-17 19:12 ` Tom Rini
2012-12-17 19:55 ` Wolfgang Denk
2012-12-17 19:58 ` Tom Rini
2012-12-17 20:11 ` Joe Hershberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox