Dear maintainer I do agree that this bug report is a bit odd - who would seriously run
Dear maintainer I sent the message too early so sorry for the confusion. It sounds odd but I was having some fun on some PPC64 hardware (iMac G5) where I wanted to build X11 which at some odd moment requires jsoncpp and fails currently. I think the option it doesn't like is that it tests for the FreeBSD version and if it finds that it is on 10.x or later it assumes we have a modern compiler in the base system. In many and most common cases that is absolutely true, but PPC(64) doesn't ship with LLVM/clang in the base system but some older GCC 4.2.1 which doesn't support C++11. Same applies to other exotic architecture like SPARC. I don't know what the best idea would be to work around this issue: - Have a check that if PPC or PPC64 is found that no C++11 flag is set (then again all other architectures like ... sparc ... for what I know maybe others too) would have the same issue. - Have a check for the compiler at some point and see if it supports C++11 - Or if possible check for the compiler - if it's too old/certain architecture, depend on a modern compiler from ports instead. I think the first option would be easiest for what I can tell but it's not the cleanest. (Yes it is foolish to run X.org on PPC64 hardware these days but I wanted to see how far I could get) Regards Mathieu
COuld you suggest a patch that fixes it on PPC, and I will take it from there?
Hi Vladimir I'll do that mainly by looking if similar compiler workarounds exist in other ports for more exotic architectures too. I've been able to build jsoncpp with GCC 4.2.1 by quickly commenting out the section on the makefile assuming C++11 compat on 10.x which let the build pass. That's not a fix but it's to confirm that without C++11 support jsoncpp still builds with older GCC version. I'll ping you as soon as I have something I can share for review. -- Mathieu
Created attachment 171140 [details] Attemp to fix issues with older GCC version and C++11 enablement Hi Vladimir I think I may have something, it seems to compile on: - 10.3-amd64 (clang) -> Builds, with C++11 (expected, no regression) - 9.3-amd64 (GCC 4.2) -> Builds, without C++11 (expected, no regression) - 10.3-ppc64 (GCC 4.2) -> Builds, without C++11 (expected, now fixed) With this patch the port checks if the compiler is recent enough, not the OS type or OS version. This would have the added advantage of (quite likely) allowing DragonFly folks to compile lang/jsoncpp with C++11 support too since they ship newer GCC versions in their base and use the FreeBSD ports tree. The idea is based on what Mk/Uses/compiler.mk does and what I found in compiler checks such as in x11/eaglemode/Makefile. I agree that this patch somewhat duplicates the efforts of compiler.mk. However with this we still allow building on non-C++11 compilers as currently. The versions required for C++11 support of both clang and GCC support was based on for C++11 implementation status sites of each project: - clang: http://clang.llvm.org/cxx_status.html - GCC: https://gcc.gnu.org/projects/cxx-status.html#cxx11 Looking forward to your feedback. -- Mathieu
Ok, I approve the patch if committer doesn't see any regressions.
Comment on attachment 171140 [details] Attemp to fix issues with older GCC version and C++11 enablement Yuri, just this minor thing, and it's good to go. ;)
Hi Vladimir and Yuri If I'm right Yuri is currently the maintainer and has given its OK for commit. However I'm not certain I'm getting what what Vladimir last wrote: > Yuri, just this minor thing, and it's good to go. ;) If I should rework the patch, let me know no issues if that needs to happen first ;-) Thank your for your feedbacks so far. -- Mathieu
Vladimir should clarify. As far as I am concerned it can be committed if all required builds pass.
I apologize if I wasn't clear. I've set the maintainer-approval? request flag on the patch and meant Yuri should just mark it approved as that's the signal the maintainer is approving it, and the PR appears in the "Maintainer approved" saved search. I generally avoid setting maintainer-approval+ on patches on behalf of maintainers because it gets mistaken and I get credited in the commit logs. :)
Comment on attachment 171140 [details] Attemp to fix issues with older GCC version and C++11 enablement Ok!
Tested on 9.3 and 10.3 both i386 and amd64 with poudriere testport OK
Created attachment 172120 [details] Patch with 1.7.3 included I integrated 1.7.3 into the previous patch.
A commit references this bug: Author: brnrd Date: Tue Jul 5 06:44:21 UTC 2016 New revision: 418065 URL: https://svnweb.freebsd.org/changeset/ports/418065 Log: devel/jsoncpp: Update to 1.7.3 - Update to version 1.7.3 [2] - Fix compiler issues [1] PR: 209945 Submitted by: Mathieu Simon <freebsd@simweb.ch> [1] Reviewed by: yuri@rawbw.com (maintainer) [2] Changes: head/devel/jsoncpp/Makefile head/devel/jsoncpp/distinfo head/devel/jsoncpp/files/patch-include_json_config.h head/devel/jsoncpp/pkg-plist
Assigning to committer who committed.
A commit references this bug: Author: brnrd Date: Sun Sep 11 08:59:05 UTC 2016 New revision: 421808 URL: https://svnweb.freebsd.org/changeset/ports/421808 Log: MFH: r417988 r418065 devel/jsoncpp: Fix build on 10.3 - Change OS version checks to compiler checks PR: 209954 Submitted by: Mathieu Simon <freebsd@simweb.ch> devel/jsoncpp: Update to 1.7.3 - Update to version 1.7.3 [2] - Fix compiler issues [1] PR: 209945 Submitted by: Mathieu Simon <freebsd@simweb.ch> [1] Reviewed by: yuri@rawbw.com (maintainer) [2] Approved by: ports-secteam (junovitch) Changes: _U branches/2016Q3/ branches/2016Q3/devel/jsoncpp/Makefile branches/2016Q3/devel/jsoncpp/distinfo branches/2016Q3/devel/jsoncpp/files/patch-include_json_config.h branches/2016Q3/devel/jsoncpp/pkg-plist