Bug 8274

Summary: libatomic missing from builds
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Thiago Macieira <thiago>
Component: coreAssignee: Ross Burton <ross.burton>
Status: VERIFIED FIXED QA Contact: Bogdan Alexandru Voiculescu <bogdanx.a.voiculescu>
Severity: normal    
Priority: Medium+ CC: bogdanx.a.voiculescu, meta.mr.watcher, meta.watcher
Version: 1.8   
Target Milestone: 2.0   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Thiago Macieira 2015-09-09 21:36:00 UTC
libatomic is part of GCC and contains the code for certain atomic data access that GCC might generate. 

On most architectures, modern GCC will inline all the calls via builtins, but there are some data sizes for which the intrinsics will result in out-of-line accesses to libatomic. (e.g., 8-byte access on MIPS32 and PPC32, any non-standard size like 3, 5, 6, 7, 9 bytes, etc.)

For that reason, libatomic should be part of all toolchains and I guess part of OE-Core. At the very least, it needs to be part of the MIPS32 and PPC32 toolchains, since 8-byte loads are out-of-line on those architectures.

This came about on Qt work: Qt 5.7 may require 8-byte atomic loads to succeed, so libatomic needs to be present where 8-byte loads result in out-of-line calls. (Qt 5.7 is scheduled for sometime early next year).

Also note that libatomic is in /usr/lib/.debug for those images, but not in regular form:

$ find /opt/poky -name libatomic.so.1.1.0 2>/dev/null
/opt/poky/1.7/sysroots/ppce500v2-poky-linux-gnuspe/usr/lib/.debug/libatomic.so.1.1.0
/opt/poky/1.7/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/lib/.debug/libatomic.so.1.1.0
/opt/poky/1.7/sysroots/mips32r2-poky-linux/usr/lib/.debug/libatomic.so.1.1.0
/opt/poky/1.8/sysroots/mips32r2-poky-linux/usr/lib/.debug/libatomic.so.1.1.0
Comment 1 Thiago Macieira 2015-09-10 15:40:39 UTC
Any chance of still fixing this for 1.9? It shouldn't be hard: libatomic must be being built already, as the debug symbols are there. I'm asking that it be packaged and included in poky.
Comment 2 Ross Burton 2015-09-10 15:59:39 UTC
1.9 is 2.0, we kept the 1.9M names for tracking but the release will be 2.0.
Comment 3 Ross Burton 2015-09-21 19:44:28 UTC
Patch on the list.

The debug file is included because all of gcc-runtime's debug symbols are in a single package.  Not sure what you mean by "not in regular form", it appears normal to me on my qemumips build.
Comment 4 Thiago Macieira 2015-09-21 21:05:33 UTC
(In reply to comment #3)
> Patch on the list.
> 
> The debug file is included because all of gcc-runtime's debug symbols are in
> a single package.  Not sure what you mean by "not in regular form", it
> appears normal to me on my qemumips build.

I meant that the regular library (not the .debug one) is not included in the default sysroot image, but the debug file for it is.
Comment 5 Ross Burton 2015-09-29 12:23:13 UTC
Fixed in oe-core 55e8067d3fb6a1fc97b4486e28e3e3bae2b5cd00.
Comment 6 Bogdan Alexandru Voiculescu 2015-10-26 16:06:14 UTC
Verified on master: 505a82673ac2487df5ea343a6422c2fc47018831
./tmp/sysroots/qemux86-64/usr/lib64/libatomic.so.1.1.0
./tmp/sysroots/lib32-qemux86-64/usr/lib/libatomic.so.1.1.0

/opt/poky/2.0_AB$ sudo find . -name libatomic.so.1.1.0
./sysroots/core2-64-poky-linux/usr/lib/libatomic.so.1.1.0
./sysroots/core2-64-poky-linux/usr/lib/.debug/libatomic.so.1.1.0