Bug 233765 - devel/protobuf: fix build with GCC-based architectures
Summary: devel/protobuf: fix build with GCC-based architectures
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Sunpoet Po-Chuan Hsieh
Depends on:
Reported: 2018-12-04 07:31 UTC by Piotr Kubaj
Modified: 2018-12-06 20:34 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (sunpoet)

patch (476 bytes, patch)
2018-12-04 07:31 UTC, Piotr Kubaj
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer 2018-12-04 07:31:27 UTC
Created attachment 199808 [details]

After update of protobuf to 3.6.1,1, it fails to build with GCC7 again.
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!