Skip to content

[AIX]export function descriptor symbols related to template functions. #101920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 6, 2024

Conversation

chenzheng1030
Copy link
Collaborator

@chenzheng1030 chenzheng1030 commented Aug 5, 2024

This fixes regressions caused by #97526

After that patch, all undefined references to DS symbol are removed. This makes DS symbols(for template functions) have no reference in some cases. So extract_symbols.py does not export these DS symbols for these cases.

On AIX, exporting the function descriptor depends on references to the function descriptor itself and the function entry symbol.

Without this fix, on AIX, we get:

rtld: 0712-001 Symbol _ZN4llvm15SmallVectorBaseIjE13mallocForGrowEPvmmRm was referenced
      from module llvm-project/build/unittests/Passes/Plugins/TestPlugin.so(), but a runtime definition
            of the symbol was not found. 

Copy link
Collaborator

@hubert-reinterpretcast hubert-reinterpretcast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem right to me: I think the intent is not to ignore the template-related behaviour for AIX function descriptors, but to base the determination on whether they are referenced on whether the function descriptor or the entry point is referenced.

@chenzheng1030
Copy link
Collaborator Author

This does not seem right to me: I think the intent is not to ignore the template-related behaviour for AIX function descriptors, but to base the determination on whether they are referenced on whether the function descriptor or the entry point is referenced.

Thanks. Agreed. There should still be cases where the function descriptors for template functions should not be exported. Will update the patch.

Copy link

github-actions bot commented Aug 6, 2024

✅ With the latest revision this PR passed the Python code formatter.

Copy link
Collaborator

@hubert-reinterpretcast hubert-reinterpretcast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; thanks!

@chenzheng1030 chenzheng1030 merged commit 396343f into llvm:main Aug 6, 2024
5 of 7 checks passed
@chenzheng1030 chenzheng1030 deleted the extractsymbol branch August 6, 2024 03:07
@chenzheng1030
Copy link
Collaborator Author

/cherry-pick 396343f

@chenzheng1030 chenzheng1030 added this to the LLVM 19.X Release milestone Aug 8, 2024
llvmbot pushed a commit to llvmbot/llvm-project that referenced this pull request Aug 8, 2024
llvm#101920)

This fixes regressions caused by
llvm#97526

After that patch, all undefined references to DS symbol are removed.
This makes DS symbols(for template functions) have no reference in some
cases. So extract_symbols.py does not export these DS symbols for these
cases.

On AIX, exporting the function descriptor depends on references to the
function descriptor itself and the function entry symbol.

Without this fix, on AIX, we get:
```
rtld: 0712-001 Symbol _ZN4llvm15SmallVectorBaseIjE13mallocForGrowEPvmmRm was referenced
      from module llvm-project/build/unittests/Passes/Plugins/TestPlugin.so(), but a runtime definition
            of the symbol was not found.
```

(cherry picked from commit 396343f)
@llvmbot
Copy link
Member

llvmbot commented Aug 8, 2024

/pull-request #102407

tru pushed a commit to llvmbot/llvm-project that referenced this pull request Aug 10, 2024
llvm#101920)

This fixes regressions caused by
llvm#97526

After that patch, all undefined references to DS symbol are removed.
This makes DS symbols(for template functions) have no reference in some
cases. So extract_symbols.py does not export these DS symbols for these
cases.

On AIX, exporting the function descriptor depends on references to the
function descriptor itself and the function entry symbol.

Without this fix, on AIX, we get:
```
rtld: 0712-001 Symbol _ZN4llvm15SmallVectorBaseIjE13mallocForGrowEPvmmRm was referenced
      from module llvm-project/build/unittests/Passes/Plugins/TestPlugin.so(), but a runtime definition
            of the symbol was not found.
```

(cherry picked from commit 396343f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

3 participants