GDC 4.7 build problems on Ubuntu 12.10

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Oct 26 20:47:08 PDT 2012


On Fri, Oct 26, 2012 at 11:13:01PM +0200, Joseph Rushton Wakeling wrote:
> Carrying over from a discussion on d-learn, here's where I'm at with
> the attempts to build GDC.
> 
> I've got the latest gdc-4.7 from GitHub, I've pulled in the gcc
> 4.7.2 sources using apt-get and tweaked and applied the debian
> patches, run update-gcc.sh, and then ran configure with the
> following options:
> 
> ../gcc-4.7-4.7.2/src/configure --enable-languages=d
> --disable-multilib --disable-libgomp --disable-libmudflap
> --disable-libquadmath --disable-libquadmath-support --disable-lto
> 
> ... and then called make -j6
> 
> This build runs for quite a long way before falling over with the
> following, I believe at the point where it's building gdc itself:
> 
> -----------------------------------------------------------------------------
> d/d-gcc.o: In function `used_arg':
> gcc.c:(.text+0xdf4): undefined reference to `fatal_error'
> d/d-gcc.o: In function `compare_version_strings':
> gcc.c:(.text+0xf4a): undefined reference to `fancy_abort'
> gcc.c:(.text+0xf5e): undefined reference to `fancy_abort'
> gcc.c:(.text+0xf6d): undefined reference to `fatal_error'
[...snipped...]
> If I run make again, without the -j option, the build seems to
> continue but falls over at a later point with the following error
> when building cc1d:
> 
> -----------------------------------------------------------------------------
> libcommon.a(diagnostic.o): In function `error(char const*, ...)':
> diagnostic.c:(.text+0x11b0): multiple definition of `error(char const*, ...)'
> d/root.dmd.o:root.c:(.text+0x380): first defined here
> d/d-codegen.glue.o: In function `IRState::localVar(tree_node*)':
> d-codegen.cc:(.text+0x99): undefined reference to `build_decl_stat'
> d/d-codegen.glue.o: In function `IRState::exprVar(tree_node*)':
> d-codegen.cc:(.text+0x121): undefined reference to `build_decl_stat'
> d/d-codegen.glue.o: In function `IRState::trueDeclarationType(Declaration*)':
> d-codegen.cc:(.text+0x38c): undefined reference to `build_reference_type'
> d/d-codegen.glue.o: In function
> `AggLayout::doFields(ArrayBase<VarDeclaration>*,
> AggregateDeclaration*)':
> d-codegen.cc:(.text+0x46e): undefined reference to `get_identifier'
> d-codegen.cc:(.text+0x48b): undefined reference to `build_decl_stat'
> d-codegen.cc:(.text+0x4d7): undefined reference to `size_int_kind'
> d-codegen.cc:(.text+0x521): undefined reference to `layout_decl'
> d-codegen.cc:(.text+0x59c): undefined reference to `fancy_abort'
> d-codegen.cc:(.text+0x5b0): undefined reference to `fancy_abort'
[...]

Can you include the compile/link command line right before these errors?
That might help trace the problem. Right now it's just clear that the ld
isn't being called with the right files (either that, or something that
needed to be compiled earlier isn't). Just give the make -j1 (or without
-j) version, as with make -j6 runs too many things at once and it may
not be clear which compile/link line actually corresponds with the
errors.


> Faced with an error message of this length I think the only thing I
> can do is shout, "HELLLLP!!"  Can anyone advise on what the problem
> might be?
[...]

One thing that *may* be helpful in tracing a problem is to redirect all
output from make into a logfile, something like this:

	make -j6 2>&1 > /tmp/gdc-build.log &

then you can monitor the progress of the build with:

	tail -f /tmp/gdc-build.log

Then when it dies horribly, you can search the logfile for specific
stuff. For example, the first line of the linker error above seems to
indicate that there may be something wrong with libcommon.a, so you can
search for that earlier up in the logfile to find out what exactly it
did. If you're lucky, you may find something that looks obviously wrong,
which might be a clue as to what's going on. Or you can try tracing the
error backwards from that point to see if it eventually leads somewhere
that tells you what's going on.


T

-- 
English has the lovely word "defenestrate", meaning "to execute by
throwing someone out a window", or more recently "to remove Windows from
a computer and replace it with something useful". :-) -- John Cowan


More information about the D.gnu mailing list