summaryrefslogtreecommitdiffstats
path: root/main/gcc/ada-musl.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-09-06 11:24:41 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-09-10 09:12:29 +0000
commitea0af854b52e5d2b44e6af094572e6ae38d1ba5a (patch)
tree9980f07181336553da3ae7452b7a69a41750f5fe /main/gcc/ada-musl.patch
parent6a32c55e54342aadd5b4d4319ab084d34913e16b (diff)
downloadaports-ea0af854b52e5d2b44e6af094572e6ae38d1ba5a.tar.bz2
aports-ea0af854b52e5d2b44e6af094572e6ae38d1ba5a.tar.xz
main/gcc: fixes, support crosscompiler creation
- implement cross compiler creation - fix musl build - fix cross-building - fix ada to default to shared linking - fix gcc-gnat dependencies
Diffstat (limited to 'main/gcc/ada-musl.patch')
-rw-r--r--main/gcc/ada-musl.patch118
1 files changed, 118 insertions, 0 deletions
diff --git a/main/gcc/ada-musl.patch b/main/gcc/ada-musl.patch
new file mode 100644
index 000000000..8255e3b36
--- /dev/null
+++ b/main/gcc/ada-musl.patch
@@ -0,0 +1,118 @@
+--- gcc-4.8.1/gcc/ada/adaint.c.orig
++++ gcc-4.8.1/gcc/ada/adaint.c
+@@ -67,6 +67,11 @@
+ #include <sys/pstat.h>
+ #endif
+
++#if defined (linux)
++#define _GNU_SOURCE 1
++#include <sched.h>
++#endif
++
+ #ifdef VMS
+ #define _POSIX_EXIT 1
+ #define HOST_EXECUTABLE_SUFFIX ".exe"
+@@ -3782,8 +3787,6 @@
+ return (void *) syscall (__NR_gettid);
+ }
+
+-#include <sched.h>
+-
+ /* glibc versions earlier than 2.7 do not define the routines to handle
+ dynamically allocated CPU sets. For these targets, we use the static
+ versions. */
+@@ -3792,7 +3795,7 @@
+
+ /* Dynamic cpu sets */
+
+-cpu_set_t *__gnat_cpu_alloc (size_t count)
++void *__gnat_cpu_alloc (size_t count)
+ {
+ return CPU_ALLOC (count);
+ }
+@@ -3802,30 +3805,30 @@
+ return CPU_ALLOC_SIZE (count);
+ }
+
+-void __gnat_cpu_free (cpu_set_t *set)
++void __gnat_cpu_free (void *set)
+ {
+- CPU_FREE (set);
++ CPU_FREE ((cpu_set_t *) set);
+ }
+
+-void __gnat_cpu_zero (size_t count, cpu_set_t *set)
++void __gnat_cpu_zero (size_t count, void *set)
+ {
+- CPU_ZERO_S (count, set);
++ CPU_ZERO_S (count, (cpu_set_t *) set);
+ }
+
+-void __gnat_cpu_set (int cpu, size_t count, cpu_set_t *set)
++void __gnat_cpu_set (int cpu, size_t count, void *set)
+ {
+ /* Ada handles CPU numbers starting from 1, while C identifies the first
+ CPU by a 0, so we need to adjust. */
+- CPU_SET_S (cpu - 1, count, set);
++ CPU_SET_S (cpu - 1, count, (cpu_set_t *) set);
+ }
+
+ #else
+
+ /* Static cpu sets */
+
+-cpu_set_t *__gnat_cpu_alloc (size_t count ATTRIBUTE_UNUSED)
++void *__gnat_cpu_alloc (size_t count ATTRIBUTE_UNUSED)
+ {
+- return (cpu_set_t *) xmalloc (sizeof (cpu_set_t));
++ return xmalloc (sizeof (cpu_set_t));
+ }
+
+ size_t __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
+@@ -3833,21 +3836,21 @@
+ return sizeof (cpu_set_t);
+ }
+
+-void __gnat_cpu_free (cpu_set_t *set)
++void __gnat_cpu_free (void *set)
+ {
+ free (set);
+ }
+
+-void __gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
++void __gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, void *set)
+ {
+- CPU_ZERO (set);
++ CPU_ZERO ((cpu_set_t *) set);
+ }
+
+-void __gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
++void __gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, void *set)
+ {
+ /* Ada handles CPU numbers starting from 1, while C identifies the first
+ CPU by a 0, so we need to adjust. */
+- CPU_SET (cpu - 1, set);
++ CPU_SET (cpu - 1, (cpu_set_t *) set);
+ }
+ #endif
+ #endif
+--- gcc-4.8.1/gcc/ada/adaint.h.orig
++++ gcc-4.8.1/gcc/ada/adaint.h
+@@ -259,13 +259,11 @@
+
+ /* Routines for interface to required CPU set primitives */
+
+-#include <sched.h>
+-
+-extern cpu_set_t *__gnat_cpu_alloc (size_t);
++extern void * __gnat_cpu_alloc (size_t);
+ extern size_t __gnat_cpu_alloc_size (size_t);
+-extern void __gnat_cpu_free (cpu_set_t *);
+-extern void __gnat_cpu_zero (size_t, cpu_set_t *);
+-extern void __gnat_cpu_set (int, size_t, cpu_set_t *);
++extern void __gnat_cpu_free (void *);
++extern void __gnat_cpu_zero (size_t, void *);
++extern void __gnat_cpu_set (int, size_t, void *);
+ #endif
+
+ #if defined (_WIN32)