On AIX, add '-bcdtors:all:0:s' to the linker implicitly through the driver so that we can collect all static constructor and destructor functions.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/test/Driver/aix-ld.cpp | ||
---|---|---|
3 ↗ | (On Diff #265631) | formatting, align with the line above |
clang/test/Driver/aix-ld.cpp | ||
---|---|---|
9 ↗ | (On Diff #265765) | I am not sure I've seen this used in conjunction with %clangxx. |
clang/test/Driver/aix-ld.cpp | ||
---|---|---|
18 ↗ | (On Diff #265765) | The main point of the test being that -bnocdtors from the user is not overriden by the implied -bcdtors:all:0:s, I think we should drop these last two lines and add a CHECK-LD32-ARG-ORDER-NOT against -bcdtors:all:0:s. |
clang/test/Driver/aix-ld.cpp | ||
---|---|---|
2 ↗ | (On Diff #265781) | I am wondering if it makes sense to put this into aix-ld.c. It helps to demonstrate that the link step behaviour is not determined by the source file name. For example, in hexagon-toolchain-elf.c: 182 // RUN: %clangxx -### -target hexagon-unknown-elf \ 183 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 184 // RUN: -mcpu=hexagonv60 \ 185 // RUN: %s 2>&1 \ 186 // RUN: | FileCheck -check-prefix=CHECK031 %s |
clang/test/Driver/aix-ld.cpp | ||
---|---|---|
2 ↗ | (On Diff #265781) | Yes, it makes sense to show that, and that was my original design. I moved this to a separate file to avoid getting a warning because of the inherited CHECK-LD32-ARG-ORDER-NOT: warning:. I'm now thinking of two ways to incorporate this into aix-ld.c,
// CHECK-LD32-ARG-ORDER-NOT: warning: // CHECK-LD32-ARG-ORDER: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] // CHECK-LD32-ARG-ORDER-NOT: warning: Do we have a preference for one way over another? |
clang/test/Driver/aix-ld.cpp | ||
---|---|---|
2 ↗ | (On Diff #265781) | I think not adding something extra is better than adding something extra that's not particularly relevant. The intended behaviour for what we're testing is the same even if the deprecated behaviour is finally actually removed (and maybe with the removal of or a change to the warning message). |
I'm planning to post an NFC patch after this to fix the formatting for existing cases in 'aix-ld.c' so that everything is consistent.
Thanks. LGTM with minor nit.
I'm not sure how NFC it is, but I would suggest removing the -o %t.o from the other cases as well.
clang/test/Driver/aix-ld.c | ||
---|---|---|
184 | Minor nit: Maybe the prefix should be CHECK-LD32-CXX-ARG-ORDER. |
Minor nit: Maybe the prefix should be CHECK-LD32-CXX-ARG-ORDER.