From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aneesh V Date: Thu, 23 Feb 2012 23:42:28 +0530 Subject: [U-Boot] [PATCH v2 3/5] ARM: enable Thumb build In-Reply-To: <201202231304.22205.vapier@gentoo.org> References: <1328528248-20872-1-git-send-email-aneesh@ti.com> <201202230957.52239.vapier@gentoo.org> <4F467744.40307@ti.com> <201202231304.22205.vapier@gentoo.org> Message-ID: <4F46818C.4030205@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thursday 23 February 2012 11:34 PM, Mike Frysinger wrote: > On Thursday 23 February 2012 12:28:36 Aneesh V wrote: >> On Thursday 23 February 2012 08:27 PM, Mike Frysinger wrote: >>> On Thursday 23 February 2012 08:39:43 Aneesh V wrote: >>>> --- a/arch/arm/config.mk >>>> +++ b/arch/arm/config.mk >>>> >>>> -# Explicitly specifiy 32-bit ARM ISA since toolchain default can be >>>> -mthumb: +# Choose between ARM/Thumb instruction sets >>>> +ifeq ($(CONFIG_SYS_THUMB_BUILD),y) >>>> +PF_CPPFLAGS_ARM := $(call cc-option, -mthumb -mthumb-interwork,\ >>>> + $(call cc-option,-marm,)\ >>>> + $(call cc-option,-mno-thumb-interwork,)\ >>>> + ) >>>> +else >>>> >>>> PF_CPPFLAGS_ARM := $(call cc-option,-marm,) >>>> >>>> +PF_CPPFLAGS_ARM += $(call cc-option,-mno-thumb-interwork,) >>> >>> this 2nd part is no good. "+=" is not the same thing as ":=". >> >> I don't understand the difference. '+=' is done after ':=' right? >> >>> might be simpler to do: >>> PF_CPPFLAGS_MARM := $(call cc-option,-marm) >>> PF_CPPFLAGS_THUMB := $(call cc-option,-mthumb -mthumb-interwork) >>> PF_CPPFLAGS_NO_THUMB := $(call cc-option,-mno-thumb-interwork) >>> >>> ifeq ($(CONFIG_SYS_THUMB_BUILD),y) >>> PF_CPPFLAGS_ARM = $(PF_CPPFLAGS_THUMB) >>> else >>> PF_CPPFLAGS_ARM = $(PF_CPPFLAGS_MARM) $(PF_CPPFLAGS_NO_THUMB) >>> endif >> >> Are you trying to avoid all '+='. If so, why? > > "+=" does delayed evaluation and is the whole reason we started using ":=" in > makefiles for *computed* values > > when you do: > FOO := $(call cc-option,-marm) > you're storing the result of the computation in $(FOO) > > if you do: > FOO += $(call cc-option,-marm) > you're appending "$(call cc-option,-marm)" to $(FOO) and that won't actually > get computed until $(FOO) gets used > > so if you append $(call ...) to $(CPPFLAGS), then you end up doing the cc- > option computation every time you compile a file that uses $(CPPFLAGS) Get it. Thanks for explaining. I missed the computation part. br, Aneesh > -mike