{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/17346","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/17346/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/17346/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/17346/events","html_url":"https://github.com/rust-lang/rust/issues/17346","id":43041495,"number":17346,"title":"program without libc (without std lib) leads to cryptic error","user":{"login":"phil-opp","id":1131315,"avatar_url":"https://avatars.githubusercontent.com/u/1131315?v=3","gravatar_id":"","url":"https://api.github.com/users/phil-opp","html_url":"https://github.com/phil-opp","followers_url":"https://api.github.com/users/phil-opp/followers","following_url":"https://api.github.com/users/phil-opp/following{/other_user}","gists_url":"https://api.github.com/users/phil-opp/gists{/gist_id}","starred_url":"https://api.github.com/users/phil-opp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phil-opp/subscriptions","organizations_url":"https://api.github.com/users/phil-opp/orgs","repos_url":"https://api.github.com/users/phil-opp/repos","events_url":"https://api.github.com/users/phil-opp/events{/privacy}","received_events_url":"https://api.github.com/users/phil-opp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-book","name":"A-book","color":"d7e102"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-docs","name":"A-docs","color":"d7e102"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2014-09-17T17:41:30Z","updated_at":"2015-12-28T19:20:26Z","closed_at":"2015-03-08T13:55:15Z","body":"The code at http://doc.rust-lang.org/guide-unsafe.html#avoiding-the-standard-library requires libc. It isn't possible to remove this line or to replace it with the platform independent rlibc. The following error occurs (playpen: http://is.gd/GWl8YT):\r\n\r\n```\r\nerror: linking with `cc` failed: exit code: 1\r\nnote: cc '-m64' '-L' '/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib' '-o' 'out' 'out.o' '-Wl,--whole-archive' '-lmorestack' '-Wl,--no-whole-archive' '-nodefaultlibs' '-Wl,--gc-sections' '-pie' '-Wl,--as-needed' '-Wl,-O1' '-L' '/home/rust/.rust' '-L' '/home/rust' '-Wl,--whole-archive' '-Wl,-Bstatic' '-Wl,--no-whole-archive' '-Wl,-Bdynamic' '-lcompiler-rt'\r\nnote: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../lib/Scrt1.o: In function `_start':\r\n(.text+0x12): undefined reference to `__libc_csu_fini'\r\n/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../lib/Scrt1.o: In function `_start':\r\n(.text+0x19): undefined reference to `__libc_csu_init'\r\n/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../lib/Scrt1.o: In function `_start':\r\n(.text+0x25): undefined reference to `__libc_start_main'\r\ncollect2: error: ld returned 1 exit status\r\n\r\nerror: aborting due to previous error\r\n```\r\n\r\nI want to use libcore, that doesn't require libc (http://doc.rust-lang.org/core/). The libcore code example in the guide (http://doc.rust-lang.org/guide-unsafe.html#using-libcore) has no libc dependency, but the playpen link in the top right of the code example reinserts it and removing it leads to the same error as above (http://is.gd/sxVAr0)."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/167631749","html_url":"https://github.com/rust-lang/rust/issues/17346#issuecomment-167631749","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/17346","id":167631749,"user":{"login":"lilred","id":1834919,"avatar_url":"https://avatars.githubusercontent.com/u/1834919?v=3","gravatar_id":"","url":"https://api.github.com/users/lilred","html_url":"https://github.com/lilred","followers_url":"https://api.github.com/users/lilred/followers","following_url":"https://api.github.com/users/lilred/following{/other_user}","gists_url":"https://api.github.com/users/lilred/gists{/gist_id}","starred_url":"https://api.github.com/users/lilred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lilred/subscriptions","organizations_url":"https://api.github.com/users/lilred/orgs","repos_url":"https://api.github.com/users/lilred/repos","events_url":"https://api.github.com/users/lilred/events{/privacy}","received_events_url":"https://api.github.com/users/lilred/received_events","type":"User","site_admin":false},"created_at":"2015-12-28T19:20:26Z","updated_at":"2015-12-28T19:20:26Z","body":"[me irl](https://www.reddit.com/r/rust/comments/3yjk0v/start_semantics/cydyirl)"}}