From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] SPL: Allow ARM926EJS to avoid compiling in the CPU support code
Date: Sat, 22 Oct 2011 02:41:54 +0200 [thread overview]
Message-ID: <4EA21152.60901@aribaud.net> (raw)
In-Reply-To: <201110220219.54608.marek.vasut@gmail.com>
Le 22/10/2011 02:19, Marek Vasut a ?crit :
> On Saturday, October 22, 2011 02:04:52 AM Tom Rini wrote:
>> On Fri, Oct 21, 2011 at 4:45 PM, Marek Vasut<marek.vasut@gmail.com> wrote:
>>> On Saturday, October 22, 2011 01:08:43 AM Albert ARIBAUD wrote:
>>>> Le 22/10/2011 00:46, Marek Vasut a ?crit :
>>>>> On Saturday, October 22, 2011 12:44:06 AM Albert ARIBAUD wrote:
>>>>>> Le 22/10/2011 00:00, Marek Vasut a ?crit :
>>>>>>> On Friday, October 21, 2011 11:52:23 PM Albert ARIBAUD wrote:
>>>>>>>> Hi Marek,
>>>>>>>>
>>>>>>>> Le 21/10/2011 22:44, Marek Vasut a ?crit :
>>>>>>>>> On Thursday, October 06, 2011 02:13:26 AM Marek Vasut wrote:
>>>>>>>>>> This allows the SPL to avoid compiling in the CPU support code.
>>>>>>>>>>
>>>>>>>>>> Signed-off-by: Marek Vasut<marek.vasut@gmail.com>
>>>>>>>>>> Cc: Stefano Babic<sbabic@denx.de>
>>>>>>>>>> Cc: Wolfgang Denk<wd@denx.de>
>>>>>>>>>> Cc: Detlev Zundel<dzu@denx.de>
>>>>>>>>>> Cc: Scott Wood<scottwood@freescale.com>
>>>>>>>>>> ---
>>>>>>>>>>
>>>>>>>>>> arch/arm/cpu/arm926ejs/Makefile | 7 +++++++
>>>>>>>>>> 1 files changed, 7 insertions(+), 0 deletions(-)
>>>>>>>>>>
>>>>>>>>>> diff --git a/arch/arm/cpu/arm926ejs/Makefile
>>>>>>>>>> b/arch/arm/cpu/arm926ejs/Makefile index 930e0d1..3f9b0f1 100644
>>>>>>>>>> --- a/arch/arm/cpu/arm926ejs/Makefile
>>>>>>>>>> +++ b/arch/arm/cpu/arm926ejs/Makefile
>>>>>>>>>> @@ -28,6 +28,13 @@ LIB = $(obj)lib$(CPU).o
>>>>>>>>>>
>>>>>>>>>> START = start.o
>>>>>>>>>> COBJS = cpu.o
>>>>>>>>>>
>>>>>>>>>> +ifdef CONFIG_SPL_BUILD
>>>>>>>>>> +ifdef CONFIG_SPL_NO_CPU_SUPPORT_CODE
>>>>>>>>>> +START :=
>>>>>>>>>> +COBJS :=
>>>>>>>>>> +endif
>>>>>>>>>> +endif
>>>>>>>>>> +
>>>>>>>>>>
>>>>>>>>>> SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
>>>>>>>>>> OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))
>>>>>>>>>> START := $(addprefix $(obj),$(START))
>>>>>>>>>
>>>>>>>>> Hi Albert,
>>>>>>>>>
>>>>>>>>> can we get this applied please?
>>>>>>>>
>>>>>>>> I still don't understand what this is supposed to do -- why not
>>>>>>>> linking this code is required.
>>>>>>>>
>>>>>>>> Amicalement,
>>>>>>>
>>>>>>> Hi Albert,
>>>>>>>
>>>>>>> I use very different start.S in SPL. And I don't need cpu.o at all.
>>>>>>
>>>>>> That I understand; but is there a /problem/ in linking cpu.o in?
>>>>>
>>>>> I suppose it'll be optimized out at link time ?
>>>>
>>>> That indirectly answers my question: what you want to achieve is
>>>> removing dead code.
>>>
>>> The code IS USED in U-Boot, but IS NOT USED in SPL !
>>
>> Right, but linked and unused code in SPL is (or should be!) thrown
>> away, is what's
>> trying to be driven home right now. If the file is going to go away,
>> and it's compiled
>> thrown away at final link of SPL, lets just ignore that it exists for
>> a little longer, and
>> then it won't.
>
> My distrust towards compiler abilities to optimize such stuff out tells me it's
> better to avoid it even to be compiled in at all.
Optimizing unused functions is a rather simple and reliable ability in
tolchains. The issue is not really whether the toolchain is able to do
the removal (it is); rather, the issue is whether the linker command
line will cause the removal (it will IMO as long as -gc-sections is
specified).
Amicalement,
--
Albert.
next prev parent reply other threads:[~2011-10-22 0:41 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-12 4:03 [U-Boot] [PATCH 0/2] SPL improvements Marek Vasut
2011-09-12 4:03 ` [U-Boot] [PATCH 1/2 RESEND] SPL: Make path to start.S configurable Marek Vasut
2011-10-05 19:08 ` Wolfgang Denk
2011-10-05 20:07 ` Wolfgang Denk
2011-10-05 20:15 ` Wolfgang Denk
2011-09-12 4:03 ` [U-Boot] [PATCH 2/2 RESEND] SPL: Allow user to disable CPU support library Marek Vasut
2011-09-15 22:57 ` Scott Wood
2011-09-15 23:17 ` Marek Vasut
2011-09-16 19:49 ` Scott Wood
2011-09-16 21:38 ` Marek Vasut
2011-09-16 21:42 ` Scott Wood
2011-09-16 21:47 ` Marek Vasut
2011-09-16 22:07 ` Scott Wood
2011-09-16 22:48 ` Marek Vasut
2011-09-19 18:13 ` Scott Wood
2011-09-19 22:31 ` Marek Vasut
2011-09-20 19:12 ` Scott Wood
2011-09-20 21:16 ` Marek Vasut
2011-09-20 21:23 ` Scott Wood
2011-09-20 21:30 ` Marek Vasut
2011-09-20 23:31 ` Scott Wood
2011-09-22 8:52 ` Marek Vasut
2011-10-05 21:44 ` Tom Rini
2011-10-05 22:02 ` Scott Wood
2011-10-05 22:20 ` Marek Vasut
2011-10-06 0:13 ` [U-Boot] [PATCH 1/2] " Marek Vasut
2011-10-06 0:13 ` [U-Boot] [PATCH 2/2] SPL: Allow ARM926EJS to avoid compiling in the CPU support code Marek Vasut
2011-10-18 21:33 ` Albert ARIBAUD
2011-10-18 22:30 ` Marek Vasut
2011-10-21 20:44 ` Marek Vasut
2011-10-21 21:52 ` Albert ARIBAUD
2011-10-21 22:00 ` Marek Vasut
2011-10-21 22:44 ` Albert ARIBAUD
2011-10-21 22:46 ` Marek Vasut
2011-10-21 23:08 ` Albert ARIBAUD
2011-10-21 23:45 ` Marek Vasut
2011-10-22 0:04 ` Tom Rini
2011-10-22 0:19 ` Marek Vasut
2011-10-22 0:41 ` Albert ARIBAUD [this message]
2011-10-22 1:20 ` Marek Vasut
2011-10-22 7:05 ` Albert ARIBAUD
2011-10-24 10:14 ` [U-Boot] [PATCH 2/2 V2] " Marek Vasut
2011-11-03 0:05 ` Marek Vasut
2011-11-04 13:59 ` Marek Vasut
2011-11-08 21:15 ` Albert ARIBAUD
2011-10-06 15:54 ` [U-Boot] [PATCH 1/2] SPL: Allow user to disable CPU support library Scott Wood
2011-10-06 23:35 ` Marek Vasut
2011-09-12 4:12 ` [U-Boot] [PATCH 0/2] SPL improvements Marek Vasut
2011-10-05 11:04 ` Marek Vasut
2011-10-05 19:14 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EA21152.60901@aribaud.net \
--to=albert.u.boot@aribaud.net \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox