Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preserve path to object file in COFF library to avoid ambiguities #1315

Merged
merged 1 commit into from
Jan 19, 2013

Conversation

rainers
Copy link
Member

@rainers rainers commented Nov 24, 2012

Object files in a COFF library with the same name cause ambiguities and errors when linking against them, especially when building with debug info. Linking with phobos built with debug info results in

..\..\windows\bin\dmd.exe -m64 -Irunnable  -g -debuglib=phobos64_d  -odtest_results\runnable -oftest_results\runnable\A16_0.exe runnable\A16.d runnable\imports\A16a.d -map nul.map
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

phobos64_d.lib(utf.obj) : warning LNK4255: library contain multiple objects of the same name; linking object as if no debug info
phobos64_d.lib(string.obj) : warning LNK4255: library contain multiple objects of the same name; linking object as if no debug info
phobos64_d.lib(stdio.obj) : warning LNK4255: library contain multiple objects of the same name; linking object as if no debug info
phobos64_d.lib(exception.obj) : warning LNK4255: library contain multiple objects of the same name; linking object as if no debug info
phobos64_d.lib(exception.obj) : fatal error LNK1103: debugging information corrupt; recompile module
--- errorlevel 1103

This patch keeps the object module path if "-op" is specified. Maybe it might be better to figure out a better path to distinguish object files, e.g. the module package name, but that info is currently unavailable when adding the module to the library.

WalterBright added a commit that referenced this pull request Jan 19, 2013
preserve path to object file in COFF library to avoid ambiguities
@WalterBright WalterBright merged commit c956ce7 into dlang:master Jan 19, 2013
WalterBright added a commit that referenced this pull request Jan 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants