Bug 233765

Summary: devel/protobuf: fix build with GCC-based architectures
Product: Ports & Packages Reporter: Piotr Kubaj <pkubaj>
Component: Individual Port(s)Assignee: Sunpoet Po-Chuan Hsieh <sunpoet>
Status: Closed FIXED    
Severity: Affects Only Me CC: linimon, pkubaj
Priority: --- Flags: bugzilla: maintainer-feedback? (sunpoet)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch none

Description Piotr Kubaj freebsd_committer 2018-12-04 07:31:27 UTC
Created attachment 199808 [details]
patch

After update of protobuf to 3.6.1,1, it fails to build with GCC7 again.
Error:
google/protobuf/stubs/common.cc:52:2: error: #error "No suitable threading library available."
 #error "No suitable threading library available."
  ^~~~~

The problem is that HAVE_PTHREAD is undefined. configure checks whether pthread is available and then defines HAVE_THREAD, but only does so when _THREAD_SAFE is defined, so we need to add _THREAD_SAFE to CFLAGS.

Tested on powerpc64 and amd64.

Hardware sponsored by IntegriCloud.
Comment 1 Sunpoet Po-Chuan Hsieh freebsd_committer 2018-12-06 20:34:39 UTC
Committed. Thanks!