Created attachment 197192 [details] patch This patch takes care of two things: 1) it sets USES=localbase:ldflags, instead of manually specifying CPPFLAGS and LDFLAGS, 2) it adds USE_CXXSTD, which fixes build on arches using GCC. Tested on amd64 and powerpc64.
A commit references this bug: Author: linimon Date: Mon Nov 5 17:15:34 UTC 2018 New revision: 484203 URL: https://svnweb.freebsd.org/changeset/ports/484203 Log: Add USE_CXXSTD to fixes build on arches using GCC. Set USES=localbase:ldflags, instead of manually specifying CPPFLAGS and LDFLAGS. Tested on powerpc64 (just this port), amd64 (this port plus libreoffice). PR: 231447 Submitted by: Piotr Kubaj Approved by: portmgr (tier-2 blanket) Changes: head/devel/liborcus/Makefile
Why USE_CXXSTD line is necessary? GCC defaults to C++14 since r449590.
Created attachment 199004 [details] v2 It depends on what -std= is Boost compiled with. Now that it switched to c++17, so has to liborcus (probably also other ports). I tested that it doesn't build on powerpc64 with both c++11 and c++14, but does build with c++17.
Opening again.
(In reply to Piotr Kubaj from comment #3) > It depends on what -std= is Boost compiled with. Can you show the error when USE_CXXSTD is omitted? libstdc++ ABI is supposed to be compatible across standards, assuming the same libstdc++ version is used. https://stackoverflow.com/questions/46746878/is-it-safe-to-link-c17-c14-and-c11-objects
(In reply to Jan Beich from comment #5) Sure, I have the same problem with other ports dependent on Boost and changing USE_CXXSTD actually helps. When running configure target: checking boost/system/error_code.hpp usability... yes checking boost/system/error_code.hpp presence... yes checking for boost/system/error_code.hpp... yes checking for the Boost system library... no configure: error: cannot find the flags to link with Boost system ===> Script "configure" failed unexpectedly. In config.log there is: conftest.o:(.toc+0x0): undefined reference to `boost::system::detail::generic_category_instance' conftest.o:(.toc+0x8): undefined reference to `boost::system::detail::generic_category_instance'
(In reply to Piotr Kubaj from comment #6) > In config.log there is: > conftest.o:(.toc+0x0): undefined reference to `boost::system::detail::generic_category_instance' > conftest.o:(.toc+0x8): undefined reference to `boost::system::detail::generic_category_instance' Looks like https://github.com/boostorg/system/issues/24 Compiling with C++14 should be enough. USE_GCC already defaults to C++14 since bug 219275, so USE_CXXSTD line is not required. And if you mean to support GCC < 7 (non-default) as well then C++17 is out of scope.
(In reply to Jan Beich from comment #7) Nope, it doesn't compile with c++14. root@talos:$/usr/ports/devel/liborcus$ make -V USE_CXXSTD c++14 From make configure: checking boost/system/error_code.hpp usability... yes checking boost/system/error_code.hpp presence... yes checking for boost/system/error_code.hpp... yes checking for the Boost system library... no configure: error: cannot find the flags to link with Boost system ===> Script "configure" failed unexpectedly. And from config.log: configure:18087: g++7 -o conftest -fvisibility=hidden -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc7 -Wl,-rpath=/usr/local/lib/gcc7 -isystem /usr/local/i nclude -std=c++14 -Wall -pthread -isystem /usr/local/include -I/usr/local/include -Wl,-rpath=/usr/local/lib/gcc7 -L/usr/local/lib/gcc7 -L/usr/local /lib -L/usr/local/lib conftest.o -lboost_system >&5 conftest.o:(.toc+0x0): undefined reference to `boost::system::detail::generic_category_instance' conftest.o:(.toc+0x8): undefined reference to `boost::system::detail::generic_category_instance' collect2: error: ld returned 1 exit status
(In reply to Jan Beich from comment #7) > Compiling with C++14 should be enough. Err, compiling devel/boost-libs only. That issue doesn't affect consumers. I've tried to reproduce on amd64 by building both devel/boost-libs and devel/liborcus with USE_GCC but those built fine. (In reply to Piotr Kubaj from comment #8) > Nope, it doesn't compile with c++14. When was the last time you've rebuilt devel/boost-libs? I hope it's sometime after bug 222542 landed. I just don't understand how changing C++14 to C++17 is going to fix your issue.
(In reply to Jan Beich from comment #9) It's actually a newly installed FreeBSD. root@talos:$~$ pkg info boost-libs-1.68.0_2 boost-libs-1.68.0_2 Name : boost-libs Version : 1.68.0_2 Installed on : Tue Nov 6 09:11:55 2018 CET I'm not a Boost expert, so I can't explain it. It might be a Boost bug after all. But the fact is that it just doesn't build with c++14 (or c++11), but builds with c++17.
Can you check devel/boost-libs actually builds in C++14 or C++17 mode or upload build log somewhere (e.g., via a pastebin service)? Maybe something fails on powerpc* which reintroduces the regression appeared since Boost 1.68. Fixing consumers to follow Boost C++ version doesn't look correct. Not every consumer is compatible with C++11, let alone C++17. Only USES=compiler:c++11-lib is really required to force the same libstdc++ version.
Also, the next Boost version (bug 232525) will make System library header-only which eliminates all linking issues it can cause.
boost-libs compiles in c++17, just as it should (according to devel/boost-all/compiled.mk): https://talos.anongoth.pl/data/powerpc64-default/2018-11-06_16h38m24s/logs/boost-libs-1.68.0_2.log
A commit references this bug: Author: jbeich Date: Wed Nov 7 02:47:39 UTC 2018 New revision: 484377 URL: https://svnweb.freebsd.org/changeset/ports/484377 Log: devel/boost-libs: unbreak some C++14 consumers with GCC after r479222 Boost 1.68 changed System ABI[1] for C++14 but due to a GCC bug it's disabled for C++ >= 17. As our Boost package is built in C++17 consumers cannot use C++14. So, disable the new ABI for the affected GCC versions regardless of C++ standard. [1] https://github.com/boostorg/system/commit/7b6dcf6ac668 PR: 231447 Reported by: Piotr Kubaj Changes: head/devel/boost-libs/Makefile head/devel/boost-libs/files/patch-boost_system_error__code.hpp
A commit references this bug: Author: jbeich Date: Wed Nov 7 03:04:44 UTC 2018 New revision: 484378 URL: https://svnweb.freebsd.org/changeset/ports/484378 Log: devel/liborcus: drop USE_CXXSTD after r484377 PR: 231447 Changes: head/devel/liborcus/Makefile
Thank you for the feedback. I was able to reproduce: - devel/boost-libs had to be 1.68 (because 1.69 is header-only) - devel/boost-libs had to be built in C++17 (but GCC >= 6 default is C++14) - lang/gcc7 had to be less than 7.4.0 - devel/liborcus had to not set -std= and rely on compiler default
Forgot in comment 16: - GCC_DEFAULT had to be 7 (GCC < 7 has poor C++17 support while GCC >= 8 isn't affected) Once lang/gcc7 is upgraded to 7.4.0 but neither bug 231590 nor bug 232525 landed yet PORTREVISION in devel/boost-libs needs to be bumped or System wouldn't expose the new ABI.