[U-Boot] [PATCH v2] x86: lib: Implement standalone __udivdi3 etc instead of libgcc ones

Stefan Roese sr at denx.de
Wed Nov 29 08:42:34 UTC 2017


Hi Bin,

On 29.11.2017 09:30, Bin Meng wrote:

<snip>

>>> I wrote some codes soemthing like:
>>>
>>> s64 a, b, c;
>>> c = a/b;
>>>
>>> The compiler will generate codes to call __divdi3. This works before your
>>> patch.
>>
>>
>> Yes, I understand this. But right now, we don't have any code
>> generating this error. And if this will happen at some time, I would
>> prefer to investigate this code sequence introducing this division, to
>> use the division functions / macros available in U-Boot (as mentioned
>> above) and in the kernel instead.
>>
>> Here a short explanation, why this new version is preferred to the
>> currently available functions pulled from libgcc: We are fixing an
>> "ugly" Yocto build problem with this patch, related to 32bit binaries
>> with 64bit toolchains (multilib) building by not relying on anything
>> from libgcc. Please see this thread for some more details:
>>
>> https://www.mail-archive.com/yocto@yoctoproject.org/msg36721.html
>>
>> I hope this helps a bit to understand the motivation behind this patch.
>>
> 
> Thanks for the background. I am not familiar with yocto project, but
> is the build broken due to the gcc on the build host does not ship
> with multilib?

Please take a look at the email thread mentioned above for a detailed
explanation. Especially this post should answer your questions:

https://www.mail-archive.com/yocto@yoctoproject.org/msg36748.html

> I am using a 64-bit host with gcc multilib, and there is no such build
> error observed.

Right. This issue is only seen on Yocto builds (AFAIK). But again,
I would really like to see U-Boot x86 being self-contained without
any host libgcc dependencies as on other architectures as well.

Thanks,
Stefan


More information about the U-Boot mailing list