{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/2252","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/2252/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/2252/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/2252/events","html_url":"https://github.com/dotnet/coreclr/issues/2252","id":120644622,"number":2252,"title":"LNK4221 warnings in the Windows build","user":{"login":"mikedn","id":9973420,"avatar_url":"https://avatars.githubusercontent.com/u/9973420?v=3","gravatar_id":"","url":"https://api.github.com/users/mikedn","html_url":"https://github.com/mikedn","followers_url":"https://api.github.com/users/mikedn/followers","following_url":"https://api.github.com/users/mikedn/following{/other_user}","gists_url":"https://api.github.com/users/mikedn/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedn/subscriptions","organizations_url":"https://api.github.com/users/mikedn/orgs","repos_url":"https://api.github.com/users/mikedn/repos","events_url":"https://api.github.com/users/mikedn/events{/privacy}","received_events_url":"https://api.github.com/users/mikedn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-12-06T16:41:45Z","updated_at":"2015-12-10T20:31:10Z","closed_at":null,"body":"The Windows build generates quite a few LNK4221 warnings. Almost all of them are caused by .cpp files that are included in the build but have their entire content ifdefed out. For example, appdomainhelper.cpp, message.cpp and crossdomaincalls.cpp are used only if FEATURE_REMOTING is enabled.\r\n\r\nIt seems to me that all such files should simply be removed from build to cleanup the linker warnings. Or they should be included in the build conditionally, if the features that need them are enabled. I prototyped such a solution but it seems more trouble than it's worth, it's unlikely that features like remoting will ever come back to CoreCLR. Opinions?\r\n\r\nA (not necessarily exhaustive) list of features that are currently disabled but have files included in build:\r\n```\r\nFEATURE_METHOD_RENTAL\r\nFEATURE_FUSION\r\nFEATURE_PERFMAP\r\nFEATURE_TYPEEQUIVALENCE\r\nFEATURE_PROFAPI_ATTACH_DETACH\r\nFEATURE_INTERPRETER\r\nFEATURE_REMOTING\r\nFEATURE_CAS_POLICY\r\nFEATURE_RWLOCK\r\nFEATURE_MIXEDMODE\r\n```"},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/163741156","html_url":"https://github.com/dotnet/coreclr/issues/2252#issuecomment-163741156","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/2252","id":163741156,"user":{"login":"mikedn","id":9973420,"avatar_url":"https://avatars.githubusercontent.com/u/9973420?v=3","gravatar_id":"","url":"https://api.github.com/users/mikedn","html_url":"https://github.com/mikedn","followers_url":"https://api.github.com/users/mikedn/followers","following_url":"https://api.github.com/users/mikedn/following{/other_user}","gists_url":"https://api.github.com/users/mikedn/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedn/subscriptions","organizations_url":"https://api.github.com/users/mikedn/orgs","repos_url":"https://api.github.com/users/mikedn/repos","events_url":"https://api.github.com/users/mikedn/events{/privacy}","received_events_url":"https://api.github.com/users/mikedn/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T20:31:10Z","updated_at":"2015-12-10T20:31:10Z","body":"I think I'll give up on conditionally including files. Initially I though that features are enabled in the root makefiles and never changed after that but it turns out some features are later disabled in dac.cmake and crossgen.cmake and that may result in files being included even though the corresponding features have been disabled. I don't think this is the right approach but that's another issue.\r\n\r\nFor now I think that we should simply remove those files that do not make sense in CoreCLR (fusion, CAS and remoting I'd say) and disable 4221 via CMAKE_STATIC_LINKER_FLAGS."}}