[PATCH] D91361: [AIX][driver] Include crti[_64].o and -bcdtors also for C language link invocations by default
Xiangling Liao via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 12 13:59:26 PST 2020
Xiangling_L added inline comments.
================
Comment at: clang/lib/Driver/ToolChains/AIX.cpp:137
- if (D.CCCIsCXX())
+ if (D.CCCIsCXX() || D.CCCIsCC())
CmdArgs.push_back(Args.MakeArgString(
----------------
daltenty wrote:
> I think that rather that adding CC, we should just pull the if and unconditionally link crti.o. This is consistent with what is done on other platforms and since the `llvm.global_c/dtors` are generally allowable in the IR, we might see them in more than just the two driver scenarios suggested here.
> we should just pull the if and unconditionally link crti.o. ...we might see them in more than just the two driver scenarios suggested here.
I was thinking to use the code to document what exactly happen is under c++ and c mode we link crti.o. But I think it makes sense to just remove `if` as you said. But we can indicate it's something for C and CXX mode only? Cuz as far as I know, there are c++, c, preprocessor, cl and flang driver mode. I think it only make sense for us to see static init functions generated in IR in c++ and c mode on AIX?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91361/new/
https://reviews.llvm.org/D91361
More information about the cfe-commits
mailing list