Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 825042 - x11-libs/cairo-1.16.0-r5: fails to build (src/cairo-mutex-impl-private.h:262:3: error: #error "XXX: No mutex implementation found. Cairo will not work with multiple threads.)
Summary: x11-libs/cairo-1.16.0-r5: fails to build (src/cairo-mutex-impl-private.h:262:...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-19 17:46 UTC by Oleg Korsak
Modified: 2022-09-13 18:15 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,104.94 KB, text/plain)
2021-11-19 17:47 UTC, Oleg Korsak
Details
emerge-info.txt (emerge-info.txt,8.94 KB, text/plain)
2021-11-19 17:48 UTC, Oleg Korsak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Korsak 2021-11-19 17:46:33 UTC
x11-libs/cairo-1.16.0-r5 fails to build

Reproducible: Always

Steps to Reproduce:
1. emerge -1u x11-libs/cairo
2.
3.
Actual Results:  
fails to build

Expected Results:  
builds ok
Comment 1 Oleg Korsak 2021-11-19 17:47:28 UTC
Created attachment 753478 [details]
build.log
Comment 2 Oleg Korsak 2021-11-19 17:48:10 UTC
Created attachment 753482 [details]
emerge-info.txt
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-19 17:49:18 UTC
Please try again with vanilla CFLAGS as it seems likely some misdetection is happening here.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-19 17:49:50 UTC
O(In reply to Sam James from comment #3)
> Please try again with vanilla CFLAGS as it seems likely some misdetection is
> happening here.

... and you should _definitely_ not have -Wl,--start-group in {C,CXX}FLAGS.
Comment 5 Mart Raudsepp gentoo-dev 2022-01-01 10:29:40 UTC
Happens to me too for building 32bit multilib. The diff between the configure outputs is a bit worrying, in that for 32bit it even gets reports like this:

checking whether x86_64-pc-linux-gnu-gcc -m32 supports -Werror... no

But perhaps more relevant to the issue at hand, it gets this:

checking whether cairo's pthread feature could be enabled... no (can't link with -lpthread or -pthread)

  pthread:       no (can't link with -lpthread or -pthread)


Most or all the link tests in config.log go like this for me:

configure:27014: x86_64-pc-linux-gnu-gcc -m32 -o conftest -O2 -pipe -march=native -fno-omit-frame-pointer -ggdb2 -frecord-gcc-switches -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib32/glib-2.0/include -I/usr/include/sysprof-4 -pthread   -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu conftest.c -lrt  -lm -lfreetype  >&5
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: warning: /lib32/ld-linux.so.2: corrupt GNU_PROPERTY_TYPE (5) size: 0
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: warning: /lib32/ld-linux.so.2: corrupt GNU_PROPERTY_TYPE (5) size: 0

pthread check goes like this:

configure:29798: checking for cairo's pthread feature
configure:29909: x86_64-pc-linux-gnu-gcc -m32 -o conftest -O2 -pipe -march=native -fno-omit-frame-pointer -ggdb2 -frecord-gcc-switches -D_REENTRANT  -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu conftest.c -lrt  -lm -lpthread >&5
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: warning: /lib32/ld-linux.so.2: corrupt GNU_PROPERTY_TYPE (5) size: 0
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: warning: /lib32/ld-linux.so.2: corrupt GNU_PROPERTY_TYPE (5) size: 0
configure:29909: $? = 0
configure:30028: x86_64-pc-linux-gnu-gcc -m32 -o conftest -O2 -pipe -march=native -fno-omit-frame-pointer -ggdb2 -frecord-gcc-switches -pthread  -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu conftest.c -lrt  -lm  >&5
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: warning: /lib32/ld-linux.so.2: corrupt GNU_PROPERTY_TYPE (5) size: 0
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: warning: /lib32/ld-linux.so.2: corrupt GNU_PROPERTY_TYPE (5) size: 0
configure:30028: $? = 0
configure:30109: x86_64-pc-linux-gnu-gcc -m32 -o conftest -O2 -pipe -march=native -fno-omit-frame-pointer -ggdb2 -frecord-gcc-switches -D_REENTRANT  -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu conftest.c -lrt  -lm  >&5
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: warning: /lib32/ld-linux.so.2: corrupt GNU_PROPERTY_TYPE (5) size: 0
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: warning: /lib32/ld-linux.so.2: corrupt GNU_PROPERTY_TYPE (5) size: 0
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: DWARF error: can't find .debug_ranges section.
/tmp/portage/x11-libs/cairo-1.16.0-r5/temp/ccP4KRph.o: in function `test_mutex_attr':
conftest.c:(.text+0x84): undefined reference to `pthread_mutexattr_init'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: conftest.c:(.text+0x90): undefined reference to `pthread_mutexattr_settype'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: conftest.c:(.text+0xd8): undefined reference to `pthread_mutexattr_destroy'
collect2: error: ld returned 1 exit status



But I'm not sure the issue is the same as for Oleg, as I'm in the middle of getting some core stuff like glibc upgraded and it might have been some temporary glitch in the combination of older glibc and newer gcc or something along those lines for me. Would have to see cairo-1.16.0-abi_x86_32.x86/config.log from Oleg to be sure.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-01 10:30:54 UTC
(In reply to Mart Raudsepp from comment #5)
> 
> Most or all the link tests in config.log go like this for me:
> 
> configure:27014: x86_64-pc-linux-gnu-gcc -m32 -o conftest -O2 -pipe
> -march=native -fno-omit-frame-pointer -ggdb2 -frecord-gcc-switches
> -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0
> -I/usr/lib32/glib-2.0/include -I/usr/include/sysprof-4 -pthread   -Wl,-O1
> -Wl,--as-needed -Wl,--hash-style=gnu conftest.c -lrt  -lm -lfreetype  >&5
> /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/
> ld: warning: /lib32/ld-linux.so.2: corrupt GNU_PROPERTY_TYPE (5) size: 0
> /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/
> ld: warning: /lib32/ld-linux.so.2: corrupt GNU_PROPERTY_TYPE (5) size: 0
> 

What binutils?
Comment 7 Mart Raudsepp gentoo-dev 2022-01-01 11:44:36 UTC
binutils-2.34-r2, gcc-11.2.0, glibc-2.32-r8

I bet one of these getting upgraded will fix it or change things, but Oleg has newer of all of those, so might not be the same bug. Need to see his config.log
Comment 8 Mart Raudsepp gentoo-dev 2022-01-01 12:46:53 UTC
For me the problem was my glibc had been built with binutils-2.32-r2 still per emerge history. After I rebuilt the same old glibc-2.32-r8 with binutils-2.34-r2, the problem went away for cairo.

I figured out to try that based on https://bugzilla.redhat.com/show_bug.cgi?id=1736114

Though without seeing the OP config.log or emerge history, can't be sure this is the same bug still.
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-02 02:32:12 UTC
(In reply to Mart Raudsepp from comment #8)
> For me the problem was my glibc had been built with binutils-2.32-r2 still
> per emerge history. After I rebuilt the same old glibc-2.32-r8 with
> binutils-2.34-r2, the problem went away for cairo.
> 
> I figured out to try that based on
> https://bugzilla.redhat.com/show_bug.cgi?id=1736114
> 
> Though without seeing the OP config.log or emerge history, can't be sure
> this is the same bug still.

let's call it NEEDINFO. But like I said, the *FLAGS they're using are blatantly dangerous too.

Your situation makes sense though.