[Issue 6142] New: 32- and 64-bit libraries are combined without error
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jun 10 07:02:56 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6142
Summary: 32- and 64-bit libraries are combined without error
Product: D
Version: D1 & D2
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bugzilla at kyllingen.net
--- Comment #0 from Lars T. Kyllingstad <bugzilla at kyllingen.net> 2011-06-10 06:58:20 PDT ---
DMD will happily combine static library files for different architectures.
This confuses the linker.
Steps to reproduce (performed on 64-bit Linux):
1. Write libfoo.d.
void foo() { }
2. Write libbar.d.
void bar() { }
3. Compile libfoo as 32-bit library.
dmd -lib -m32 libfoo.d
4. Compile libbar as 64-bit library, including libfoo.
dmd -lib -m64 -oflibbar.a libfoo.a libbar.d
5. Compile any program with -m64 -lbar
/usr/bin/ld: skipping incompatible ./libbar.a when searching for -lbar
/usr/bin/ld: cannot find -lbar
ld accepts the library if -m32 is specified in step 5, but complains about the
64-bit object files.
This is the model upon which druntime+Phobos is compiled. I spent an hour
trying to figure out why the linker didn't recognise the 64-bit libphobos2.a,
until I realised that it had been compiled with a 32-bit version of
libdruntime.a. :(
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list