{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/39709178","id":39709178,"diff_hunk":"@@ -977,11 +942,62 @@ fn declare_intrinsic(ccx: &CrateContext, key: &str) -> Option<ValueRef> {\n                 ccx.intrinsics().borrow_mut().insert($name, f.clone());\n                 return Some(f);\n             }\n+        );\n+        ($name:expr, $cname:ident ($($arg:expr),*) -> $ret:expr) => (\n+            if !is_like_pnacl {\n+                // The `if key == $name` is already in ifn!\n+                ifn!($name, fn($($arg),*) -> $ret);\n+            } else if key == $name {\n+                let f = declare::declare_cfn(ccx, stringify!($cname),\n+                                             Type::func(&[$($arg),*], &$ret),\n+                                             ccx.tcx().mk_nil());\n+                ccx.intrinsics().borrow_mut().insert($name, f.clone());\n+                return Some(f);\n+            }\n         )\n     }\n \n     compatible_ifn!(\"llvm.assume\", noop(llvmcompat_assume(i1) -> void), 6);\n \n+    // These must be redirected to `libm` here so PNaCl's linker will link in\n+    // these functions from `libm`.\n+    compatible_ifn!(\"llvm.copysign.f32\", copysignf(t_f32, t_f32) -> t_f32);","path":"src/librustc_trans/trans/context.rs","position":114,"original_position":114,"commit_id":"8e9667b26882243e590f7a7afd287d67469fb1b1","original_commit_id":"8e9667b26882243e590f7a7afd287d67469fb1b1","user":{"login":"DiamondLovesYou","id":650357,"avatar_url":"https://avatars.githubusercontent.com/u/650357?v=3","gravatar_id":"","url":"https://api.github.com/users/DiamondLovesYou","html_url":"https://github.com/DiamondLovesYou","followers_url":"https://api.github.com/users/DiamondLovesYou/followers","following_url":"https://api.github.com/users/DiamondLovesYou/following{/other_user}","gists_url":"https://api.github.com/users/DiamondLovesYou/gists{/gist_id}","starred_url":"https://api.github.com/users/DiamondLovesYou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DiamondLovesYou/subscriptions","organizations_url":"https://api.github.com/users/DiamondLovesYou/orgs","repos_url":"https://api.github.com/users/DiamondLovesYou/repos","events_url":"https://api.github.com/users/DiamondLovesYou/events{/privacy}","received_events_url":"https://api.github.com/users/DiamondLovesYou/received_events","type":"User","site_admin":false},"body":"The PNaCl passes aren't run until after linking. In other words, `pnacl-ld` first links all the bitcode together and then runs the pre and post optimization PNaCl IR simplification passes, with the optimizations in the middle if requested. Thus the linker can completely omit `libm` from the output module, not knowing that the PNaCl IR passes will later create references to symbols defined in it.","created_at":"2015-09-17T03:40:47Z","updated_at":"2015-09-17T03:40:47Z","html_url":"https://github.com/rust-lang/rust/pull/28355#discussion_r39709178","pull_request_url":"https://api.github.com/repos/rust-lang/rust/pulls/28355","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/39709178"},"html":{"href":"https://github.com/rust-lang/rust/pull/28355#discussion_r39709178"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/28355"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/28355","id":44799153,"html_url":"https://github.com/rust-lang/rust/pull/28355","diff_url":"https://github.com/rust-lang/rust/pull/28355.diff","patch_url":"https://github.com/rust-lang/rust/pull/28355.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/28355","number":28355,"state":"open","locked":false,"title":"Add the PNaCl/JS targets to the backend.","user":{"login":"DiamondLovesYou","id":650357,"avatar_url":"https://avatars.githubusercontent.com/u/650357?v=3","gravatar_id":"","url":"https://api.github.com/users/DiamondLovesYou","html_url":"https://github.com/DiamondLovesYou","followers_url":"https://api.github.com/users/DiamondLovesYou/followers","following_url":"https://api.github.com/users/DiamondLovesYou/following{/other_user}","gists_url":"https://api.github.com/users/DiamondLovesYou/gists{/gist_id}","starred_url":"https://api.github.com/users/DiamondLovesYou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DiamondLovesYou/subscriptions","organizations_url":"https://api.github.com/users/DiamondLovesYou/orgs","repos_url":"https://api.github.com/users/DiamondLovesYou/repos","events_url":"https://api.github.com/users/DiamondLovesYou/events{/privacy}","received_events_url":"https://api.github.com/users/DiamondLovesYou/received_events","type":"User","site_admin":false},"body":"r? @alexcrichton ","created_at":"2015-09-11T15:59:02Z","updated_at":"2015-09-17T03:40:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a91e59a55aed84b6ae1f5a162436e19c606b1dad","assignee":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rust/pulls/28355/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/28355/comments","review_comment_url":"https://api.github.com/repos/rust-lang/rust/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/28355/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/8e9667b26882243e590f7a7afd287d67469fb1b1","head":{"label":"DiamondLovesYou:pnacl-librustc-trans","ref":"pnacl-librustc-trans","sha":"8e9667b26882243e590f7a7afd287d67469fb1b1","user":{"login":"DiamondLovesYou","id":650357,"avatar_url":"https://avatars.githubusercontent.com/u/650357?v=3","gravatar_id":"","url":"https://api.github.com/users/DiamondLovesYou","html_url":"https://github.com/DiamondLovesYou","followers_url":"https://api.github.com/users/DiamondLovesYou/followers","following_url":"https://api.github.com/users/DiamondLovesYou/following{/other_user}","gists_url":"https://api.github.com/users/DiamondLovesYou/gists{/gist_id}","starred_url":"https://api.github.com/users/DiamondLovesYou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DiamondLovesYou/subscriptions","organizations_url":"https://api.github.com/users/DiamondLovesYou/orgs","repos_url":"https://api.github.com/users/DiamondLovesYou/repos","events_url":"https://api.github.com/users/DiamondLovesYou/events{/privacy}","received_events_url":"https://api.github.com/users/DiamondLovesYou/received_events","type":"User","site_admin":false},"repo":{"id":16129421,"name":"rust","full_name":"DiamondLovesYou/rust","owner":{"login":"DiamondLovesYou","id":650357,"avatar_url":"https://avatars.githubusercontent.com/u/650357?v=3","gravatar_id":"","url":"https://api.github.com/users/DiamondLovesYou","html_url":"https://github.com/DiamondLovesYou","followers_url":"https://api.github.com/users/DiamondLovesYou/followers","following_url":"https://api.github.com/users/DiamondLovesYou/following{/other_user}","gists_url":"https://api.github.com/users/DiamondLovesYou/gists{/gist_id}","starred_url":"https://api.github.com/users/DiamondLovesYou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DiamondLovesYou/subscriptions","organizations_url":"https://api.github.com/users/DiamondLovesYou/orgs","repos_url":"https://api.github.com/users/DiamondLovesYou/repos","events_url":"https://api.github.com/users/DiamondLovesYou/events{/privacy}","received_events_url":"https://api.github.com/users/DiamondLovesYou/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DiamondLovesYou/rust","description":"a safe, concurrent, practical language - PNaCl fork","fork":true,"url":"https://api.github.com/repos/DiamondLovesYou/rust","forks_url":"https://api.github.com/repos/DiamondLovesYou/rust/forks","keys_url":"https://api.github.com/repos/DiamondLovesYou/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DiamondLovesYou/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DiamondLovesYou/rust/teams","hooks_url":"https://api.github.com/repos/DiamondLovesYou/rust/hooks","issue_events_url":"https://api.github.com/repos/DiamondLovesYou/rust/issues/events{/number}","events_url":"https://api.github.com/repos/DiamondLovesYou/rust/events","assignees_url":"https://api.github.com/repos/DiamondLovesYou/rust/assignees{/user}","branches_url":"https://api.github.com/repos/DiamondLovesYou/rust/branches{/branch}","tags_url":"https://api.github.com/repos/DiamondLovesYou/rust/tags","blobs_url":"https://api.github.com/repos/DiamondLovesYou/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DiamondLovesYou/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DiamondLovesYou/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/DiamondLovesYou/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DiamondLovesYou/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/DiamondLovesYou/rust/languages","stargazers_url":"https://api.github.com/repos/DiamondLovesYou/rust/stargazers","contributors_url":"https://api.github.com/repos/DiamondLovesYou/rust/contributors","subscribers_url":"https://api.github.com/repos/DiamondLovesYou/rust/subscribers","subscription_url":"https://api.github.com/repos/DiamondLovesYou/rust/subscription","commits_url":"https://api.github.com/repos/DiamondLovesYou/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/DiamondLovesYou/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/DiamondLovesYou/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/DiamondLovesYou/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/DiamondLovesYou/rust/contents/{+path}","compare_url":"https://api.github.com/repos/DiamondLovesYou/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DiamondLovesYou/rust/merges","archive_url":"https://api.github.com/repos/DiamondLovesYou/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DiamondLovesYou/rust/downloads","issues_url":"https://api.github.com/repos/DiamondLovesYou/rust/issues{/number}","pulls_url":"https://api.github.com/repos/DiamondLovesYou/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/DiamondLovesYou/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/DiamondLovesYou/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DiamondLovesYou/rust/labels{/name}","releases_url":"https://api.github.com/repos/DiamondLovesYou/rust/releases{/id}","created_at":"2014-01-22T05:06:28Z","updated_at":"2015-09-13T13:08:42Z","pushed_at":"2015-09-16T23:28:04Z","git_url":"git://github.com/DiamondLovesYou/rust.git","ssh_url":"git@github.com:DiamondLovesYou/rust.git","clone_url":"https://github.com/DiamondLovesYou/rust.git","svn_url":"https://github.com/DiamondLovesYou/rust","homepage":"http://www.rust-lang.org","size":325034,"stargazers_count":14,"watchers_count":14,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":14,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"1a1e6b85f6f0976aad5bf3bd6aec7403163c62cc","user":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":724712,"name":"rust","full_name":"rust-lang/rust","owner":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang/rust","description":"A safe, concurrent, practical language.","fork":false,"url":"https://api.github.com/repos/rust-lang/rust","forks_url":"https://api.github.com/repos/rust-lang/rust/forks","keys_url":"https://api.github.com/repos/rust-lang/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/rust/teams","hooks_url":"https://api.github.com/repos/rust-lang/rust/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/rust/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/rust/events","assignees_url":"https://api.github.com/repos/rust-lang/rust/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/rust/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/rust/tags","blobs_url":"https://api.github.com/repos/rust-lang/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/rust/languages","stargazers_url":"https://api.github.com/repos/rust-lang/rust/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/rust/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/rust/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/rust/subscription","commits_url":"https://api.github.com/repos/rust-lang/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang/rust/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/rust/merges","archive_url":"https://api.github.com/repos/rust-lang/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/rust/downloads","issues_url":"https://api.github.com/repos/rust-lang/rust/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/rust/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/rust/releases{/id}","created_at":"2010-06-16T20:39:03Z","updated_at":"2015-09-17T02:26:08Z","pushed_at":"2015-09-17T03:15:11Z","git_url":"git://github.com/rust-lang/rust.git","ssh_url":"git@github.com:rust-lang/rust.git","clone_url":"https://github.com/rust-lang/rust.git","svn_url":"https://github.com/rust-lang/rust","homepage":"http://www.rust-lang.org","size":676523,"stargazers_count":13360,"watchers_count":13360,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2593,"mirror_url":null,"open_issues_count":2258,"forks":2593,"open_issues":2258,"watchers":13360,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/28355"},"html":{"href":"https://github.com/rust-lang/rust/pull/28355"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/28355"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/28355/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/28355/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/28355/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/8e9667b26882243e590f7a7afd287d67469fb1b1"}}}}