LTO: cannot find pthread_create() and friends

Manuel Lauss manuel.lauss@gmail.com
Wed Mar 15 20:10:00 GMT 2017


Hello,

I'm trying to build a current mesa git shapshot with LTO,
and it fails with this error in src/compiler/:   (gcc-6.3.1 as of
today, glibc-2.25)

x86_64-pc-linux-gnu-g++ -m32 -fvisibility=hidden -Werror=pointer-arith
-Werror=vla -O3 -march=haswell -mtune=haswell-flto=9
-fno-fat-lto-objects -pipe -Wall -fno-math-errno -fno-trapping-math
-Wl,-O1 -o glsl_compiler glsl/main.o  -Wl,--as-needed
glsl/.libs/libstandalone.a -lz -lpthread
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/32/libstdc++.so: undefined
reference to `pthread_create'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/32/libstdc++.so: undefined
reference to `pthread_once'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/32/libstdc++.so: undefined
reference to `pthread_join'

Any ideas why pthread_once() can't be found?  /lib32/libpthread.so does
have all the above mentioned symbols. Without LTO, it builds just fine
(however performance of the library suffers, lto helps mesa a lot).

Thank you!
      Manuel



More information about the Gcc-help mailing list