[PATCH] D88500: [AIX][Clang][Driver] Link libm along with libc++

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 29 11:51:44 PDT 2020


hubert.reinterpretcast added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/AIX.cpp:165
 
+    // Since libc++ has dependencies on libm, if we have one then add the other.
+    if (getToolChain().ShouldLinkCXXStdlib(Args))
----------------
Is that right?

My check of the libc++ from XL C/C++ for AIX 16.1.0 shows a dependency on `libC.a`, but not `libm.a`:
```
[183]	0x00000000    undef      IMP     DS EXTref libC.a(shrcore.o) uncaught_exception__3stdFv
```

It seems `-lm` is just linked for C++ invocations. Other targets also pick up `-lm` for C++ invocations as a stdlib (not specifically a C++ stdlib).


================
Comment at: clang/lib/Driver/ToolChains/AIX.cpp:168
+      CmdArgs.push_back("-lm");
     CmdArgs.push_back("-lc");
   }
----------------
Minor nit: Given the spacing in this block, I think a blank line would be appropriate to have before this one.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88500/new/

https://reviews.llvm.org/D88500



More information about the cfe-commits mailing list