summaryrefslogtreecommitdiff
path: root/debian/patches/gdc-driver-nophobos.diff
blob: a21f019192d2c2d21d74032617414d36639ed3e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# DP: Modify gdc driver to have no libphobos by default.

--- a/src/gcc/d/d-lang.cc	2011-07-24 15:48:55.796035654 +0100
+++ b/src/gcc/d/d-lang.cc	2011-07-24 18:19:45.108908785 +0100
@@ -184,7 +184,7 @@
 d_init_options_struct (struct gcc_options *opts)
 {
     // GCC options
-    opts->x_flag_exceptions = 1;
+    opts->x_flag_exceptions = 0;
 
     // Avoid range issues for complex multiply and divide.
     opts->x_flag_complex_method = 2;
--- a/src/gcc/d/dmain.d 1970-01-01 01:00:00.000000000 +0100
+++ b/src/gcc/d/dmain.d 2011-02-20 23:45:24.799761560 +0000
@@ -0,0 +1,22 @@
+extern (C) size_t strlen(const char* s);
+extern (C) void* malloc(size_t s);
+
+int main(char[][] args); // U _Dmain
+
+extern (C) int main(int argc, char** argv) {
+    char[][] args;
+    char[] *am;
+    int i;
+
+    am = cast(char[] *) malloc(argc * (char[]).sizeof);
+
+    for(i = 0; i < argc; i++) {
+       am[i] = argv[i][0 .. strlen(argv[i])];
+    }
+
+    args = am[0 .. argc];
+
+    return main(args);
+}
+
+
--- a/src/gcc/d/d-spec.c	2011-07-24 15:48:55.820035782 +0100
+++ b/src/gcc/d/d-spec.c	2011-07-24 18:20:43.841200023 +0100
@@ -114,7 +114,7 @@
 
     /* If nonzero, use the standard D runtime library when linking with
        standard libraries. */
-    int phobos = 1;
+    int phobos = 0;
 
     /* The number of arguments being added to what's in argv, other than
        libraries.  We use this to track the number of times we've inserted