-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
[ltsmaster] Emit constructors as .init_array instead of .ctors when appropriate #2883
Conversation
Thx; too bad that ugly piece of code isn't in LLVM itself; it apparently defaults to |
LLVM itself? hm, why does clang then have a check for the GCC installation on Linux: (getTriple().getOS() == llvm::Triple::Linux &&
((!GCCInstallation.isValid() || !V.isOlderThan(4, 7, 0)) ||
getTriple().isAndroid())) |
Yep, as can be seen by compiling with
Don't know, don't care. ;) |
This looks OK to me, besides a missing test case. No need to test all the different possible triples, but a test with one triple and checking that setting that targetOption flag actually does the right thing would be good. |
Nope, no concerns from my side. We must not forget to cherry-pick it to master afterwards. |
@myfreeweb Can you fix the build errors in the CI? (just use #ifdef to remove the checking of triples unknown to older LLVMs) |
AArch64 only supports .init_array, for example. The reason this wasn't discovered earlier is that BFD and gold linkers automatically convert .ctors to .init_array as a performance optimization.
Now passes on travis. Semaphore seems dead |
…dc-developers#2883) AArch64 only supports .init_array, for example. The reason this wasn't discovered earlier is that BFD and gold linkers automatically convert .ctors to .init_array as a performance optimization. Cherry-pick from issue ldc-developers#2883
…r AArch64) (#2896) Nothing to be fixed for master, as LLVM defaults to .init_array unless using an explicit -use-ctors in the cmdline.
AArch64 only supports
.init_array
, for example. The reason this wasn't discovered earlier is that BFD and gold linkers automatically convert.ctors
to.init_array
as a performance optimization.Based on clang code: https://github.com/llvm-mirror/clang/blob/5897428cd24e2deefbcc6f6744c0d7d233aa6747/lib/Driver/ToolChains/Gnu.cpp#L2598-L2620
ldc-developers/druntime#146