This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Change ASAN init/fini kernels linkage to external.
ClosedPublic

Authored by pvellien on Sep 20 2021, 2:00 AM.

Details

Summary

HSA runtime fails to find the symbols for Init and Fini kernels as they mark with internal linkage, changing the linkage to external to fix those errors.

Diff Detail

Event Timeline

pvellien created this revision.Sep 20 2021, 2:00 AM
pvellien requested review of this revision.Sep 20 2021, 2:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 20 2021, 2:00 AM

need a test

Hi @yaxunl It will helpful to know what kind of test is expected to test the linkage type of generated init/fini kernels. The related test-cases for init/fini kernels are added in this patch - https://reviews.llvm.org/D105682

Hi @yaxunl It will helpful to know what kind of test is expected to test the linkage type of generated init/fini kernels. The related test-cases for init/fini kernels are added in this patch - https://reviews.llvm.org/D105682

Need a test to demonstrate and confirm the linkage change.

pvellien updated this revision to Diff 373819.Sep 21 2021, 2:34 AM

Added test.

foad added a comment.Sep 21 2021, 2:39 AM

Nit: first line of commit message should be more like [AMDGPU] Change ASAN init/fini kernels to use external linkage (with a capital letter but without a period). And there's no need to repeat this in the body of the commit message. Either leave it blank, or add some text that explains the reason for the change.

pvellien retitled this revision from [AMDGPU] - change ASAN init/fini kernels linkage to external. to [AMDGPU] Change ASAN init/fini kernels linkage to external..Sep 21 2021, 3:20 AM
pvellien edited the summary of this revision. (Show Details)

@foad thanks.

yaxunl accepted this revision.Sep 21 2021, 7:10 AM

LGTM. Thanks.

This revision is now accepted and ready to land.Sep 21 2021, 7:10 AM

Hi, The failures in the debian builds are not related to this patch changes. I don't have a commit access to llvm trunk, could any of you please land this patch on my behalf. Thanks a lot for your time.

I can help commit this patch. Can you please rebase your work with the latest main branch and upload the patch again, @pvellien ? Thanks

pvellien updated this revision to Diff 375301.Sep 27 2021, 9:27 AM

Rebase on top.

I can help commit this patch. Can you please rebase your work with the latest main branch and upload the patch again, @pvellien ? Thanks

thanks @gandhi21299

gandhi21299 added a comment.EditedSep 27 2021, 9:45 AM

error: lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp: No such file or directory
error: test/CodeGen/AMDGPU/lower-ctor-dtor.ll: No such file or directory
error: test/CodeGen/AMDGPU/lower-multiple-ctor-dtor.ll: No such file or directory

These errors were issued again despite llvm-project being up to date on my system. I manually implemented the changes. I am running all tests anyways and will push it once the tests pass.

This revision was landed with ongoing or failed builds.Sep 27 2021, 10:50 AM
This revision was automatically updated to reflect the committed changes.