{"action":"created","issue":{"url":"https://api.github.com/repos/android-ndk/ndk/issues/137","repository_url":"https://api.github.com/repos/android-ndk/ndk","labels_url":"https://api.github.com/repos/android-ndk/ndk/issues/137/labels{/name}","comments_url":"https://api.github.com/repos/android-ndk/ndk/issues/137/comments","events_url":"https://api.github.com/repos/android-ndk/ndk/issues/137/events","html_url":"https://github.com/android-ndk/ndk/issues/137","id":162481325,"number":137,"title":"Link time optimization does not work with Clang","user":{"login":"DoDoENT","id":158844,"avatar_url":"https://avatars.githubusercontent.com/u/158844?v=3","gravatar_id":"","url":"https://api.github.com/users/DoDoENT","html_url":"https://github.com/DoDoENT","followers_url":"https://api.github.com/users/DoDoENT/followers","following_url":"https://api.github.com/users/DoDoENT/following{/other_user}","gists_url":"https://api.github.com/users/DoDoENT/gists{/gist_id}","starred_url":"https://api.github.com/users/DoDoENT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoDoENT/subscriptions","organizations_url":"https://api.github.com/users/DoDoENT/orgs","repos_url":"https://api.github.com/users/DoDoENT/repos","events_url":"https://api.github.com/users/DoDoENT/events{/privacy}","received_events_url":"https://api.github.com/users/DoDoENT/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-06-27T15:33:11Z","updated_at":"2016-06-27T18:47:17Z","closed_at":"2016-06-27T17:45:47Z","body":"When using compile option -flto (in LOCAL_CFLAGS) with Clang on NDK r12 and also '-Wl,-flto' in LOCAL_LDFLAGS, linker fails with these three errors for each source file:\r\n\r\n- sourceFile.o:1:3: invalid character\r\n- sourceFile.o:1:3: syntax error, unexpected $end\r\n- sourceFile.o: not an object or archive\r\n\r\nWhen using GCC, LTO work as expected, except when targetting armeabi-v7a, when we get the following error when using LOCAL_ARM_NEON := true:\r\n- lto1: fatal error: target specific builtin not available\r\n- ld.gold: fatal error: lto-wrapper failed\r\n\r\nand this one when only several files are tagged with NEON tag:\r\n- Error: selected processor does not support Thumb mode `vdup.32 q0,mask0`\r\n\r\nWe believe this error is related to [this bug in chromium project](https://bugs.chromium.org/p/chromium/issues/detail?id=408997) which was apparently fixed in GCC 5 and not present in clang. However, when trying with clang, we get the error described above.\r\n\r\nPlease advise how to turn on LTO on Clang or enable LTO on GCC with armeabi-v7a."},"comment":{"url":"https://api.github.com/repos/android-ndk/ndk/issues/comments/228838434","html_url":"https://github.com/android-ndk/ndk/issues/137#issuecomment-228838434","issue_url":"https://api.github.com/repos/android-ndk/ndk/issues/137","id":228838434,"user":{"login":"DanAlbert","id":315852,"avatar_url":"https://avatars.githubusercontent.com/u/315852?v=3","gravatar_id":"","url":"https://api.github.com/users/DanAlbert","html_url":"https://github.com/DanAlbert","followers_url":"https://api.github.com/users/DanAlbert/followers","following_url":"https://api.github.com/users/DanAlbert/following{/other_user}","gists_url":"https://api.github.com/users/DanAlbert/gists{/gist_id}","starred_url":"https://api.github.com/users/DanAlbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanAlbert/subscriptions","organizations_url":"https://api.github.com/users/DanAlbert/orgs","repos_url":"https://api.github.com/users/DanAlbert/repos","events_url":"https://api.github.com/users/DanAlbert/events{/privacy}","received_events_url":"https://api.github.com/users/DanAlbert/received_events","type":"User","site_admin":false},"created_at":"2016-06-27T18:47:17Z","updated_at":"2016-06-27T18:47:17Z","body":"Oops, accidentally deleted the second half of my reply when I found the cause:\r\n\r\n> When using GCC, LTO work as expected, except when targetting armeabi-v7a, when we get the following error when using LOCAL_ARM_NEON := true:\r\n> \r\n> lto1: fatal error: target specific builtin not available\r\n> ld.gold: fatal error: lto-wrapper failed\r\n> and this one when only several files are tagged with NEON tag:\r\n> \r\n> Error: selected processor does not support Thumb mode vdup.32 q0,mask0\r\n\r\nDid this work with prior releases? If it's a regression I might be able to get someone to look in to it.\r\n\r\n>  I know next release of NDK will remove GCC\r\n\r\nJust FYI, it's not quite that soon. Until libc++ is 100% reliable GCC needs to stay because libstdc++ 4.9 doesn't support clang in `<thread>`, `<atomic>`, and the like, so removing it would remove support for some pretty important parts of C++.\r\n\r\nI don't know exactly when this will happen, but I'll certainly call it out in the release notes at least a release ahead of the actual removal."}}
{"actor":{"display_login":"DanAlbert"}}