{"action":"created","comment":{"url":"https://api.github.com/repos/apple/swift/pulls/comments/54197350","id":54197350,"diff_hunk":"@@ -847,6 +848,74 @@ toolchains::Darwin::constructInvocation(const InterpretJobAction &job,\n   return II;\n }\n \n+static StringRef\n+getDarwinLibraryNameSuffixForTriple(const llvm::Triple &triple) {\n+  switch(getDarwinPlatformKind(triple)) {\n+    case DarwinPlatformKind::MacOS:\n+      return \"osx\";\n+    case DarwinPlatformKind::IPhoneOS:\n+      return \"ios\";\n+    case DarwinPlatformKind::IPhoneOSSimulator:\n+      return \"iossim\";\n+    case DarwinPlatformKind::TvOS:\n+      return \"tvos\";\n+    case DarwinPlatformKind::TvOSSimulator:\n+      return \"tvossim\";\n+    case DarwinPlatformKind::WatchOS:\n+      return \"watchos\";\n+    case DarwinPlatformKind::WatchOSSimulator:\n+      return \"watchossim\";\n+  }\n+  llvm_unreachable(\"Unsupported Darwin platform\");\n+}\n+\n+static void AddLinkRuntimeLib(const ArgList &Args, ArgStringList &Arguments,\n+                              StringRef DarwinLibName, bool AddRPath,\n+                              const ToolChain &TC) {\n+  SmallString<128> Dir;\n+  getRuntimeLibraryPath(Dir, Args, TC);\n+  // Remove platform name.\n+  llvm::sys::path::remove_filename(Dir);\n+  llvm::sys::path::append(Dir, \"clang\", \"lib\", \"darwin\");\n+  SmallString<128> P(Dir);\n+  llvm::sys::path::append(P, DarwinLibName);\n+  Arguments.push_back(Args.MakeArgString(P));\n+\n+  // Adding the rpaths might negatively interact when other rpaths are involved,\n+  // so we should make sure we add the rpaths last, after all user-specified\n+  // rpaths. This is currently true from this place, but we need to be\n+  // careful if this function is ever called before user's rpaths are emitted.\n+  if (AddRPath) {\n+    assert(DarwinLibName.endswith(\".dylib\") && \"must be a dynamic library\");\n+\n+    // Add @executable_path to rpath to support having the dylib copied with\n+    // the executable.\n+    Arguments.push_back(\"-rpath\");\n+    Arguments.push_back(\"@executable_path\");\n+\n+    // Add the path to the resource dir to rpath to support using the dylib\n+    // from the default location without copying.\n+    Arguments.push_back(\"-rpath\");\n+    Arguments.push_back(Args.MakeArgString(Dir));\n+  }\n+}\n+\n+static void AddLinkSanitizerLibArgs(const ArgList &Args,","path":"lib/Driver/ToolChains.cpp","position":64,"original_position":64,"commit_id":"d727c68fde7b1e6d846689ece0be306a667d1c02","original_commit_id":"d727c68fde7b1e6d846689ece0be306a667d1c02","user":{"login":"jrose-apple","id":15097531,"avatar_url":"https://avatars.githubusercontent.com/u/15097531?v=3","gravatar_id":"","url":"https://api.github.com/users/jrose-apple","html_url":"https://github.com/jrose-apple","followers_url":"https://api.github.com/users/jrose-apple/followers","following_url":"https://api.github.com/users/jrose-apple/following{/other_user}","gists_url":"https://api.github.com/users/jrose-apple/gists{/gist_id}","starred_url":"https://api.github.com/users/jrose-apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrose-apple/subscriptions","organizations_url":"https://api.github.com/users/jrose-apple/orgs","repos_url":"https://api.github.com/users/jrose-apple/repos","events_url":"https://api.github.com/users/jrose-apple/events{/privacy}","received_events_url":"https://api.github.com/users/jrose-apple/received_events","type":"User","site_admin":false},"body":"Since this implementation will not work on non-Darwin, please put \"Darwin\" in the name. (We don't know which C++ stdlib and ABI libraries to use elsewhere, for one.)","created_at":"2016-02-26T02:15:55Z","updated_at":"2016-02-26T02:15:55Z","html_url":"https://github.com/apple/swift/pull/1434#discussion_r54197350","pull_request_url":"https://api.github.com/repos/apple/swift/pulls/1434","_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/comments/54197350"},"html":{"href":"https://github.com/apple/swift/pull/1434#discussion_r54197350"},"pull_request":{"href":"https://api.github.com/repos/apple/swift/pulls/1434"}}},"pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/1434","id":60591862,"html_url":"https://github.com/apple/swift/pull/1434","diff_url":"https://github.com/apple/swift/pull/1434.diff","patch_url":"https://github.com/apple/swift/pull/1434.patch","issue_url":"https://api.github.com/repos/apple/swift/issues/1434","number":1434,"state":"open","locked":false,"title":"[asan] Add basic support for Address Sanitizer function instrumentation","user":{"login":"AnnaZaks","id":15273619,"avatar_url":"https://avatars.githubusercontent.com/u/15273619?v=3","gravatar_id":"","url":"https://api.github.com/users/AnnaZaks","html_url":"https://github.com/AnnaZaks","followers_url":"https://api.github.com/users/AnnaZaks/followers","following_url":"https://api.github.com/users/AnnaZaks/following{/other_user}","gists_url":"https://api.github.com/users/AnnaZaks/gists{/gist_id}","starred_url":"https://api.github.com/users/AnnaZaks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnnaZaks/subscriptions","organizations_url":"https://api.github.com/users/AnnaZaks/orgs","repos_url":"https://api.github.com/users/AnnaZaks/repos","events_url":"https://api.github.com/users/AnnaZaks/events{/privacy}","received_events_url":"https://api.github.com/users/AnnaZaks/received_events","type":"User","site_admin":false},"body":"ASan allows to catch and diagnose memory corruption errors, which are possible\r\nwhen using unsafe pointers.\r\n\r\nThis patch introduces a new driver/frontend option -sanitize=address to enable\r\nASan function instrumentation. When the option is passed, the ASan llvm passes \r\nwill be turned on and all functions will gain SanitizeAddress llvm attribute.\r\n","created_at":"2016-02-24T22:39:41Z","updated_at":"2016-02-26T02:15:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ad02d3c69907d961743a9291d020e0e1758fe6f0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apple/swift/pulls/1434/commits","review_comments_url":"https://api.github.com/repos/apple/swift/pulls/1434/comments","review_comment_url":"https://api.github.com/repos/apple/swift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apple/swift/issues/1434/comments","statuses_url":"https://api.github.com/repos/apple/swift/statuses/d727c68fde7b1e6d846689ece0be306a667d1c02","head":{"label":"apple:asan","ref":"asan","sha":"d727c68fde7b1e6d846689ece0be306a667d1c02","user":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"repo":{"id":44838949,"name":"swift","full_name":"apple/swift","owner":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apple/swift","description":"The Swift Programming Language","fork":false,"url":"https://api.github.com/repos/apple/swift","forks_url":"https://api.github.com/repos/apple/swift/forks","keys_url":"https://api.github.com/repos/apple/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/swift/teams","hooks_url":"https://api.github.com/repos/apple/swift/hooks","issue_events_url":"https://api.github.com/repos/apple/swift/issues/events{/number}","events_url":"https://api.github.com/repos/apple/swift/events","assignees_url":"https://api.github.com/repos/apple/swift/assignees{/user}","branches_url":"https://api.github.com/repos/apple/swift/branches{/branch}","tags_url":"https://api.github.com/repos/apple/swift/tags","blobs_url":"https://api.github.com/repos/apple/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/swift/languages","stargazers_url":"https://api.github.com/repos/apple/swift/stargazers","contributors_url":"https://api.github.com/repos/apple/swift/contributors","subscribers_url":"https://api.github.com/repos/apple/swift/subscribers","subscription_url":"https://api.github.com/repos/apple/swift/subscription","commits_url":"https://api.github.com/repos/apple/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/swift/contents/{+path}","compare_url":"https://api.github.com/repos/apple/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/swift/merges","archive_url":"https://api.github.com/repos/apple/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/swift/downloads","issues_url":"https://api.github.com/repos/apple/swift/issues{/number}","pulls_url":"https://api.github.com/repos/apple/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/swift/labels{/name}","releases_url":"https://api.github.com/repos/apple/swift/releases{/id}","deployments_url":"https://api.github.com/repos/apple/swift/deployments","created_at":"2015-10-23T21:15:07Z","updated_at":"2016-02-26T02:08:28Z","pushed_at":"2016-02-26T02:14:08Z","git_url":"git://github.com/apple/swift.git","ssh_url":"git@github.com:apple/swift.git","clone_url":"https://github.com/apple/swift.git","svn_url":"https://github.com/apple/swift","homepage":"https://swift.org/","size":125508,"stargazers_count":27060,"watchers_count":27060,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3480,"mirror_url":null,"open_issues_count":70,"forks":3480,"open_issues":70,"watchers":27060,"default_branch":"master"}},"base":{"label":"apple:master","ref":"master","sha":"02dd1e407b04d81f6ea5e38aebe223b91a0571c4","user":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"repo":{"id":44838949,"name":"swift","full_name":"apple/swift","owner":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apple/swift","description":"The Swift Programming Language","fork":false,"url":"https://api.github.com/repos/apple/swift","forks_url":"https://api.github.com/repos/apple/swift/forks","keys_url":"https://api.github.com/repos/apple/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/swift/teams","hooks_url":"https://api.github.com/repos/apple/swift/hooks","issue_events_url":"https://api.github.com/repos/apple/swift/issues/events{/number}","events_url":"https://api.github.com/repos/apple/swift/events","assignees_url":"https://api.github.com/repos/apple/swift/assignees{/user}","branches_url":"https://api.github.com/repos/apple/swift/branches{/branch}","tags_url":"https://api.github.com/repos/apple/swift/tags","blobs_url":"https://api.github.com/repos/apple/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/swift/languages","stargazers_url":"https://api.github.com/repos/apple/swift/stargazers","contributors_url":"https://api.github.com/repos/apple/swift/contributors","subscribers_url":"https://api.github.com/repos/apple/swift/subscribers","subscription_url":"https://api.github.com/repos/apple/swift/subscription","commits_url":"https://api.github.com/repos/apple/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/swift/contents/{+path}","compare_url":"https://api.github.com/repos/apple/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/swift/merges","archive_url":"https://api.github.com/repos/apple/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/swift/downloads","issues_url":"https://api.github.com/repos/apple/swift/issues{/number}","pulls_url":"https://api.github.com/repos/apple/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/swift/labels{/name}","releases_url":"https://api.github.com/repos/apple/swift/releases{/id}","deployments_url":"https://api.github.com/repos/apple/swift/deployments","created_at":"2015-10-23T21:15:07Z","updated_at":"2016-02-26T02:08:28Z","pushed_at":"2016-02-26T02:14:08Z","git_url":"git://github.com/apple/swift.git","ssh_url":"git@github.com:apple/swift.git","clone_url":"https://github.com/apple/swift.git","svn_url":"https://github.com/apple/swift","homepage":"https://swift.org/","size":125508,"stargazers_count":27060,"watchers_count":27060,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3480,"mirror_url":null,"open_issues_count":70,"forks":3480,"open_issues":70,"watchers":27060,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/1434"},"html":{"href":"https://github.com/apple/swift/pull/1434"},"issue":{"href":"https://api.github.com/repos/apple/swift/issues/1434"},"comments":{"href":"https://api.github.com/repos/apple/swift/issues/1434/comments"},"review_comments":{"href":"https://api.github.com/repos/apple/swift/pulls/1434/comments"},"review_comment":{"href":"https://api.github.com/repos/apple/swift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apple/swift/pulls/1434/commits"},"statuses":{"href":"https://api.github.com/repos/apple/swift/statuses/d727c68fde7b1e6d846689ece0be306a667d1c02"}}}}