This is an archive of the discontinued LLVM Phabricator instance.

[MS Compat] Second try to fix quoting behavior of linker directives
ClosedPublic

Authored by mkuper on Feb 15 2015, 7:48 AM.

Details

Summary

Apparently, MSVC behavior is somewhat surprising:
For #pragma comment(linker, ...) it expects the comment string to be quoted, but for #pragma comment(lib, ...) it quotes the library name.

So, these are legal:
#pragma comment(linker, "/DEFAULTLIB:\"foo bar.lib\"")
#pragma comment(lib, "foo bar.lib")
And these get rejected:
#pragma comment(linker, "/DEFAULTLIB:foo bar.lib")
#pragma comment(lib, "\"foo bar.lib\"")

Diff Detail

Repository
rL LLVM

Event Timeline

mkuper updated this revision to Diff 19983.Feb 15 2015, 7:48 AM
mkuper retitled this revision from to [MS Compat] Second try to fix quoting behavior of linker directives.
mkuper updated this object.
mkuper edited the test plan for this revision. (Show Details)
mkuper added reviewers: rnk, aaron.ballman.
mkuper added a subscriber: Unknown Object (MLST).

Accompanying backend patch here:
http://reviews.llvm.org/D7652

rnk accepted this revision.Feb 15 2015, 9:54 AM
rnk edited edge metadata.

lgtm

This revision is now accepted and ready to land.Feb 15 2015, 9:54 AM
This revision was automatically updated to reflect the committed changes.