changeset 679:dc078dd8d2e1

Fix remaining make files. Fix linking order for static libs.
author Christian Kamm <kamm incasoftware de>
date Sat, 11 Oct 2008 21:40:44 +0200
parents 299f53f2e6f2
children 703d9b4505f9
files dmd/mars.c runtime/lib/common/tango/ldc.mak runtime/lib/gc/basic/ldc.mak
diffstat 3 files changed, 51 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/dmd/mars.c	Sat Oct 11 21:23:41 2008 +0200
+++ b/dmd/mars.c	Sat Oct 11 21:40:44 2008 +0200
@@ -738,6 +738,11 @@
 	arg = (char *)mem.malloc(64);
 	strcpy(arg, "-ltango-gc-basic");
 	global.params.linkswitches->push(arg);
+	// pass the runtime again to resolve issues
+	// with linking order
+	arg = (char *)mem.malloc(64);
+	strcpy(arg, "-lldc-runtime");
+	global.params.linkswitches->push(arg);
     }
 
     if (global.params.run)
--- a/runtime/lib/common/tango/ldc.mak	Sat Oct 11 21:23:41 2008 +0200
+++ b/runtime/lib/common/tango/ldc.mak	Sat Oct 11 21:40:44 2008 +0200
@@ -60,9 +60,11 @@
 .cpp.o:
 	g++ -c $(CFLAGS) $< -o$@
 
+.d.o:
+	$(DC) -c $(DFLAGS) -Hf$*.di $< -of$@
+
 .d.bc:
-	$(DC) -c $(DFLAGS) -Hf$*.di $< -of$@
-#	$(DC) -c $(DFLAGS) $< -of$@
+	$(DC) -c $(DFLAGS) -Hf$*.di $< -of$@ -output-bc
 
 .ll.bc:
 	$(LLC) -f -o=$@ $<
@@ -80,7 +82,7 @@
 
 ######################################################
 
-OBJ_CORE= \
+OBJ_CORE_BC= \
     core/BitManip.bc \
     core/Exception.bc \
     core/Memory.bc \
@@ -88,6 +90,13 @@
     core/Thread.bc
 #    core/ThreadASM.o
 
+OBJ_CORE_O= \
+    core/BitManip.o \
+    core/Exception.o \
+    core/Memory.o \
+    core/Runtime.o \
+    core/Thread.o
+
 OBJ_STDC= \
     stdc/wrap.o
 #    stdc/wrap.bc
@@ -95,11 +104,16 @@
 OBJ_STDC_POSIX= \
     stdc/posix/pthread_darwin.o
 
-ALL_OBJS= \
-    $(OBJ_CORE)
+ALL_OBJS_BC= \
+    $(OBJ_CORE_BC)
 #    $(OBJ_STDC)
 #    $(OBJ_STDC_POSIX)
 
+ALL_OBJS_O= \
+    $(OBJ_CORE_O) \
+    $(OBJ_STDC) \
+    $(OBJ_STDC_POSIX)
+
 ######################################################
 
 DOC_CORE= \
@@ -119,17 +133,14 @@
 tango.clib : $(LIB_TARGET_C_ONLY)
 tango.sharedlib : $(LIB_TARGET_SHARED)
 
-$(LIB_TARGET_BC_ONLY) : $(ALL_OBJS)
+$(LIB_TARGET_BC_ONLY) : $(ALL_OBJS_BC)
 	$(RM) $@
-	$(LC) $@ $(ALL_OBJS)
+	$(LC) $@ $(ALL_OBJS_BC)
 
 
-$(LIB_TARGET_FULL) : $(ALL_OBJS) $(OBJ_STDC)
-	$(RM) $@ $@.bc $@.s $@.o
-	$(LLINK) -o=$@.bc $(ALL_OBJS)
-	$(LCC) -o=$@.s $@.bc
-	$(CC) -c -o $@.o $@.s
-	$(CLC) $@ $@.o $(OBJ_STDC)
+$(LIB_TARGET_FULL) : $(ALL_OBJS_O)
+	$(RM) $@
+	$(CLC) $@ $(ALL_OBJS_O)
 
 
 $(LIB_TARGET_C_ONLY) : $(OBJ_STDC)
@@ -137,12 +148,9 @@
 	$(CLC) $@ $(OBJ_STDC)
 
 
-$(LIB_TARGET_SHARED) : $(ALL_OBJS) $(OBJ_STDC)
-	$(RM) $@ $@.bc $@.s $@.o
-	$(LLINK) -o=$@.bc $(ALL_OBJS)
-	$(LCC) -relocation-model=pic -o=$@.s $@.bc
-	$(CC) -c -o $@.o $@.s
-	$(CC) -shared -o $@ $@.o $(OBJ_STDC)
+$(LIB_TARGET_SHARED) : $(ALL_OBJS_O)
+	$(RM) $@
+	$(CC) -shared -o $@ $(ALL_OBJS_O)
 
 
 tango.doc : $(ALL_DOCS)
--- a/runtime/lib/gc/basic/ldc.mak	Sat Oct 11 21:23:41 2008 +0200
+++ b/runtime/lib/gc/basic/ldc.mak	Sat Oct 11 21:40:44 2008 +0200
@@ -58,6 +58,9 @@
 	g++ -c $(CFLAGS) $< -o$@
 
 .d.bc:
+	$(DC) -c $(DFLAGS) $< -of$@ -output-bc
+
+.d.o:
 	$(DC) -c $(DFLAGS) $< -of$@
 
 .d.html:
@@ -72,13 +75,20 @@
 
 ######################################################
 
-ALL_OBJS= \
+ALL_OBJS_BC= \
     gc.bc \
     gcalloc.bc \
     gcbits.bc \
     gcstats.bc \
     gcx.bc
 
+ALL_OBJS_O= \
+    gc.o \
+    gcalloc.o \
+    gcbits.o \
+    gcstats.o \
+    gcx.o
+
 ######################################################
 
 ALL_DOCS=
@@ -89,24 +99,19 @@
 basic.nlib : $(LIB_TARGET_NATIVE)
 basic.sharedlib : $(LIB_TARGET_SHARED)
 
-$(LIB_TARGET_BC) : $(ALL_OBJS)
+$(LIB_TARGET_BC) : $(ALL_OBJS_BC)
 	$(RM) $@
-	$(LC) $@ $(ALL_OBJS)
+	$(LC) $@ $(ALL_OBJS_BC)
 
 
-$(LIB_TARGET_NATIVE) : $(ALL_OBJS)
-	$(RM) $@ $@.bc $@.s $@.o
-	$(LLINK) -o=$@.bc $(ALL_OBJS)
-	$(LCC) -o=$@.s $@.bc
-	$(CC) -c -o $@.o $@.s
-	$(CLC) $@ $@.o
+$(LIB_TARGET_NATIVE) : $(ALL_OBJS_O)
+	$(RM) $@
+	$(CLC) $@ $(ALL_OBJS_O)
 
 
-$(LIB_TARGET_SHARED) : $(ALL_OBJS)
-	$(RM) $@ $@.bc $@.s $@.o
-	$(LLINK) -o=$@.bc $(ALL_OBJS)
-	$(LCC) -relocation-model=pic -o=$@.s $@.bc
-	$(CC) -shared -o $@ $@.s
+$(LIB_TARGET_SHARED) : $(ALL_OBJS_O)
+	$(RM) $@
+	$(CC) -shared -o $@ $(ALL_OBJS_O)
 
 basic.doc : $(ALL_DOCS)
 	echo No documentation available.