Bug 187395 - lang/x10 : fix build with newer (>4.6) gcc
Summary: lang/x10 : fix build with newer (>4.6) gcc
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Gerald Pfeifer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-09 15:50 UTC by Christoph Moench-Tegeder
Modified: 2014-03-09 23:45 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Moench-Tegeder freebsd_committer 2014-03-09 15:50:00 UTC
	Hi,
	this PR is part of the project for updating lang/gcc to gcc 4.7; I'm
	helping gerald@ with fixing ports which do not build under the newer
	gcc. When comitting this (or having this being committed), may you please
	reference ports/182136 in addition to this PR in the commit?

Fix: In case some mail system mangels the patch, I put it on WWW:
	http://burggraben.net/hacks/x10.patch.gz
	I've build-tested this patch with lang/gcc47 and lang/gcc48.

svn status:
A       files/patch-x10.runtime-src-cpp-x10-utils-concurrent-AtomicReference.h
A       files/patch-x10.runtime-src-cpp-x10aux-basic_functions.h
A       files/patch-x10.runtime-src-cpp-x10aux-string_utils.h

svn diff:


Regards,
Christoph--v1b1QoE6EikTT2q4zAMO5GwAp0Xr3XmeYPSHIHmwuXLK0THI
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

Index: files/patch-x10.runtime-src-cpp-x10-utils-concurrent-AtomicReference.h
===================================================================
--- files/patch-x10.runtime-src-cpp-x10-utils-concurrent-AtomicReference.h	(revision 0)
+++ files/patch-x10.runtime-src-cpp-x10-utils-concurrent-AtomicReference.h	(working copy)
@@ -0,0 +1,10 @@
+--- ../x10.runtime/src-cpp/x10/util/concurrent/AtomicReference.h.orig	2014-03-09 15:50:47.000000000 +0100
++++ ../x10.runtime/src-cpp/x10/util/concurrent/AtomicReference.h	2014-03-09 15:51:15.000000000 +0100
+@@ -15,6 +15,7 @@
+ #include <x10aux/config.h>
+ #include <x10aux/ref.h>
+ #include <x10aux/RTT.h>
++#include <x10aux/basic_functions.h>
+ #include <x10aux/string_utils.h>
+ #include <x10aux/atomic_ops.h>
+ 
Index: files/patch-x10.runtime-src-cpp-x10aux-basic_functions.h
===================================================================
--- files/patch-x10.runtime-src-cpp-x10aux-basic_functions.h	(revision 0)
+++ files/patch-x10.runtime-src-cpp-x10aux-basic_functions.h	(working copy)
@@ -0,0 +1,54 @@
+--- ../x10.runtime/src-cpp/x10aux/basic_functions.h.orig	2014-03-09 14:42:17.000000000 +0100
++++ ../x10.runtime/src-cpp/x10aux/basic_functions.h	2014-03-09 15:44:47.000000000 +0100
+@@ -31,6 +31,27 @@
+ 
+ namespace x10aux {
+ 
++    /* prototypes */
++    inline x10_boolean struct_equals(const x10_double x,  const x10_double y); 
++    inline x10_boolean struct_equals(const x10_float x,   const x10_float y);
++    inline x10_boolean struct_equals(const x10_long x,    const x10_long y);
++    inline x10_boolean struct_equals(const x10_int x,     const x10_int y);
++    inline x10_boolean struct_equals(const x10_short x,   const x10_short y);
++    inline x10_boolean struct_equals(const x10_byte x,    const x10_byte y);
++    inline x10_boolean struct_equals(const x10_ulong x,   const x10_ulong y);
++    inline x10_boolean struct_equals(const x10_uint x,    const x10_uint y);
++    inline x10_boolean struct_equals(const x10_ushort x,  const x10_ushort y);
++    inline x10_boolean struct_equals(const x10_ubyte x,   const x10_ubyte y);
++    inline x10_boolean struct_equals(const x10_char x,    const x10_char y);
++    inline x10_boolean struct_equals(const x10_boolean x, const x10_boolean y);
++    template<class T, class U> inline x10_boolean struct_equals(T x, U y);
++    template<class T, class U> inline x10_boolean struct_equals(captured_ref_lval<T> x, U y);
++    template<class T, class U> inline x10_boolean struct_equals(T x, captured_ref_lval<U> y);
++    template<class T, class U> inline x10_boolean struct_equals(captured_ref_lval<T> x, captured_ref_lval<U> y);
++    template<class T, class U> inline x10_boolean struct_equals(captured_struct_lval<T> x, U y);
++    template<class T, class U> inline x10_boolean struct_equals(T x, captured_struct_lval<U> y);
++    template<class T, class U> inline x10_boolean struct_equals(captured_struct_lval<T> x, captured_struct_lval<U> y);
++
+     /******* type_name ********/
+ 
+     template<class T> inline ref<x10::lang::String> type_name(ref<T> x) {
+@@ -362,6 +383,23 @@
+ 
+     ref<x10::lang::String> to_string(x10_char v);
+ 
++    /*
++     * Wrapers around to_string to translate null to "null"
++     */
++    template<class T> ref<x10::lang::String> safe_to_string(ref<T> v) {
++        if (v.isNull()) return string_utils::lit("null");
++        return to_string(v);
++    }
++    template<class T> ref<x10::lang::String> safe_to_string(captured_ref_lval<T> v) {
++        return safe_to_string(*v);
++    }
++    template<class T> ref<x10::lang::String> safe_to_string(captured_struct_lval<T> v) {
++        return to_string(*v);
++    }
++    template<class T> ref<x10::lang::String> safe_to_string(T v) {
++        return to_string(v);
++    }
++
+ 
+     /******* zeroValue ********/
+     template<class T> struct Zero {
Index: files/patch-x10.runtime-src-cpp-x10aux-string_utils.h
===================================================================
--- files/patch-x10.runtime-src-cpp-x10aux-string_utils.h	(revision 0)
+++ files/patch-x10.runtime-src-cpp-x10aux-string_utils.h	(working copy)
@@ -0,0 +1,26 @@
+--- ../x10.runtime/src-cpp/x10aux/string_utils.h.orig	2014-03-09 14:42:24.000000000 +0100
++++ ../x10.runtime/src-cpp/x10aux/string_utils.h	2014-03-09 14:45:00.000000000 +0100
+@@ -38,23 +38,6 @@
+         char *strdup(const char*);
+         char *strndup(const char*, x10_int len);
+     }
+-
+-    /*
+-     * Wrapers around to_string to translate null to "null"
+-     */
+-    template<class T> ref<x10::lang::String> safe_to_string(ref<T> v) {
+-        if (v.isNull()) return string_utils::lit("null");
+-        return to_string(v);
+-    }
+-    template<class T> ref<x10::lang::String> safe_to_string(captured_ref_lval<T> v) {
+-        return safe_to_string(*v);
+-    }
+-    template<class T> ref<x10::lang::String> safe_to_string(captured_struct_lval<T> v) {
+-        return to_string(*v);
+-    }
+-    template<class T> ref<x10::lang::String> safe_to_string(T v) {
+-        return to_string(v);
+-    }
+ }
+ 
+     
How-To-Repeat: 	When building lang/x10 with gcc >= 4.7, the build fails on some
	functions being used before their declaration. A few simple patches
	do fix that.
Comment 1 Edwin Groothuis freebsd_committer 2014-03-09 15:50:07 UTC
Maintainer of lang/x10,

Please note that PR ports/187395 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/187395

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer 2014-03-09 15:50:08 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Jason W. Bacon freebsd_committer 2014-03-09 16:08:10 UTC
Approved.

On 3/9/14 10:50 AM, Edwin Groothuis wrote:
> Maintainer of lang/x10,
>
> Please note that PR ports/187395 has just been submitted.
>
> If it contains a patch for an upgrade, an enhancement or a bug fix
> you agree on, reply to this email stating that you approve the patch
> and a committer will take care of it.
>
> The full text of the PR can be found at:
>      http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/187395
>


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Jason W. Bacon
   jwbacon@tds.net

   Circumstances don't make a man:
   They reveal him.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comment 4 Gerald Pfeifer freebsd_committer 2014-03-09 16:17:09 UTC
State Changed
From-To: feedback->open

Thanks for the patch Christoph, and the quick review, Jason! 

I'll test and commit this. 


Comment 5 Gerald Pfeifer freebsd_committer 2014-03-09 16:17:09 UTC
Responsible Changed
From-To: freebsd-ports-bugs->gerald
Comment 6 dfilter service freebsd_committer 2014-03-09 23:34:55 UTC
Author: gerald
Date: Sun Mar  9 23:34:47 2014
New Revision: 347709
URL: http://svnweb.freebsd.org/changeset/ports/347709
QAT: https://qat.redports.org/buildarchive/r347709/

Log:
  Fix the build with newer compilers (such as GCC 4.7).
  
  PR:		187395, 182136
  Submitted by:	Christoph Moench-Tegeder <cmt@burggraben.net>
  Approved by:	maintainer (Jason Bacon <jwbacon@tds.net>)

Added:
  head/lang/x10/files/patch-x10.runtime-src-cpp-x10-utils-concurrent-AtomicReference.h   (contents, props changed)
  head/lang/x10/files/patch-x10.runtime-src-cpp-x10aux-basic_functions.h   (contents, props changed)
  head/lang/x10/files/patch-x10.runtime-src-cpp-x10aux-string_utils.h   (contents, props changed)

Added: head/lang/x10/files/patch-x10.runtime-src-cpp-x10-utils-concurrent-AtomicReference.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/x10/files/patch-x10.runtime-src-cpp-x10-utils-concurrent-AtomicReference.h	Sun Mar  9 23:34:47 2014	(r347709)
@@ -0,0 +1,11 @@
+--- ../x10.runtime/src-cpp/x10/util/concurrent/AtomicReference.h.orig	2014-03-09 15:50:47.000000000 +0100
++++ ../x10.runtime/src-cpp/x10/util/concurrent/AtomicReference.h	2014-03-09 15:51:15.000000000 +0100
+@@ -15,6 +15,7 @@
+ #include <x10aux/config.h>
+ #include <x10aux/ref.h>
+ #include <x10aux/RTT.h>
++#include <x10aux/basic_functions.h>
+ #include <x10aux/string_utils.h>
+ #include <x10aux/atomic_ops.h>
+ 
+

Added: head/lang/x10/files/patch-x10.runtime-src-cpp-x10aux-basic_functions.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/x10/files/patch-x10.runtime-src-cpp-x10aux-basic_functions.h	Sun Mar  9 23:34:47 2014	(r347709)
@@ -0,0 +1,54 @@
+--- ../x10.runtime/src-cpp/x10aux/basic_functions.h.orig	2014-03-09 14:42:17.000000000 +0100
++++ ../x10.runtime/src-cpp/x10aux/basic_functions.h	2014-03-09 15:44:47.000000000 +0100
+@@ -31,6 +31,27 @@
+ 
+ namespace x10aux {
+ 
++    /* prototypes */
++    inline x10_boolean struct_equals(const x10_double x,  const x10_double y); 
++    inline x10_boolean struct_equals(const x10_float x,   const x10_float y);
++    inline x10_boolean struct_equals(const x10_long x,    const x10_long y);
++    inline x10_boolean struct_equals(const x10_int x,     const x10_int y);
++    inline x10_boolean struct_equals(const x10_short x,   const x10_short y);
++    inline x10_boolean struct_equals(const x10_byte x,    const x10_byte y);
++    inline x10_boolean struct_equals(const x10_ulong x,   const x10_ulong y);
++    inline x10_boolean struct_equals(const x10_uint x,    const x10_uint y);
++    inline x10_boolean struct_equals(const x10_ushort x,  const x10_ushort y);
++    inline x10_boolean struct_equals(const x10_ubyte x,   const x10_ubyte y);
++    inline x10_boolean struct_equals(const x10_char x,    const x10_char y);
++    inline x10_boolean struct_equals(const x10_boolean x, const x10_boolean y);
++    template<class T, class U> inline x10_boolean struct_equals(T x, U y);
++    template<class T, class U> inline x10_boolean struct_equals(captured_ref_lval<T> x, U y);
++    template<class T, class U> inline x10_boolean struct_equals(T x, captured_ref_lval<U> y);
++    template<class T, class U> inline x10_boolean struct_equals(captured_ref_lval<T> x, captured_ref_lval<U> y);
++    template<class T, class U> inline x10_boolean struct_equals(captured_struct_lval<T> x, U y);
++    template<class T, class U> inline x10_boolean struct_equals(T x, captured_struct_lval<U> y);
++    template<class T, class U> inline x10_boolean struct_equals(captured_struct_lval<T> x, captured_struct_lval<U> y);
++
+     /******* type_name ********/
+ 
+     template<class T> inline ref<x10::lang::String> type_name(ref<T> x) {
+@@ -362,6 +383,23 @@
+ 
+     ref<x10::lang::String> to_string(x10_char v);
+ 
++    /*
++     * Wrapers around to_string to translate null to "null"
++     */
++    template<class T> ref<x10::lang::String> safe_to_string(ref<T> v) {
++        if (v.isNull()) return string_utils::lit("null");
++        return to_string(v);
++    }
++    template<class T> ref<x10::lang::String> safe_to_string(captured_ref_lval<T> v) {
++        return safe_to_string(*v);
++    }
++    template<class T> ref<x10::lang::String> safe_to_string(captured_struct_lval<T> v) {
++        return to_string(*v);
++    }
++    template<class T> ref<x10::lang::String> safe_to_string(T v) {
++        return to_string(v);
++    }
++
+ 
+     /******* zeroValue ********/
+     template<class T> struct Zero {

Added: head/lang/x10/files/patch-x10.runtime-src-cpp-x10aux-string_utils.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/x10/files/patch-x10.runtime-src-cpp-x10aux-string_utils.h	Sun Mar  9 23:34:47 2014	(r347709)
@@ -0,0 +1,27 @@
+--- ../x10.runtime/src-cpp/x10aux/string_utils.h.orig	2014-03-09 14:42:24.000000000 +0100
++++ ../x10.runtime/src-cpp/x10aux/string_utils.h	2014-03-09 14:45:00.000000000 +0100
+@@ -38,23 +38,6 @@
+         char *strdup(const char*);
+         char *strndup(const char*, x10_int len);
+     }
+-
+-    /*
+-     * Wrapers around to_string to translate null to "null"
+-     */
+-    template<class T> ref<x10::lang::String> safe_to_string(ref<T> v) {
+-        if (v.isNull()) return string_utils::lit("null");
+-        return to_string(v);
+-    }
+-    template<class T> ref<x10::lang::String> safe_to_string(captured_ref_lval<T> v) {
+-        return safe_to_string(*v);
+-    }
+-    template<class T> ref<x10::lang::String> safe_to_string(captured_struct_lval<T> v) {
+-        return to_string(*v);
+-    }
+-    template<class T> ref<x10::lang::String> safe_to_string(T v) {
+-        return to_string(v);
+-    }
+ }
+ 
+     
+
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 7 Gerald Pfeifer freebsd_committer 2014-03-09 23:44:41 UTC
State Changed
From-To: open->closed

I committed this as submitted after a round of redports testing. 
Thank you!