This is an archive of the discontinued LLVM Phabricator instance.

[AIX][Clang][Driver] Link libm in c++ mode
ClosedPublic

Authored by daltenty on Sep 29 2020, 9:56 AM.

Details

Summary

since that is the normal behaviour of other compilers on the platform.

Diff Detail

Event Timeline

daltenty created this revision.Sep 29 2020, 9:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 29 2020, 9:56 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
daltenty requested review of this revision.Sep 29 2020, 9:56 AM
clang/lib/Driver/ToolChains/AIX.cpp
165

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).

167

Minor nit: Given the spacing in this block, I think a blank line would be appropriate to have before this one.

daltenty retitled this revision from [AIX][Clang][Driver] Link libm along with libc++ to [AIX][Clang][Driver] Link libm when we would libc++.Sep 29 2020, 1:46 PM
daltenty edited the summary of this revision. (Show Details)
daltenty updated this revision to Diff 295105.Sep 29 2020, 1:48 PM
  • Remove deps comment
daltenty updated this revision to Diff 295107.Sep 29 2020, 1:49 PM
  • Add blank line
daltenty marked an inline comment as done.Sep 29 2020, 1:50 PM
daltenty retitled this revision from [AIX][Clang][Driver] Link libm when we would libc++ to [AIX][Clang][Driver] Link libm in c++ mode.Sep 29 2020, 1:55 PM
daltenty updated this revision to Diff 295111.Sep 29 2020, 1:56 PM
daltenty marked an inline comment as done.
  • Make dependant on just c++ mode
  • Add missing colons
Harbormaster completed remote builds in B73420: Diff 295107.

LGTM with minor comments.

clang/test/Driver/aix-ld.c
406

Typo.

446

Formatting.

448

Same comment.

This revision is now accepted and ready to land.Sep 29 2020, 3:32 PM
daltenty marked 3 inline comments as done.Sep 30 2020, 10:38 AM
This revision was automatically updated to reflect the committed changes.