[MacPorts] #56366: protobuf3-cpp fails to compile on OSX 10.8

MacPorts noreply at macports.org
Sun Apr 29 01:01:32 UTC 2018


#56366: protobuf3-cpp fails to compile on OSX 10.8
----------------------------+------------------------------------
  Reporter:  letaage        |      Owner:  blair@…
      Type:  defect         |     Status:  assigned
  Priority:  Normal         |  Milestone:
 Component:  ports          |    Version:  2.4.2
Resolution:                 |   Keywords:  mountainlion legacy-os
      Port:  protobuf3-cpp  |
----------------------------+------------------------------------

Comment (by kencu):

 OK. Well, first of all it's not building with clang-5.0 even though you
 asked it to do so. So that's one thing (I assume you cleaned in between
 attempts, right? Otherwise nothing would have been different in the
 configuration). So if that is true, we'll need to fix that. I suspect
 maybe the clean between attempts was missed, though, because it accepts
 the compiler forcing for me when I build it.

 But here's the issue:

 it's building like this: (notice the -stdlib=libc++ on the build line)
 {{{
 build libtool: compile:  /usr/bin/clang++ -std=c++11 -DHAVE_CONFIG_H -I.
 -I.. -I/opt/local/include -g -D_THREAD_SAFE -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1
 -Wall -Wno-sign-compare -pipe -Os -stdlib=libc++ -arch x86_64 -MT
 google/protobuf/compiler/js/well_known_types_embed.lo -MD -MP -MF
 google/protobuf/compiler/js/.deps/well_known_types_embed.Tpo -c
 google/protobuf/compiler/js/well_known_types_embed.cc -o
 google/protobuf/compiler/js/well_known_types_embed.o >/dev/null 2>&1
 }}}

 but it's linking like this: (notice no -stdlib is specified):
 {{{
 :info:build libtool: link: /usr/bin/clang++ -dynamiclib  -o
 .libs/libprotobuf.15.dylib
 google/protobuf/stubs/.libs/atomicops_internals_x86_gcc.o
 google/protobuf/stubs/.libs/atomicops_internals_x86_msvc.o
 google/protobuf/stubs/.libs/bytestream.o
 google/protobuf/stubs/.libs/common.o google/protobuf/stubs/.libs/int128.o
 google/protobuf/stubs/.libs/io_win32.o google/protobuf/stubs/.libs/once.o
 google/protobuf/stubs/.libs/status.o
 google/protobuf/stubs/.libs/statusor.o
 google/protobuf/stubs/.libs/stringpiece.o
 google/protobuf/stubs/.libs/stringprintf.o
 google/protobuf/stubs/.libs/structurally_valid.o
 google/protobuf/stubs/.libs/strutil.o google/protobuf/stubs/.libs/time.o
 google/protobuf/.libs/arena.o google/protobuf/.libs/arenastring.o
 google/protobuf/.libs/extension_set.o
 google/protobuf/.libs/generated_message_util.o
 google/protobuf/.libs/generated_message_table_driven_lite.o
 google/protobuf/.libs/message_lite.o
 google/protobuf/.libs/repeated_field.o
 google/protobuf/.libs/wire_format_lite.o
 google/protobuf/io/.libs/coded_stream.o
 google/protobuf/io/.libs/zero_copy_stream.o
 google/protobuf/io/.libs/zero_copy_stream_impl_lite.o
 google/protobuf/.libs/any.pb.o google/protobuf/.libs/api.pb.o
 google/protobuf/stubs/.libs/mathlimits.o google/protobuf/.libs/any.o
 google/protobuf/.libs/descriptor.o
 google/protobuf/.libs/descriptor_database.o
 google/protobuf/.libs/descriptor.pb.o google/protobuf/.libs/duration.pb.o
 google/protobuf/.libs/dynamic_message.o google/protobuf/.libs/empty.pb.o
 google/protobuf/.libs/extension_set_heavy.o
 google/protobuf/.libs/field_mask.pb.o
 google/protobuf/.libs/generated_message_reflection.o
 google/protobuf/.libs/generated_message_table_driven.o
 google/protobuf/.libs/map_field.o google/protobuf/.libs/message.o
 google/protobuf/.libs/reflection_ops.o google/protobuf/.libs/service.o
 google/protobuf/.libs/source_context.pb.o
 google/protobuf/.libs/struct.pb.o google/protobuf/stubs/.libs/substitute.o
 google/protobuf/.libs/text_format.o google/protobuf/.libs/timestamp.pb.o
 google/protobuf/.libs/type.pb.o google/protobuf/.libs/unknown_field_set.o
 google/protobuf/.libs/wire_format.o google/protobuf/.libs/wrappers.pb.o
 google/protobuf/io/.libs/gzip_stream.o google/protobuf/io/.libs/printer.o
 google/protobuf/io/.libs/strtod.o google/protobuf/io/.libs/tokenizer.o
 google/protobuf/io/.libs/zero_copy_stream_impl.o
 google/protobuf/compiler/.libs/importer.o
 google/protobuf/compiler/.libs/parser.o
 google/protobuf/util/.libs/delimited_message_util.o
 google/protobuf/util/.libs/field_comparator.o
 google/protobuf/util/.libs/field_mask_util.o
 google/protobuf/util/internal/.libs/datapiece.o
 google/protobuf/util/internal/.libs/default_value_objectwriter.o
 google/protobuf/util/internal/.libs/error_listener.o
 google/protobuf/util/internal/.libs/field_mask_utility.o
 google/protobuf/util/internal/.libs/json_escaping.o
 google/protobuf/util/internal/.libs/json_objectwriter.o
 google/protobuf/util/internal/.libs/json_stream_parser.o
 google/protobuf/util/internal/.libs/object_writer.o
 google/protobuf/util/internal/.libs/protostream_objectsource.o
 google/protobuf/util/internal/.libs/protostream_objectwriter.o
 google/protobuf/util/internal/.libs/proto_writer.o
 google/protobuf/util/internal/.libs/type_info.o
 google/protobuf/util/internal/.libs/type_info_test_helper.o
 google/protobuf/util/internal/.libs/utility.o
 google/protobuf/util/.libs/json_util.o
 google/protobuf/util/.libs/message_differencer.o
 google/protobuf/util/.libs/time_util.o
 google/protobuf/util/.libs/type_resolver_util.o   -L/opt/local/lib -lz
 -Os -arch x86_64 -Wl,-headerpad_max_install_names -arch x86_64
 -install_name  /opt/local/lib/libprotobuf.15.dylib -compatibility_version
 16 -current_version 16.1 -Wl,-single_module
 }}}

 so therefore, because no stdlib is specified on the link line, clang on
 10.8 inserts -stdlib=libstdc++, and that's the wrong one for you.

 Looks like this port needs some surgery, but to get you moving along, do
 something like this:

 {{{
 sudo port clean protobuf3-cpp

 sudo vi `port file protobuf3-cpp`
 }}}
 add a line like this:
 {{{
 configure.ldflags-append -stdlib=libc++
 }}}
 save the file, and then rebuild it:
 {{{
 sudo port -v install protobuf3-cpp
 }}}
 and you _should_ be in business after that.

-- 
Ticket URL: <https://trac.macports.org/ticket/56366#comment:9>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list