Bug 213995

Summary: astro/marble: fix for lang/gcc5
Product: Ports & Packages Reporter: Kenneth Salerno <kennethsalerno>
Component: Individual Port(s)Assignee: freebsd-kde (group) <kde>
Status: Closed FIXED    
Severity: Affects Only Me CC: ports-bugs, tcberner
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Fix for lang/gcc5
none
Fix for lang/gcc5 none

Description Kenneth Salerno 2016-11-01 20:14:12 UTC
Created attachment 176394 [details]
Fix for lang/gcc5
Comment 1 Tobias C. Berner freebsd_committer freebsd_triage 2016-11-01 21:28:43 UTC
Is this only an issue with gcc 5.4.*?

mfg Tobias
Comment 2 Tobias C. Berner freebsd_committer freebsd_triage 2016-11-01 21:34:26 UTC
... to quick on the send button.

What exactly is the issue?
Comment 3 Tobias C. Berner freebsd_committer freebsd_triage 2016-11-01 21:37:58 UTC
Leaning out of the window, and guessing it chokes on std:isnan, could you try replacing the 
#incude <math.h>
with an 
#include <cmath>

instead of the gcc version comparison stuff?
Comment 4 Kenneth Salerno 2016-11-02 01:28:34 UTC
(In reply to Tobias C. Berner from comment #3)
Good idea, I will try that.
Comment 5 Kenneth Salerno 2016-11-02 11:46:47 UTC
Created attachment 176424 [details]
Fix for lang/gcc5

Removed test for __GNUC_MINOR__
Comment 6 Kenneth Salerno 2016-11-02 12:05:09 UTC
(In reply to Tobias C. Berner from comment #3)
including <cmath> has the same result - isnan is declared in scope of the namespace std for lang/gcc5.

/usr/local/lib/gcc5/include/c++/cmath:

namespace std _GLIBCXX_VISIBILITY(default)
{
   constexpr bool
   isnan(float __x)
   { return __builtin_isnan(__x); }


whereas clang++ has "using ::isnan" in /usr/include/c++/v1/cmath, making it accessible as both std::isnan and just isnan:

namespace std
{
   bool isnan(arithmetic x);
   using ::isnan;
Comment 7 commit-hook freebsd_committer freebsd_triage 2016-11-08 19:54:38 UTC
A commit references this bug:

Author: tcberner
Date: Tue Nov  8 19:53:45 UTC 2016
New revision: 425759
URL: https://svnweb.freebsd.org/changeset/ports/425759

Log:
  Fix build with newer gcc versions.

  Add upstream patch [1] that uses
  	* math.h  -> cmath
  	* isnan() -> std::isnan()

  This fixes compilation with gcc5.

  [1] https://quickgit.kde.org/?p=marble.git&a=commit&h=486f6181d6fef15c9b6c72504e3588be502bea80

  PR:		213995
  Reported by:	Kenneth Salerno <kennethsalerno@yahoo.com>
  Approved by:	rakuco (mentor)
  Obtained from:	https://quickgit.kde.org/?p=marble.git&a=commit&h=486f6181d6fef15c9b6c72504e3588be502bea80

Changes:
  head/astro/marble/files/
  head/astro/marble/files/patch-git_486f618
Comment 8 Tobias C. Berner freebsd_committer freebsd_triage 2016-11-08 19:56:14 UTC
Committed. Thanks.