Bug 213995 - astro/marble: fix for lang/gcc5
Summary: astro/marble: fix for lang/gcc5
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-kde (Team)
Depends on:
Reported: 2016-11-01 20:14 UTC by Kenneth Salerno
Modified: 2016-11-08 19:56 UTC (History)
2 users (show)

See Also:

Fix for lang/gcc5 (617 bytes, patch)
2016-11-01 20:14 UTC, Kenneth Salerno
no flags Details | Diff
Fix for lang/gcc5 (594 bytes, patch)
2016-11-02 11:46 UTC, Kenneth Salerno
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 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 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 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.


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 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

  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

Comment 8 Tobias C. Berner freebsd_committer 2016-11-08 19:56:14 UTC
Committed. Thanks.