Bug 8605 – rdmd aborts during link

Status
RESOLVED
Resolution
INVALID
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2012-08-31T18:19:00Z
Last change time
2013-03-10T01:31:15Z
Assigned to
nobody
Creator
charleshixsn

Attachments

IDFilenameSummaryContent-TypeSize
1142test2.dthis is a pair of files that appear to compile with dmd, but not with rdmd, IF the folder they are in is named Parsertext/x-dsrc14901

Comments

Comment #0 by charleshixsn — 2012-08-31T18:19:24Z
Created attachment 1142 this is a pair of files that appear to compile with dmd, but not with rdmd, IF the folder they are in is named Parser This appears to only happen if the folder is named "Parser". When I copied the folder elsewhere the error disappeared. It also doesn't seem to happen for short cases. So the only example case I can offer is around 500 lines long. And dmd doesn't complain about the problem. (OTOH, rdmd caught several actual bugs that dmd didn't.) Please note that this is a pair of files. If the utils file is included in the avl file, the error disappears. The error message is: charles@mandala1:~/projects/D/Parser$ rdmd -unittest avl.d utils.d /tmp/.rdmd-1000/rdmd-avl.d-EFC2A8F3F9817BAA59A3A00532D5696F/objs/avl.o: In function `_D3avl3AVL6insertMFKC3avl3AVL4NodeKC3avl3AVL4NodeKbZC3avl3AVL4Node': avl.d:(.text._D3avl3AVL6insertMFKC3avl3AVL4NodeKC3avl3AVL4NodeKbZC3avl3AVL4Node+0x10d): undefined reference to `_D5utils10LogicError7__ClassZ' avl.d:(.text._D3avl3AVL6insertMFKC3avl3AVL4NodeKC3avl3AVL4NodeKbZC3avl3AVL4Node+0x144): undefined reference to `_D5utils10LogicError6__ctorMFAyamC6object9ThrowableZC5utils10LogicError' avl.d:(.text._D3avl3AVL6insertMFKC3avl3AVL4NodeKC3avl3AVL4NodeKbZC3avl3AVL4Node+0x273): undefined reference to `_D5utils10LogicError7__ClassZ' avl.d:(.text._D3avl3AVL6insertMFKC3avl3AVL4NodeKC3avl3AVL4NodeKbZC3avl3AVL4Node+0x2aa): undefined reference to `_D5utils10LogicError6__ctorMFAyamC6object9ThrowableZC5utils10LogicError' /tmp/.rdmd-1000/rdmd-avl.d-EFC2A8F3F9817BAA59A3A00532D5696F/objs/avl.o: In function `_D3avl3AVL10delLeftBalMFKC3avl3AVL4NodeKbZC3avl3AVL4Node': avl.d:(.text._D3avl3AVL10delLeftBalMFKC3avl3AVL4NodeKbZC3avl3AVL4Node+0x13e): undefined reference to `_D5utils10LogicError7__ClassZ' avl.d:(.text._D3avl3AVL10delLeftBalMFKC3avl3AVL4NodeKbZC3avl3AVL4Node+0x175): undefined reference to `_D5utils10LogicError6__ctorMFAyamC6object9ThrowableZC5utils10LogicError' avl.d:(.text._D3avl3AVL10delLeftBalMFKC3avl3AVL4NodeKbZC3avl3AVL4Node+0x230): undefined reference to `_D5utils10LogicError7__ClassZ' avl.d:(.text._D3avl3AVL10delLeftBalMFKC3avl3AVL4NodeKbZC3avl3AVL4Node+0x267): undefined reference to `_D5utils10LogicError6__ctorMFAyamC6object9ThrowableZC5utils10LogicError' /tmp/.rdmd-1000/rdmd-avl.d-EFC2A8F3F9817BAA59A3A00532D5696F/objs/avl.o: In function `_D3avl3AVL10delRghtBalMFKC3avl3AVL4NodeKbZC3avl3AVL4Node': avl.d:(.text._D3avl3AVL10delRghtBalMFKC3avl3AVL4NodeKbZC3avl3AVL4Node+0x13e): undefined reference to `_D5utils10LogicError7__ClassZ' avl.d:(.text._D3avl3AVL10delRghtBalMFKC3avl3AVL4NodeKbZC3avl3AVL4Node+0x175): undefined reference to `_D5utils10LogicError6__ctorMFAyamC6object9ThrowableZC5utils10LogicError' avl.d:(.text._D3avl3AVL10delRghtBalMFKC3avl3AVL4NodeKbZC3avl3AVL4Node+0x230): undefined reference to `_D5utils10LogicError7__ClassZ' avl.d:(.text._D3avl3AVL10delRghtBalMFKC3avl3AVL4NodeKbZC3avl3AVL4Node+0x267): undefined reference to `_D5utils10LogicError6__ctorMFAyamC6object9ThrowableZC5utils10LogicError' collect2: ld returned 1 exit status --- errorlevel 1
Comment #1 by charleshixsn — 2012-08-31T18:23:32Z
Sorry, nearly forgot this: charles@mandala1:~/projects/D/Parser$ dmd DMD64 D Compiler v2.060 Copyright (c) 1999-2012 by Digital Mars written by Walter Bright Documentation: http://www.dlang.org/index.html And my computer is debian stable updated to 2012/08/30, with a couple of additions from testing. (Basically, if got a recent version of Vala installed. I think it was Vala that demanded a couple of libraries to be pulled from testing.)
Comment #2 by dmitry.olsh — 2012-09-01T02:50:38Z
Can't reproduce on Win32. Both files work with rdmd on their own or in Parser folder. That might mean the bug is platform specific. Also try --dry-run option it'll give you the commands rdmd tries to run. You can then run them one by one until you hit the error.
Comment #3 by dlang-bugzilla — 2013-03-10T01:31:15Z
I'm going to invoke my psychic powers and conclude that you have a file called utils.di in the Parser directory. rdmd currently assumes that if you're using .di files, the code for them will be found in a library that's implicitly imported by your code (e.g. using pragma(lib)). I noticed that you tried to manually include utils.d in the compilation by putting it on rdmd's command line: > charles@mandala1:~/projects/D/Parser$ rdmd -unittest avl.d utils.d This is not how rdmd works - the first .d file is considered as your program's entry point, and all arguments after that as arguments to be passed to your program when executing it. rdmd looks at which files the compiler consults (output of dmd -v) to figure out which modules should be compiled.