{"action":"created","issue":{"url":"https://api.github.com/repos/ldc-developers/ldc/issues/2278","repository_url":"https://api.github.com/repos/ldc-developers/ldc","labels_url":"https://api.github.com/repos/ldc-developers/ldc/issues/2278/labels{/name}","comments_url":"https://api.github.com/repos/ldc-developers/ldc/issues/2278/comments","events_url":"https://api.github.com/repos/ldc-developers/ldc/issues/2278/events","html_url":"https://github.com/ldc-developers/ldc/issues/2278","id":250790687,"number":2278,"title":"Lit-test failed, LDC origin/master, LLVM 4.0.1","user":{"login":"Fatmice","id":8956281,"avatar_url":"https://avatars0.githubusercontent.com/u/8956281?v=4","gravatar_id":"","url":"https://api.github.com/users/Fatmice","html_url":"https://github.com/Fatmice","followers_url":"https://api.github.com/users/Fatmice/followers","following_url":"https://api.github.com/users/Fatmice/following{/other_user}","gists_url":"https://api.github.com/users/Fatmice/gists{/gist_id}","starred_url":"https://api.github.com/users/Fatmice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fatmice/subscriptions","organizations_url":"https://api.github.com/users/Fatmice/orgs","repos_url":"https://api.github.com/users/Fatmice/repos","events_url":"https://api.github.com/users/Fatmice/events{/privacy}","received_events_url":"https://api.github.com/users/Fatmice/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":44,"created_at":"2017-08-16T23:39:53Z","updated_at":"2017-09-09T16:17:15Z","closed_at":null,"author_association":"NONE","body":"I built and install llvm 4.0.1 with\r\n`cmake -DCMAKE_INSTALL_PREFIX=../llvm-test -DLLVM_TARGETS_TO_BUILD=\"X86;AArch64;ARM;PowerPC\" -DLLVM_BINUTILS_INCDIR=/usr/include -DCMAKE_BUILD_TYPE=Release -DLLVM_LIBDIR_SUFFIX=64 ../llvm`\r\nThen built and test ldc origin/master with\r\n`cmake -DCMAKE_INSTALL_PREFIX=../ldc-test -DINCLUDE_PATH=import -DCMAKE_BUILD_TYPE=Release -DLIB_SUFFIX=64 -DLDC_INSTALL_LTOPLUGIN=ON -DLDC_INSTALL_LLVM_RUNTIME_LIBS=ON -DLLVM_ROOT_DIR=../llvm-test -DD_COMPILER=../install/ldc-0.17.4-bootstrap/bin/ldmd2 ../ldc`\r\n\r\nAll tests passed except for two of the lit tests.\r\nlinking/thinlto_modulecdtors.d (134 of 153)\r\nlinking/thinlto_modulecdtors_2.d (144 of 153)\r\nHere's [complete log](https://gist.githubusercontent.com/Fatmice/ef8dd6750b1a9cb98d03f193f5d96bb1/raw/4d5d1dad97bdc9f7e9a5675d04fa57c8f05cb28f/LastTest.log)\r\n\r\nThe relevant portions\r\n```\r\nFAIL: LDC :: linking/thinlto_modulecdtors.d (134 of 153)\r\n******************** TEST 'LDC :: linking/thinlto_modulecdtors.d' FAILED ********************\r\nScript:\r\n--\r\n/home/quyen/D/ldc-build/bin/ldc2 -flto=thin -O3 -run /home/quyen/D/ldc/tests/linking/thinlto_modulecdtors.d | FileCheck /home/quyen/D/ldc/tests/linking/thinlto_modulecdtors.d\r\n--\r\nExit Code: 2\r\n\r\nCommand Output (stdout):\r\n--\r\n$ \"/home/quyen/D/ldc-build/bin/ldc2\" \"-flto=thin\" \"-O3\" \"-run\" \"/home/quyen/D/ldc/tests/linking/thinlto_modulecdtors.d\"\r\n# command stderr:\r\nError: /tmp/thinlto_modulecdtors-93a9e0a-1f491d failed with status: -2\r\nError: message: Illegal instruction (core dumped)\r\nError: program received signal 2 (Interrupt)\r\n\r\nerror: command failed with exit status: 2\r\n$ \"FileCheck\" \"/home/quyen/D/ldc/tests/linking/thinlto_modulecdtors.d\"\r\n# command stderr:\r\nFileCheck error: '-' is empty.\r\nFileCheck command line:  FileCheck /home/quyen/D/ldc/tests/linking/thinlto_modulecdtors.d\r\n\r\nerror: command failed with exit status: 2\r\n\r\n--\r\n\r\n********************\r\nUNSUPPORTED: LDC :: sanitizers/asan_dynalloc.d (135 of 153)\r\nUNSUPPORTED: LDC :: sanitizers/asan_interface.d (136 of 153)\r\nUNSUPPORTED: LDC :: sanitizers/asan_stackoverflow.d (137 of 153)\r\nPASS: LDC :: sanitizers/fsanitize_address.d (138 of 153)\r\nPASS: LDC :: linking/thinlto_pgo.d (139 of 153)\r\nPASS: LDC :: sanitizers/fsanitize_blacklist.d (140 of 153)\r\nPASS: LDC :: sanitizers/fsanitize_error_diagnostic.d (141 of 153)\r\nPASS: LDC :: sanitizers/fsanitize_coverage.d (142 of 153)\r\nPASS: LDC :: sanitizers/fsanitize_thread.d (143 of 153)\r\nFAIL: LDC :: linking/thinlto_modulecdtors_2.d (144 of 153)\r\n******************** TEST 'LDC :: linking/thinlto_modulecdtors_2.d' FAILED ********************\r\nScript:\r\n--\r\n/home/quyen/D/ldc-build/bin/ldc2 -flto=thin -O3 /home/quyen/D/ldc/tests/linking/inputs/thinlto_ctor.d -run /home/quyen/D/ldc/tests/linking/thinlto_modulecdtors_2.d | FileCheck --check-prefix=EXECUTE /home/quyen/D/ldc/tests/linking/thinlto_modulecdtors_2.d\r\n--\r\nExit Code: 2\r\n\r\nCommand Output (stdout):\r\n--\r\n$ \"/home/quyen/D/ldc-build/bin/ldc2\" \"-flto=thin\" \"-O3\" \"/home/quyen/D/ldc/tests/linking/inputs/thinlto_ctor.d\" \"-run\" \"/home/quyen/D/ldc/tests/linking/thinlto_modulecdtors_2.d\"\r\n# command stderr:\r\nError: /tmp/thinlto_modulecdtors_2-939d98e-2558f3 failed with status: -2\r\nError: message: Illegal instruction (core dumped)\r\nError: program received signal 2 (Interrupt)\r\n\r\nerror: command failed with exit status: 2\r\n$ \"FileCheck\" \"--check-prefix=EXECUTE\" \"/home/quyen/D/ldc/tests/linking/thinlto_modulecdtors_2.d\"\r\n# command stderr:\r\nFileCheck error: '-' is empty.\r\nFileCheck command line:  FileCheck --check-prefix=EXECUTE /home/quyen/D/ldc/tests/linking/thinlto_modulecdtors_2.d\r\n\r\nerror: command failed with exit status: 2\r\n\r\n--\r\n\r\n********************\r\nUNSUPPORTED: LDC :: sanitizers/fuzz_basic.d (145 of 153)\r\nUNSUPPORTED: LDC :: sanitizers/fuzz_asan.d (146 of 153)\r\nUNSUPPORTED: LDC :: sanitizers/link_fuzzer.d (147 of 153)\r\nPASS: LDC :: sanitizers/fsanitize_fuzzer.d (148 of 153)\r\nPASS: LDC :: semantic/target_traits_diag.d (149 of 153)\r\nPASS: LDC :: semantic/dcompute.d (150 of 153)\r\nPASS: LDC :: semantic/target_traits.d (151 of 153)\r\nPASS: LDC :: linking/ir2obj_cache_pruning2.d (152 of 153)\r\nPASS: LDC :: tools/ldc_prune_cache_1.d (153 of 153)\r\nTesting Time: 20.31s\r\n********************\r\nFailing Tests (2):\r\n    LDC :: linking/thinlto_modulecdtors.d\r\n    LDC :: linking/thinlto_modulecdtors_2.d\r\n\r\n  Expected Passes    : 128\r\n  Unsupported Tests  : 23\r\n  Unexpected Failures: 2\r\n<end of output>\r\nTest time =  20.59 sec\r\n----------------------------------------------------------\r\nTest Failed.\r\n\"lit-tests\" end time: Aug 16 16:24 CDT\r\n\"lit-tests\" time elapsed: 00:00:20\r\n----------------------------------------------------------\r\n\r\nEnd testing: Aug 16 16:24 CDT\r\n```\r\n\r\nI then make install the ldc build and try to repeat those two tests\r\n[linking/thinlto_modulecdtors.d](https://gist.github.com/Fatmice/37892dd004e4dc812017f9e028bea752#file-linking-thinlto_modulecdtors-d)\r\n[linking/thinlto_modulecdtors_2.d](https://gist.github.com/Fatmice/37892dd004e4dc812017f9e028bea752#file-linking-thinlto_modulecdtors_2-d)\r\nRunning the executables from these two always resulted in Illegal instruction (core dumped) when -flto=thin is used but -flto=full will run without problem.\r\n[linking/thinlto_modulecdtors.d](https://gist.github.com/Fatmice/1f243c049de1f1fd2efd1338530a6c7e#file-linking-thinlto_modulecdtors-d)\r\n[linking/thinlto_modulecdtors_2.d](https://gist.github.com/Fatmice/1f243c049de1f1fd2efd1338530a6c7e#file-linking-thinlto_modulecdtors_2-d)\r\n\r\nWhat is the issue here? @JohanEngelen ? "},"comment":{"url":"https://api.github.com/repos/ldc-developers/ldc/issues/comments/328287145","html_url":"https://github.com/ldc-developers/ldc/issues/2278#issuecomment-328287145","issue_url":"https://api.github.com/repos/ldc-developers/ldc/issues/2278","id":328287145,"user":{"login":"klickverbot","id":19335,"avatar_url":"https://avatars1.githubusercontent.com/u/19335?v=4","gravatar_id":"","url":"https://api.github.com/users/klickverbot","html_url":"https://github.com/klickverbot","followers_url":"https://api.github.com/users/klickverbot/followers","following_url":"https://api.github.com/users/klickverbot/following{/other_user}","gists_url":"https://api.github.com/users/klickverbot/gists{/gist_id}","starred_url":"https://api.github.com/users/klickverbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klickverbot/subscriptions","organizations_url":"https://api.github.com/users/klickverbot/orgs","repos_url":"https://api.github.com/users/klickverbot/repos","events_url":"https://api.github.com/users/klickverbot/events{/privacy}","received_events_url":"https://api.github.com/users/klickverbot/received_events","type":"User","site_admin":false},"created_at":"2017-09-09T16:17:15Z","updated_at":"2017-09-09T16:17:15Z","author_association":"OWNER","body":"Ah, seems like I misunderstood the semantics of `local_unnamed_addr`; looking at LangRef again, it should be fine.\r\n\r\nIf I understand correctly, the (thin) LTO main executable is linked against a conventional runtime library archive here, right? In this case, internalising `ldc.dso_initialized` (and hence dropping it from the symbol table) would lead to `_d_dso_registry` being called twice for the program image; once from the program's own ctor and once from the copy inside druntime.\r\n\r\n> If this problem still occurs, then clearly it is not LLVM\r\n\r\nNot necessarily – we are regularly finding bugs in LLVM that are not in the subset exercised by Clang. Of course, from a practical point of view we will still have to work around it on our side."}}
{"actor":{"display_login":"klickverbot"}}