[U-Boot] [PATCH] arm: make arch memset/memcpy to work with Thumb2 builds

Stefan Agner stefan at agner.ch
Thu Nov 20 13:15:36 CET 2014


Hi Jeroen,

On 2014-11-20 10:21, Jeroen Hofstee wrote:
> Hello Stefan,
> 
> On 19-11-14 15:16, Stefan Agner wrote:
>> Resynchronize memcpy/memset with kernel and build them explicitly
>> in Thumb2 mode (unified syntax). Those assembler files can be
>> built and linked in ARM mode too, however when calling them from
>> Thumb2 built code, the stack got corrupted and the copy did not
>> succeed (the exact details have not been traced back). Hoever,
>> the Linux kernel builds those files in Thumb2 mode. Hence U-Boot
>> should build them in Thumb2 mode too when CONFIG_SYS_THUMB_BUILD
>> is set.
>>
>> Also add implicit-it=always to AFLAGS when building for Thumb2.
>> Furthermore add no-warn-deprecated option to AFLAGS to rid of
>> deprecated unified syntax:
> 
> 
>> arch/arm/lib/memcpy.S: Assembler messages:
>> arch/arm/lib/memcpy.S:153: Warning: conditional infixes are deprecated in unified syntax
>> arch/arm/lib/memcpy.S:154: Warning: conditional infixes are deprecated in unified syntax
>> ...
> 
> Any particular reason not to fix these warnings instead? It Is
> just a matter of making the conditionals suffixes. [I guess
> you can even disassemble to file to get the UAL represenation].
> Or are there gas version around which actually choke on that?

No particular reason, I did not know how to fix this without digging
into it. Hence, after I discovered this, I checked why those warnings do
not happen for the kernel, then I applied just the AFLAGS the kernel is
using. I guess fixing the underlying issue is the better option, and
doing this also for the kernel would be the best way... Maybe the kernel
community also knows better why they choose to use the AFLAGS instead
(and if there are gas version which do have problems with a proper
fix)...

--
Stefan


> 
> Regards,
> Jeroen



More information about the U-Boot mailing list