{"action":"created","issue":{"url":"https://api.github.com/repos/GregorR/musl-cross/issues/45","labels_url":"https://api.github.com/repos/GregorR/musl-cross/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/GregorR/musl-cross/issues/45/comments","events_url":"https://api.github.com/repos/GregorR/musl-cross/issues/45/events","html_url":"https://github.com/GregorR/musl-cross/issues/45","id":47557294,"number":45,"title":"i486 toolchain (and maybe others) fail with -fPIE -fstack-protector-all","user":{"login":"rofl0r","id":341425,"avatar_url":"https://avatars.githubusercontent.com/u/341425?v=3","gravatar_id":"","url":"https://api.github.com/users/rofl0r","html_url":"https://github.com/rofl0r","followers_url":"https://api.github.com/users/rofl0r/followers","following_url":"https://api.github.com/users/rofl0r/following{/other_user}","gists_url":"https://api.github.com/users/rofl0r/gists{/gist_id}","starred_url":"https://api.github.com/users/rofl0r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rofl0r/subscriptions","organizations_url":"https://api.github.com/users/rofl0r/orgs","repos_url":"https://api.github.com/users/rofl0r/repos","events_url":"https://api.github.com/users/rofl0r/events{/privacy}","received_events_url":"https://api.github.com/users/rofl0r/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2014-11-03T01:46:46Z","updated_at":"2015-06-18T12:44:57Z","closed_at":null,"body":"test.c\r\n```c\r\nint main() {return 0;}\r\n```\r\n```\r\ni486-linux-musl-gcc test.c -fPIE -fstack-protector-all\r\n/tmp/ccEkagdJ.o: In function `main':\r\ntest.c:(.text+0x28): undefined reference to `__stack_chk_fail_local'\r\n/home/rofl/musl-cross-4.8.3/i486-linux-musl/lib/gcc/i486-linux-musl/4.8.3/../../../../i486-linux-musl/bin/ld: a.out: hidden symbol `__stack_chk_fail_local' isn't defined\r\n/home/rofl/musl-cross-4.8.3/i486-linux-musl/lib/gcc/i486-linux-musl/4.8.3/../../../../i486-linux-musl/bin/ld: final link failed: Bad value\r\ncollect2: error: ld returned 1 exit status\r\n```\r\ninterestingly, the gcc build is aware of the need of libssp_nonshared.a and creates it from ssp-local.c, and it even installs it into lib/.\r\nhowever, it fails to add it to its linker invocation when it's needed.\r\n\r\n```\r\ni486-linux-musl-gcc test.c -fPIE -fstack-protector-all -lssp_nonshared\r\n```\r\nworks.\r\nalpine linux uses the following patch for the same issue:\r\nhttp://git.alpinelinux.org/cgit/aports/tree/main/gcc/gcc-4.8-musl-libssp.patch"},"comment":{"url":"https://api.github.com/repos/GregorR/musl-cross/issues/comments/113143822","html_url":"https://github.com/GregorR/musl-cross/issues/45#issuecomment-113143822","issue_url":"https://api.github.com/repos/GregorR/musl-cross/issues/45","id":113143822,"user":{"login":"soul9","id":175965,"avatar_url":"https://avatars.githubusercontent.com/u/175965?v=3","gravatar_id":"","url":"https://api.github.com/users/soul9","html_url":"https://github.com/soul9","followers_url":"https://api.github.com/users/soul9/followers","following_url":"https://api.github.com/users/soul9/following{/other_user}","gists_url":"https://api.github.com/users/soul9/gists{/gist_id}","starred_url":"https://api.github.com/users/soul9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soul9/subscriptions","organizations_url":"https://api.github.com/users/soul9/orgs","repos_url":"https://api.github.com/users/soul9/repos","events_url":"https://api.github.com/users/soul9/events{/privacy}","received_events_url":"https://api.github.com/users/soul9/received_events","type":"User","site_admin":false},"created_at":"2015-06-18T12:44:57Z","updated_at":"2015-06-18T12:44:57Z","body":"While it does not break bootstrapping it introduces a bug where static linking fails with stack-protector. I am investigating."}}