From a47917b97606a03f6bbf0cafd1fcd495b0229790 Mon Sep 17 00:00:00 2001 From: john hood Date: Sat, 19 Mar 2016 00:04:44 +0000 Subject: [PATCH] configure.ac: Do s/-pthreads -lpthreads/-pthreads/ for protobuf protobuf uses an obsolete automake pthreads detection macro, which results in "pkgconfig --libs protobuf" returning "-lprotobuf -pthread -lpthread" on Linux. Remove the unnecessary and dangerous -lpthread in that case. Fixes #727, mosh-server crash in libutempter on Debian Sid. --- configure.ac | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configure.ac b/configure.ac index b1c2937..6e820f5 100644 --- a/configure.ac +++ b/configure.ac @@ -446,6 +446,13 @@ AC_CHECK_DECL([IUTF8], # Checks for protobuf PKG_CHECK_MODULES([protobuf], [protobuf]) +# On Debian Sid 2016-03-16ish at least, "pkgconfig --libs protobuf" +# gives us the bogus "-lprotobuf -pthread -lpthread"; remove +# "-lpthread" which misconfigures compile, causing a segfault in +# mosh-server. +AS_IF([echo "$protobuf_LIBS" | grep -q -- -pthread], + [protobuf_LIBS="`echo $protobuf_LIBS | sed 's/-lpthread//g'`"]) + # Bash completion needs to ask where it goes if >= 2.0 is installed. AS_IF([test "$install_completion" != no], [PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0],