Created attachment 181879 [details] gcc build fix When there is gcc installed protobuf fails to build: libtool: compile: c++ -std=c++11 -DHAVE_CONFIG_H -I. -I.. -isystem /usr/local/include -D_THREAD_SAFE -pthread -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wno-sign-compare -O2 -pipe -march=native -DGOOGLE_PROTOBUF_NO_RTTI -fstack-protector -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -MT google/protobuf/compiler/js/js_generator.lo -MD -MP -MF google/protobuf/compiler/js/.deps/js_generator.Tpo -c google/protobuf/compiler/js/js_generator.cc -fPIC -DPIC -o google/protobuf/compiler/js/.libs/js_generator.o /usr/local/lib/gcc49/libstdc++.so.6: version GLIBCXX_3.4.21 required by /hdd/ports/devel/protobuf/work/protobuf-3.2.0/src/js_embed not found gmake[3]: *** [Makefile:7853: google/protobuf/compiler/js/well_known_types_embed.cc] Error 1 gmake[3]: *** Waiting for unfinished jobs.... This is due to wrong native compiler detection. Attached patch fixes this by hardcoding detected native compiler to system compiler which generates proper js_embed binary that can be then executed without problems.
I cannot reproduce this failure with either lang/gcc (5.4.0) or lang/gcc6 (6.3.0) installed. Could you retry with protobuf 3.3.0 which I've committed today? Thanks.
Same error on 10,3.amd64. Also with the updated version. Can confirm the patch solves the problem.
Problem persists with 3.3.0 for me also.
Both of you are running 10.3 and lang/gcc (5.4.0)?
Yes, gcc from base and 10.3-RELEASE-p18 amd64.
if have a different error message /usr/local/lib/compat/libstdc++.so.6: version GLIBCXX_3.4.21 required by /ram/usr/ports/devel/protobuf/work/protobuf-3.3.0/src/js_embed not found gmake[3]: *** [Makefile:8117: google/protobuf/compiler/js/well_known_types_embed.cc] Error 1 gmake[3]: *** Waiting for unfinished jobs.. It compiles fine if I remove compat9x (but I needed for other ports).
r 439822 ends with the same error message.
I can reproduce this bug on 12-CURRENT and 10.3, on both systems gcc-5.4.0_1 and gcc49-4.9.4_2 packages are installed. In my case gcc49 seems to be culprit: /usr/local/lib/gcc49/libstdc++.so.6: version GLIBCXX_3.4.21 required by /hdd/ports/devel/protobuf/work/protobuf-3.2.0/src/js_embed not found
src/Makefile.am: 510 # The special JS code for the well-known types is linked into the compiler via 511 # well_known_types_embed.cc, which is generated from .js source files. We have 512 # to build the js_embed binary using $(CXX_FOR_BUILD) so that it is executable 513 # on the build machine in a cross-compilation setup. 514 js_embed$(EXEEXT): $(srcdir)/google/protobuf/compiler/js/embed.cc 515 $(CXX_FOR_BUILD) -o $@ $<
Same problem here (10.3, gcc-5.4.0_1) CONFIGURE_ENV= CXX_FOR_BUILD=c++ from patch works for me, thanks.
Committed. Thanks!
A commit references this bug: Author: sunpoet Date: Mon May 8 12:47:06 UTC 2017 New revision: 440430 URL: https://svnweb.freebsd.org/changeset/ports/440430 Log: Fix build with gcc installed PR: 218740 Submitted by: pawel MFH: 2017Q2 Changes: head/devel/protobuf/Makefile
A commit references this bug: Author: sunpoet Date: Tue May 9 17:19:15 UTC 2017 New revision: 440508 URL: https://svnweb.freebsd.org/changeset/ports/440508 Log: MFH: r440430 Fix build with gcc installed PR: 218740 Submitted by: pawel Approved by: ports-secteam Changes: _U branches/2017Q2/ branches/2017Q2/devel/protobuf/Makefile