[U-Boot] Compiling certain files with extra compiler flags

Vadim Bendebury vbendeb at chromium.org
Thu Sep 5 18:50:05 CEST 2013


On Wed, Sep 4, 2013 at 8:16 PM, Simon Glass <sjg at google.com> wrote:
> Hi Vadim,
>
> OK I see.
>
> You can do something like this:
>
> CFLAGS_arch/arm/cpu/tegra20-common/warmboot_avp.o += -march=armv4t
>
> (this is used by Tegra)
>
> Regards,
> Simon
>

Ah, this works, thank you, Simon!

--vb

>
> On Wed, Sep 4, 2013 at 8:25 PM, Vadim Bendebury <vbendeb at chromium.org> wrote:
>> this is the tweak
>>
>> ---------- Forwarded message ----------
>> From: Vadim Bendebury <vbendeb at chromium.org>
>> Date: Wed, Sep 4, 2013 at 11:49 AM
>> Subject: Compiling certain files with extra compiler flags
>> To: uboot <u-boot at lists.denx.de>
>>
>>
>> Does u-boot provide the ability to change compilation options 'on the
>> fly', say when certain files need to be compiled for symbolic
>> debugging? I looked but did not find any.
>>
>> How about something like this:
>>
>> vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
>> $ git diff config.mk
>> diff --git a/config.mk b/config.mk
>> index 853e6d8..41cafbb 100644
>> --- a/config.mk
>> +++ b/config.mk
>> @@ -406,7 +406,7 @@ $(obj)%.o:  %.c
>>  ifneq ($(CHECKSRC),0)
>>         $(CHECK) $(CHECKFLAGS) $(ALL_CFLAGS) $<
>>  endif
>> -       $(CC)  $(ALL_CFLAGS) -o $@ $< -c
>> +       $(CC)  $(ALL_CFLAGS) $(CPP_$(subst .,_,$<)) -o $@ $< -c
>>  $(obj)%.i:     %.c
>>         $(CPP) $(ALL_CFLAGS) -o $@ $< -c
>>  $(obj)%.s:     %.c
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>
>> Then, say I want to have spl_boot.c compiled with extra flags, just
>> invoking make like this does the trick:
>>
>>  CPP_spl_boot_c='-O0 -fno-default-inline'  make ...
>>
>> Or is there a better way?
>>
>> --vb


More information about the U-Boot mailing list