Skip to content

Commit

Permalink
configure.ac: Do s/-pthreads -lpthreads/-pthreads/ for protobuf
Browse files Browse the repository at this point in the history
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 mobile-shell#727, mosh-server crash in libutempter on Debian Sid.
  • Loading branch information
cgull committed Mar 19, 2016
1 parent e7303e0 commit a47917b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit a47917b

Please sign in to comment.