I am trying to build dmd such that it will work on older versions of GNU/Linux as well as newer versions with a single binary. This requires some special attention for libc++ and lib_gcc, (or a link loaded wrapper script)

I have proceeded like this to start off:

--- linux.mak.orig      2009-11-08 23:07:22.000000000 +0000
+++ linux.mak   2009-11-08 23:30:29.000000000 +0000
@@ -2,6 +2,7 @@
 C=backend
 TK=tk
 ROOT=root
+STATIC_LIBCPP=--static-libgcc -lm -Wl,-Bstatic,-lstdc++,-Bdynamic

 CC=g++ -m32

@@ -86,7 +87,7 @@
 all: dmd

 dmd: id.o optabgen $(DMD_OBJS)
-       gcc -m32 -lstdc++ $(COV) $(DMD_OBJS) -o dmd
+       gcc -m32 $(COV) $(DMD_OBJS) -o dmd $(STATIC_LIBCPP)

 clean:
        rm -f $(DMD_OBJS) dmd optab.o id.o impcnvgen idgen id.c id.h \


Which works assuming you compile it on redhat 3 and then it is upward compatible (glibc wise). But objdump and the other tools also need similar treatment, but I can't seem to find their source.

Reply via email to