Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Oct 2016 10:01:27 +1100
From:      Dewayne Geraghty <dewaynegeraghty@gmail.com>
To:        ports-list freebsd <freebsd-ports@freebsd.org>
Subject:   Problem with gcc5 std library when building ports
Message-ID:  <CAGnMC6pcVCgv4_g-3At5drkTAaVicCS1U4yXXdV2-QOF92=fYg@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Have spent a couple of days trying to build around 800 ports with gcc5.
This one has me stumped!

Can anyone help regarding the apparant absence of snprintf from std?  Am I
missing something, perhaps LDCONFIG or?  I've looked in /usr/ports/Mk/
bsd.gcc.mk and /usr/ports/Mk/bsd.port.mk but this is an area that I'm
unfamiliar, so nothing really stood out.

If I change the compiler from gcc5 to clang everything compiles and runs
correctly. I have in /etc/make.conf
USE_GCC=  5
and to use clang, I just comment out the above. So everything is constant,
on FreeBSD 10.3Stable (updated and rebuilt overnight)

For example: /usr/ports/devel/jsoncpp (but many share this problem)
g++5 -o buildscons/linux-gcc-FreeBSD/src/lib_json/json_reader.o -c -O2
-pipe -DOPENSSL_NO_SSL2 -DOPENSSL_NO_SSL3 -g0 -ggdb0 -DSTRIP_FBSDID
-UDEBUGGING -UDEBUG -march=c3-2 -mtune=c3-2 -Wl,-rpath=/usr/local/lib/gcc5
-fno-strict-aliasing --std=c++11 -Wl,-rpath=/usr/local/lib/gcc5 -Iinclude
src/lib_json/json_reader.cpp

src/lib_json/json_reader.cpp: In member function 'std::__cxx11::string
Json::Reader::getLocationLineAndColumn(Json::Reader::Location) const':
src/lib_json/json_reader.cpp:34:18: error: 'snprintf' is not a member of
'std'
 #define snprintf std::snprintf

And for completeness:
# ldconfig -r | grep -E "gcc|\+"
        search directories:
/lib:/usr/lib:/usr/lib/compat:/usr/local/lib:/usr/local/lib/gcc5:/usr/local/lib/heimdal:/usr/local/lib/perl5/5.20/mach/CORE
        35:-lgcc_s.1 => /lib/libgcc_s.so.1
        38:-lc++.1 => /usr/lib/libc++.so.1
        126:-lcc1.0 => /usr/local/lib/gcc5/libcc1.so.0
        127:-lgcc_s.1 => /usr/local/lib/gcc5/libgcc_s.so.1
        128:-lstdc++.6 => /usr/local/lib/gcc5/libstdc++.so.6
        129:-lcilkrts.5 => /usr/local/lib/gcc5/libcilkrts.so.5
        130:-lssp.0 => /usr/local/lib/gcc5/libssp.so.0
        131:-lquadmath.0 => /usr/local/lib/gcc5/libquadmath.so.0
        132:-lgfortran.3 => /usr/local/lib/gcc5/libgfortran.so.3
        133:-lobjc.4 => /usr/local/lib/gcc5/libobjc.so.4
        134:-lgomp.1 => /usr/local/lib/gcc5/libgomp.so.1
        135:-lgomp-plugin-host_nonshm.1 =>
/usr/local/lib/gcc5/libgomp-plugin-host_nonshm.so.1
        136:-litm.1 => /usr/local/lib/gcc5/libitm.so.1
        137:-latomic.1 => /usr/local/lib/gcc5/libatomic.so.1

Regards, Dewayne



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGnMC6pcVCgv4_g-3At5drkTAaVicCS1U4yXXdV2-QOF92=fYg>