GDC can't link LuaD if separate compilation used (bug?)

ketmar via D.gnu d.gnu at puremagic.com
Sat Apr 26 21:30:03 PDT 2014


if i take LuaD[1] and then try to compile it as a set of separate 
.o files, gdc refuses to link any LuaD sample with message:
hello.o:(.data._D30TypeInfo_S4luad4base9LuaObject6__initZ[_D30TypeInfo_S4luad4base9LuaObject6__initZ]+0x1c): 
undefined reference to 
`_D4luad4base9LuaObject11__xopEqualsFKxS4luad4base9LuaObjectKxS4luad4base9LuaObjectZb'

but if i'll do whole thing at once (i.e. passing all .d files in 
command line w/o separate linking phase), everything working ok.

here is two scripts that should be put in root LuaD directory to 
reproduce the issue:

linking failed: http://pastebin.com/Vh27BFBP
everything ok: http://pastebin.com/Gzn7B1Du

i'm using gdc 3209d01d42b6e… and gcc 4.9 on GNU/Linux, x86. here 
is gcc -v output:

Configured with: ../gcc-4.9.0/configure --prefix=/usr 
--libdir=/usr/lib --mandir=/usr/man --infodir=/usr/info 
--disable-nls --enable-shared --enable-bootstrap 
--enable-languages=c,c++,lto,objc,d --enable-threads=posix 
--enable-checking=release --enable-objc-gc --with-system-zlib 
--without-python --disable-libunwind-exceptions 
--enable-__cxa_atexit --enable-libssp --with-gnu-ld 
--with-arch-directory=i386 --disable-gtktest --with-arch=i486 
--target=i486-slackware-linux --build=i486-slackware-linux 
--host=i486-slackware-linux

1. https://github.com/JakobOvrum/LuaD


More information about the D.gnu mailing list