This is an archive of the discontinued LLVM Phabricator instance.

[AIX] XFAIL CodeGen/Generic/externally_available.ll
ClosedPublic

Authored by jsji on May 12 2021, 4:07 PM.

Details

Summary
Globals with “available_externally” linkage should never be emitted into the
object file corresponding to the LLVM module.

However, AIX system assembler default print error for undefined reference .
so AIX chose to emit the available externally symbols into .s,
so that users won't run into errors in situations like:

clang -target powerpc-ibm-aix -xc -<<<$'extern inline
__attribute__((__gnu_inline__)) void foo() {}\nvoid bar() { foo(); }' -O
-Xclang -disable-llvm-passes

Diff Detail

Event Timeline

jsji created this revision.May 12 2021, 4:07 PM
jsji requested review of this revision.May 12 2021, 4:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2021, 4:07 PM
hubert.reinterpretcast requested changes to this revision.May 12 2021, 4:58 PM

It is not acceptable on AIX to emit references to symbols without declaring them unless if using as -u, which is less desirable than if the -u is not needed.

After:

$ clang -target powerpc-ibm-aix -xc -<<<$'extern inline __attribute__((__gnu_inline__)) void foo() {}\nvoid bar() { foo(); }' -O -Xclang -disable-llvm-passes -S -o - | grep -F foo
        bl .foo

Before:

bl .foo
.extern .foo
.extern foo[DS]
This revision now requires changes to proceed.May 12 2021, 4:58 PM
jsji updated this revision to Diff 345031.May 12 2021, 9:02 PM

XFAIL the tests with comments.

jsji retitled this revision from [AIX] Do NOT emit avaiable externally symbols to [AIX] XFAIL CodeGen/Generic/externally_available.ll.May 12 2021, 9:02 PM
jsji edited the summary of this revision. (Show Details)
jsji added a comment.May 12 2021, 9:04 PM

It is not acceptable on AIX to emit references to symbols without declaring them unless if using as -u, which is less desirable than if the -u is not needed.

Thanks for the background, given that this was done intentionally, mark the test XFAIL on AIX with comments.

I think emitting only as a symbol table entry of a locally-undefined symbol is fine here. LGTM; thanks!

This revision is now accepted and ready to land.May 12 2021, 9:26 PM
This revision was automatically updated to reflect the committed changes.