On Wed, Mar 15, 2017 at 9:10 PM, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote: > On 15 March 2017 at 19:45, Manuel Lauss wrote: >> 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). > > Does it help if you put -Wl,--no-as-needed before -lpthread? Yes it does, thanks a lot! Manuel