{"action":"created","issue":{"url":"https://api.github.com/repos/voidlinux/void-packages/issues/2042","labels_url":"https://api.github.com/repos/voidlinux/void-packages/issues/2042/labels{/name}","comments_url":"https://api.github.com/repos/voidlinux/void-packages/issues/2042/comments","events_url":"https://api.github.com/repos/voidlinux/void-packages/issues/2042/events","html_url":"https://github.com/voidlinux/void-packages/issues/2042","id":95635169,"number":2042,"title":"clang++ cannot link with exceptions enabled","user":{"login":"vtoc","id":2727071,"avatar_url":"https://avatars.githubusercontent.com/u/2727071?v=3","gravatar_id":"","url":"https://api.github.com/users/vtoc","html_url":"https://github.com/vtoc","followers_url":"https://api.github.com/users/vtoc/followers","following_url":"https://api.github.com/users/vtoc/following{/other_user}","gists_url":"https://api.github.com/users/vtoc/gists{/gist_id}","starred_url":"https://api.github.com/users/vtoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtoc/subscriptions","organizations_url":"https://api.github.com/users/vtoc/orgs","repos_url":"https://api.github.com/users/vtoc/repos","events_url":"https://api.github.com/users/vtoc/events{/privacy}","received_events_url":"https://api.github.com/users/vtoc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/voidlinux/void-packages/labels/Bug","name":"Bug","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-07-17T10:56:10Z","updated_at":"2015-08-11T12:03:34Z","closed_at":null,"body":"clang++ can not link any binaries that could throw exceptions anymore. For example:\r\n\r\n```c++\r\n#include <iostream>\r\n#include <string>\r\n\r\nvoid hello(std::string s)\r\n{\r\n    std::cout << \"Hello \" << s << std::endl;\r\n}\r\n\r\nint main(void)\r\n{\r\n    hello(\"world\");\r\n}\r\n```\r\n\r\n```\r\n$ clang++ -o foo foo.cc && ./foo                \r\n/usr/bin/ld: /tmp/foo-a6b68d.o: undefined reference to symbol '_Unwind_Resume@@GCC_3.0'\r\n/lib64/libgcc_s.so.1: error adding symbols: DSO missing from command line\r\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\r\n```\r\n\r\nDisabling exceptions \"works\":\r\n\r\n```\r\n\r\n$ clang++ -fno-exceptions -o foo foo.cc && ./foo\r\nHello world\r\n```\r\n\r\nVerbose\r\n```\r\n$ clang++ -v -o foo foo.cc\r\nclang version 3.6.2 (tags/RELEASE_362/final)\r\nTarget: x86_64-unknown-linux-gnu\r\nThread model: posix\r\nFound candidate GCC installation: /usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9\r\nFound candidate GCC installation: /usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.3\r\nFound candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9\r\nFound candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.3\r\nFound candidate GCC installation: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9\r\nFound candidate GCC installation: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3\r\nFound candidate GCC installation: /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.9\r\nFound candidate GCC installation: /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.9.3\r\nSelected GCC installation: /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9\r\nCandidate multilib: .;@m64\r\nSelected multilib: .;@m64\r\n \"/usr/bin/clang\" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name foo.cc -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -target-linker-version 2.25 -v -dwarf-column-info -resource-dir /usr/bin/../lib/clang/3.6.2 -internal-isystem /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9/../../../../include/c++/4.9 -internal-isystem /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9/../../../../include/c++/4.9/x86_64-unknown-linux-gnu -internal-isystem /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9/../../../../include/c++/4.9/backward -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.6.2/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /home/jw/dev -ferror-limit 19 -fmessage-length 108 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/foo-0b4e7f.o -x c++ foo.cc\r\nclang -cc1 version 3.6.2 based upon LLVM 3.6.2 default target x86_64-unknown-linux-gnu\r\nignoring nonexistent directory \"/include\"\r\n#include \"...\" search starts here:\r\n#include <...> search starts here:\r\n /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9/../../../../include/c++/4.9\r\n /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9/../../../../include/c++/4.9/x86_64-unknown-linux-gnu\r\n /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9/../../../../include/c++/4.9/backward\r\n /usr/local/include\r\n /usr/bin/../lib/clang/3.6.2/include\r\n /usr/include\r\nEnd of search list.\r\n \"/usr/bin/ld\" --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o foo /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9/../../../../lib64/crt1.o /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9/../../../../lib64/crti.o /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9/crtbegin.o -L/usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9 -L/usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9/../../../../lib64 -L/usr/bin/../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9/../../.. -L/usr/bin/../lib -L/lib -L/usr/lib /tmp/foo-0b4e7f.o -lstdc++ -lm /usr/bin/../lib/clang/3.6.2/lib/linux/libclang_rt.builtins-x86_64.a -lc /usr/bin/../lib/clang/3.6.2/lib/linux/libclang_rt.builtins-x86_64.a /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9/crtend.o /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9/../../../../lib64/crtn.o\r\n/usr/bin/ld: /tmp/foo-0b4e7f.o: undefined reference to symbol '_Unwind_Resume@@GCC_3.0'\r\n/lib64/libgcc_s.so.1: error adding symbols: DSO missing from command line\r\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\r\n```"},"comment":{"url":"https://api.github.com/repos/voidlinux/void-packages/issues/comments/129851079","html_url":"https://github.com/voidlinux/void-packages/issues/2042#issuecomment-129851079","issue_url":"https://api.github.com/repos/voidlinux/void-packages/issues/2042","id":129851079,"user":{"login":"chneukirchen","id":139,"avatar_url":"https://avatars.githubusercontent.com/u/139?v=3","gravatar_id":"","url":"https://api.github.com/users/chneukirchen","html_url":"https://github.com/chneukirchen","followers_url":"https://api.github.com/users/chneukirchen/followers","following_url":"https://api.github.com/users/chneukirchen/following{/other_user}","gists_url":"https://api.github.com/users/chneukirchen/gists{/gist_id}","starred_url":"https://api.github.com/users/chneukirchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chneukirchen/subscriptions","organizations_url":"https://api.github.com/users/chneukirchen/orgs","repos_url":"https://api.github.com/users/chneukirchen/repos","events_url":"https://api.github.com/users/chneukirchen/events{/privacy}","received_events_url":"https://api.github.com/users/chneukirchen/received_events","type":"User","site_admin":false},"created_at":"2015-08-11T12:03:34Z","updated_at":"2015-08-11T12:03:34Z","body":"Ok, my plan is so far:\r\n\r\n1) remove 002, so libgcc will be used by default, which should work on glibc+musl.\r\n2) change 008 to always use `-lgcc_eh`, so compiler-rt should work too, then.\r\n\r\nBy keeping to upstream defaults, I hope this breaks less stuff in total, while people experimenting with compiler-rt can still use it, even with `-static`.\r\n\r\nWe currently cannot build using libgcc* without having an alternative to libstdc++ (this would be a worthwhile project however)."}}