ports/187395: lang/x10 : fix build with newer (>4.6) gcc
Christoph Moench-Tegeder
cmt at burggraben.net
Sun Mar 9 15:50:01 UTC 2014
>Number: 187395
>Category: ports
>Synopsis: lang/x10 : fix build with newer (>4.6) gcc
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sun Mar 09 15:50:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator: Christoph Moench-Tegeder
>Release: FreeBSD 10.0-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD elch.exwg.net 10.0-RELEASE FreeBSD 10.0-RELEASE #2 r260689: Wed Jan 15 18:32:44 CET 2014 cmt at elch.exwg.net:/usr/obj/usr/src/sys/ELCH amd64
lang/x10 x10-2.2.1
>Description:
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?
>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.
>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:
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);
+- }
+ }
+
+
Regards,
Christoph
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list