[Mesa-dev] [Bug 101071] compiling glsl fails with undefined reference to `pthread_create'

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Aug 10 08:06:36 UTC 2017


--- Comment #16 from John <john.ettedgui at gmail.com> ---

I've been having the same issue for a while, even with Emil's patch on master:

libtool: link: ( cd "glsl/.libs" && rm -f "libstandalone.la" && ln -s
"../libstandalone.la" "libstandalone.la" )
/bin/sh ../../libtool  --tag=CXX   --mode=link g++ -fvisibility=hidden
-Werror=pointer-arith -Werror=vla -march=native -O2 -pipe
-fstack-protector-strong -fno-plt -fstack-check -flto=8 -g
-fvar-tracking-assignments -g -fvar-tracking-assignments -Wall -fno-math-errno
-fno-trapping-math   -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
-Wl,-flto -o glsl_compiler glsl/main.o glsl/libstandalone.la  
libtool: link: g++ -fvisibility=hidden -Werror=pointer-arith -Werror=vla
-march=native -O2 -pipe -fstack-protector-strong -fno-plt -fstack-check -flto=8
-g -fvar-tracking-assignments -g -fvar-tracking-assignments -Wall
-fno-math-errno -fno-trapping-math -Wl,-O1 -Wl,--sort-common -Wl,--as-needed
-Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,-flto -o glsl_compiler glsl/main.o 
glsl/.libs/libstandalone.a -lz -lpthread -pthread
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../lib/libstdc++.so: undefined
reference to `pthread_create'
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../lib/libstdc++.so: undefined
reference to `pthread_once'
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../lib/libstdc++.so: undefined
reference to `pthread_join'
collect2: error: ld returned 1 exit status

If I remove "--as-needed" from my LDFLAGS it compiles with no problem.

I'm on GCC 7.1.1, glibc 2.25, not cross-compiling, but compiling for my system.

What am I doing wrong?


You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170810/578468b0/attachment.html>

More information about the mesa-dev mailing list