{"action":"created","issue":{"url":"https://api.github.com/repos/weidai11/cryptopp/issues/206","repository_url":"https://api.github.com/repos/weidai11/cryptopp","labels_url":"https://api.github.com/repos/weidai11/cryptopp/issues/206/labels{/name}","comments_url":"https://api.github.com/repos/weidai11/cryptopp/issues/206/comments","events_url":"https://api.github.com/repos/weidai11/cryptopp/issues/206/events","html_url":"https://github.com/weidai11/cryptopp/issues/206","id":162425429,"number":206,"title":"GCC 4.8/4.9, -std=c++11 and \"error: expected ‘)’ before __builtin_ia32_pclmulqdq128\"","user":{"login":"noloader","id":3538226,"avatar_url":"https://avatars.githubusercontent.com/u/3538226?v=3","gravatar_id":"","url":"https://api.github.com/users/noloader","html_url":"https://github.com/noloader","followers_url":"https://api.github.com/users/noloader/followers","following_url":"https://api.github.com/users/noloader/following{/other_user}","gists_url":"https://api.github.com/users/noloader/gists{/gist_id}","starred_url":"https://api.github.com/users/noloader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noloader/subscriptions","organizations_url":"https://api.github.com/users/noloader/orgs","repos_url":"https://api.github.com/users/noloader/repos","events_url":"https://api.github.com/users/noloader/events{/privacy}","received_events_url":"https://api.github.com/users/noloader/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/weidai11/cryptopp/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/weidai11/cryptopp/labels/gcc-4","name":"gcc-4","color":"207de5"},{"url":"https://api.github.com/repos/weidai11/cryptopp/labels/x86","name":"x86","color":"d4c5f9"},{"url":"https://api.github.com/repos/weidai11/cryptopp/labels/x86_64","name":"x86_64","color":"5319e7"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-06-27T10:57:48Z","updated_at":"2016-09-19T01:13:36Z","closed_at":"2016-09-19T01:13:35Z","body":"We have a couple of issues under GCC 4.8 and 4.9 when using `-std=c++11` and `-std=c++14`. The issue is the instructions `pclmulqdq128` and `aeskeygenassist128` used in inline assembly cannot compile:\r\n\r\n```\r\n$ make CXXFLAGS=\"-DDEBUG -g3 -O0 -std=c++11 -fPIC -march=native -pipe\" vmac.o\r\ng++ -DDEBUG -g3 -O0 -std=c++11 -fPIC -march=native -pipe -c vmac.cpp\r\nIn file included from /usr/lib/gcc/x86_64-linux-gnu/4.9/include/x86intrin.h:43:0,\r\n                 from /usr/include/x86_64-linux-gnu/c++/4.9/bits/opt_random.h:33,\r\n                 from /usr/include/c++/4.9/random:50,\r\n                 from /usr/include/c++/4.9/bits/stl_algo.h:66,\r\n                 from /usr/include/c++/4.9/algorithm:62,\r\n                 from stdcpp.h:13,\r\n                 from cryptlib.h:87,\r\n                 from vmac.h:9,\r\n                 from vmac.cpp:7:\r\ncpu.h:96:1: error: expected ‘)’ before ‘__builtin_ia32_pclmulqdq128’\r\n _mm_clmulepi64_si128 (__m128i a, __m128i b, const int i)\r\n ^\r\ncpu.h:102:1: error: expected ‘)’ before ‘__builtin_ia32_aeskeygenassist128’\r\n _mm_aeskeygenassist_si128 (__m128i a, const int i)\r\n ^\r\nGNUmakefile:735: recipe for target 'vmac.o' failed\r\nmake: *** [vmac.o] Error 1\r\n```\r\n\r\nThe unexpected ‘)’ is due to an intermediate cast to `__v2di`, which appears to be missing under Debug builds (`-O0`) when using C++11 (C++03 is OK):\r\n\r\n```\r\n$ grep -IR '__builtin_ia32_pclmulqdq128' /usr/lib\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/include/wmmintrin.h:  return (__m128i) __builtin_ia32_pclmulqdq128 ((__v2di)__X,\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/include/wmmintrin.h:  ((__m128i) __builtin_ia32_pclmulqdq128 ((__v2di)(__m128i)(X), \r\n```\r\n\r\nThere's an open question on Stack Overflow at [Where is __v2di declared when using -std=c++11 under GCC?](http://stackoverflow.com/q/38051959)"},"comment":{"url":"https://api.github.com/repos/weidai11/cryptopp/issues/comments/247896435","html_url":"https://github.com/weidai11/cryptopp/issues/206#issuecomment-247896435","issue_url":"https://api.github.com/repos/weidai11/cryptopp/issues/206","id":247896435,"user":{"login":"noloader","id":3538226,"avatar_url":"https://avatars.githubusercontent.com/u/3538226?v=3","gravatar_id":"","url":"https://api.github.com/users/noloader","html_url":"https://github.com/noloader","followers_url":"https://api.github.com/users/noloader/followers","following_url":"https://api.github.com/users/noloader/following{/other_user}","gists_url":"https://api.github.com/users/noloader/gists{/gist_id}","starred_url":"https://api.github.com/users/noloader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noloader/subscriptions","organizations_url":"https://api.github.com/users/noloader/orgs","repos_url":"https://api.github.com/users/noloader/repos","events_url":"https://api.github.com/users/noloader/events{/privacy}","received_events_url":"https://api.github.com/users/noloader/received_events","type":"User","site_admin":false},"created_at":"2016-09-19T01:13:35Z","updated_at":"2016-09-19T01:13:35Z","body":"I was never able to track down the bad interaction. I tried to diff the preprocessed source files (`-E` instead of `-c`), but there were thousands of lines of differences between a \"good\" and a \"bad\".\r\n\r\nI talked to Wei about the issue. The functionality the library was providing through its own definition of the instrinsics was of marginal value in 2016. In contrast, they were of great value in 2006 or 2008, before all compilers provided them. The compilers being used back then were GCC 4.0.3 to about GCC 4.3.\r\n\r\nCleared at [Commit fb6a11ff08b9277e, Remove library supplied aesenc, aesdec and friends (Issue 206)](http://github.com/weidai11/cryptopp/commit/fb6a11ff08b9277e9f7a2fecae83027d3e0e60df)."}}
{"actor":{"display_login":"noloader"}}