Compiling relocatable mingw gdc
Bill Baxter
dnewsgroup at billbaxter.com
Wed Mar 5 19:50:25 PST 2008
This is mostly meant for Anders... a continuation of an off-NG mail
exchange about trying to build mingw gdc from source.
So here's where I currently am
The Makefile is generating compile lines like this:
stage1/xgcc.exe -Bstage1/ -B/gdc/mingw32/bin/ -c \
-g0 -O2 -DIN_GCC \
-W -Wall -Wwrite-strings -Wstrict-prototypes \
-Wmissing-prototypes -pedantic \
-Wno-long-long -Wold-style-definition \
-DHAVE_CONFIG_H -DGENERATOR_FILE
-I. -I. \
-I../../gcc-3.4.5-20060117-1/gcc \
-I../../gcc-3.4.5-20060117-1/gcc/. \
-I../../gcc-3.4.5-20060117-1/gcc/../include \
../../gcc-3.4.5-20060117-1/gcc/genmodes.c -o genmodes.o
none of those -I's point to place where there are actually any system
headers, and genmodes there tries to #include something which #includes
<stdio.h> among other things. The xgcc (boostrap compiler?) seems not
to have any intrinsic knowlege of where system headers are.
I was reading the MinGW install instructions from the MinGW site, and
they said "runtime and win32 headers are separate". So I thought maybe
I could fix things by downloading the mingw runtime and copying its
include,lib,and bin dirs into the toplevel gcc-3.4.5-20060117-1 dir.
That sort of worked but then there's a conflict over "mem.h" which is in
the MinGW runtime include dir and also in the dmd front end. It was
finding the runtime version when trying to compile gdc. So I renamed
the runtime version to _mem.h. And that let me get past that.
Now I'm stuck on an ld error. It can't find crt2.o --
-----------------
stage1/xgcc.exe -Bstage1/ -B/gdc/mingw32/bin/ \
-g0 -O2 -DIN_GCC \
-W -Wall -Wwrite-strings \
-Wstrict-prototypes -Wmissing-prototypes \
-pedantic -Wno-long-long -Wold-style-definition \
-DHAVE_CONFIG_H -DGENERATOR_FILE -o genmodes.exe \
genmodes.o errors.o ../libiberty/libiberty.a
c:\MinGW\bin\ld.exe: crt2.o: No such file: No such file or directory
-------------
I've got crt2.o in both:
C:\mingw\lib
and
../gcc-3.4.5-20060117-1/lib/crt2.o
Apparently something about my environment doesn't match what the mingw
make files are expecting. In particular these -B/gdc/mingw32/bin paths
look odd. /gdc is a bogus directory to begin with (I'm using the fstab
hack you pointed me to), and I don't have a dir like mingw32/bin
anywhere even in my c:\mingw install. That string "mingw32" as part of
a path is included in the Makefile. I'm not sure where it comes from.
Maybe coming from --target=mingw32 flag passed to configure?
Any ideas appreciated.
--bb
More information about the D.gnu
mailing list