[Buildroot] [PATCH 1/1] protobuf: apply patch to compile for PowerPC

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Fri Feb 5 13:37:21 UTC 2016


Hello,

(Please try to avoid top-posting, this is considered bad practice on
most mailing list)

On Fri, 5 Feb 2016 11:22:58 -0200 (BRST), Henrique Marks wrote:
> Yes, once the atomic series enter master branch, we are going to proceed on with this patch:
> 
> - Change protobuf, as you stated.
> - Change Dependent Packages, it is four or five last time i checked out.
> - Build on powerpc these packages, with gcc > 4.8

Sounds good.

There is only one gotcha/limitation introduced by the atomic series:
the fact that building protobuf with gcc 4.7 will not be allowed,
while in fact it seems to be possible.

On PowerPC, the __atomic_*() built-ins for 1-byte, 2-byte and 4-byte
types are available built-in, without the need for libatomic. This
means that the __atomic_*() built-ins for those sizes are available in
gcc 4.7.

However, the __atomic_*() built-ins for 8-byte types is implemented via
libatomic, so only available since gcc 4.8.

In Buildroot, to simplify things, we've decided to simply require gcc
4.8 as soon as the architectures has at least one __atomic_*() built-in
variant that requires libatomic.

But in fact, protobuf most likely only uses the 1, 2 and 4-byte
variants, so it *could* technically build with gcc 4.7.

But oh, well, it's probably not a big deal, and we can live with
requiring gcc 4.8 on PowerPC to build protobuf. Is that OK for you?

If we want to do a more fine-grained selection, we would have to
introduce multiple BR2_TOOLCHAIN_HAS_ATOMIC_<x> options, like I've done
for the __sync_*() built-ins. It's possible, but a big annoying
especially since gcc 4.8 has everything needed.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the buildroot mailing list