Skip to contentSkip to conversation

package/cairo: Do not use -latomic with non-threaded toolchains

PATCH New Bernd Kuhls 2 participants 3 messages Mar 6, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/cairo: Do not use -latomic with non-threaded toolchains

Fixes
http://autobuild.buildroot.net/results/ec4/ec4e48c0e4b8fa72d8bb7ef4ad67a166699c0b62/

Gcc used by the defconfig was compiled with --disable-libatomic:

$ /home/bernd/buildroot/buildroot/output/host/usr/bin/arm-linux-gcc -v
[...]
Thread model: single
gcc version 4.9.3 (Buildroot 2015.11-rc1-00072-g4880195)

Configure fails due to

configure:3517: checking whether the C compiler works
configure:3539: /home/peko/autobuild/instance-2/output/host/usr/bin/arm-linux-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DCAIRO_NO_MUTEX=1 conftest.c -latomic >&5 /home/peko/autobuild/instance-2/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/4.9.3/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/ld: cannot find -latomic

---
 package/cairo/cairo.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/cairo/cairo.mk +1 -1
index 6b54b28..d27a172 100644
@@ -18,7 +18,7 @@ endif
 
 # cairo can use C++11 atomics when available, so we need to link with
 # libatomic for the architectures who need libatomic.
-ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_8),y)
+ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_8)$(BR2_TOOLCHAIN_HAS_THREADS),yy)
 CAIRO_CONF_ENV += LIBS="-latomic"
 endif
 
Signature · 1 line
2.7.0
#1 lore raw

PATCH 1/1 package/cairo: Do not use -latomic with non-threaded toolchains

Dear Bernd Kuhls,

package/cairo/cairo.mk endif · line 23

Quoted 6 lines · Bernd Kuhls
 # cairo can use C++11 atomics when available, so we need to link with
 # libatomic for the architectures who need libatomic.
package/cairo/cairo.mk +1 -1
-ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_8),y)
+ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_8)$(BR2_TOOLCHAIN_HAS_THREADS),yy)
 CAIRO_CONF_ENV += LIBS="-latomic"
 endif

Thanks for this patch! However, I believe a more general solution is needed for this problem. I have just submitted two patches that aim at fixing this issue. See:

http://patchwork.ozlabs.org/patch/592591/
http://patchwork.ozlabs.org/patch/592592/

Let me know what you think.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 package/cairo: Do not use -latomic with non-threaded toolchains

[posted and mailed]

Thomas Petazzoni <thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8 @public.gmane.org> wrote in news:20160306214842.780b4925 at free-electrons.com:

Quoted 4 lines

http://patchwork.ozlabs.org/patch/592591/
http://patchwork.ozlabs.org/patch/592592/

Let me know what you think.

Hi Thomas,

I did not compile with your patches but they look good and should solve the problem.

Regards, Bernd