-
-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LLVM 3.6/3.7: d_do_test fails with "Enforcement failed" #855
Comments
The exception is caused by the first call to |
Finally found the culprit: if you use the |
This suggests that the behavior of the LLVM IR module linker changed somehow. It is probably somehow related to static constructors or TLS initialization. |
FYI, I also get this for any other program I tested with 0.15.2-beta1. |
If several modules are linked together, an empty module is used as target. Starting with LLVM 3.6, there seems to be a slight difference between an empty module and a module with IR. The PR uses always the first module as the target. This has the nice side effect that we are no longer affected by LLVM bug 11479.
If several modules are linked together, an empty module is used as target. Starting with LLVM 3.6, there seems to be a slight difference between an empty module and a module with IR. The PR uses always the first module as the target. This has the nice side effect that we are no longer affected by LLVM bug 11479.
If several modules are linked together, an empty module is used as target. Starting with LLVM 3.6, there seems to be a slight difference between an empty module and a module with IR. The PR uses always the first module as the target. This has the nice side effect that we are no longer affected by LLVM bug 11479.
If several modules are linked together, an empty module is used as target. Starting with LLVM 3.6, there seems to be a slight difference between an empty module and a module with IR. The PR uses always the first module as the target. This has the nice side effect that we are no longer affected by LLVM bug 11479.
If several modules are linked together, an empty module is used as target. Starting with LLVM 3.6, there seems to be a slight difference between an empty module and a module with IR. The PR uses always the first module as the target. This has the nice side effect that we are no longer affected by LLVM bug 11479.
If several modules are linked together, an empty module is used as target. Starting with LLVM 3.6, there seems to be a slight difference between an empty module and a module with IR. The PR uses always the first module as the target. This has the nice side effect that we are no longer affected by LLVM bug 11479.
If several modules are linked together, an empty module is used as target. Starting with LLVM 3.6, there seems to be a slight difference between an empty module and a module with IR. The PR uses always the first module as the target. This has the nice side effect that we are no longer affected by LLVM bug 11479.
If several modules are linked together, an empty module is used as target. Starting with LLVM 3.6, there seems to be a slight difference between an empty module and a module with IR. The PR uses always the first module as the target. This has the nice side effect that we are no longer affected by LLVM bug 11479.
If several modules are linked together, an empty module is used as target. Starting with LLVM 3.6, there seems to be a slight difference between an empty module and a module with IR. The PR uses always the first module as the target. This has the nice side effect that we are no longer affected by LLVM bug 11479.
Linking several modules together seems to trigger assertions with identified structs. In debug builds, the assertion !(Pair.first != Ty && Pair.second == Ty) && "mapping to a source type" is raised. In non-debug builds, you often get a D exception saying "Enforcement failed". Reason seems to be the use of the some type object in different modules. E.g. module A imports from module B the struct S. Then both modules refer to the same identifed llvm::StructType object. This causes the errors. The behaviour may be an LLVM bug. There is no test case for this situation. This affects all supported LLVM versions. If the target module is changed (e.g. use of llvmModule[0] instead of an empty module) then the error occurs in other LLVM versions, too. This commit uses the following workaround: - target module is llvmModule[0] (instead of an empty module) - each other module is first linked into an empty module and then into the target module. This is really ugly but avoids the error. There is no new test case required because runnable/A16.d already checks it.
Commit 13fb3f2 hopefully fixes this error. |
Test |
I cannot reproduce this issue on my Gentoo Linux. :-( The fix adds another empty module. It does not crash on Windows.
I cannot reproduce this issue on my Gentoo Linux. :-( The fix adds another empty module. It does not crash on Windows.
We are not using llvm::Linker anymore. |
The
d_do_test
test runner fails withif compiled with LLVM 3.6 and LLVM 3.7. The dmd test suite is not run in Travis because of this.
The text was updated successfully, but these errors were encountered: